Evolution SDK

Withdrawals.ts

Withdrawals overview


Table of contents


constructors

empty

Create an empty Withdrawals instance.

Signature

export declare const empty: () => Withdrawals

Added in v2.0.0

fromEntries

Create a Withdrawals instance from an array of [RewardAccount, Coin] pairs.

Signature

export declare const fromEntries: (entries: Array<[RewardAccount.RewardAccount, Coin.Coin]>) => Withdrawals

Added in v2.0.0

singleton

Create a Withdrawals instance with a single withdrawal.

Signature

export declare const singleton: (rewardAccount: RewardAccount.RewardAccount, coin: Coin.Coin) => Withdrawals

Added in v2.0.0

encoding

toCBORBytes

Convert a Withdrawals to CBOR bytes.

Signature

export declare const toCBORBytes: (data: Withdrawals, options?: CBOR.CodecOptions) => any

Added in v2.0.0

toCBORHex

Convert a Withdrawals to CBOR hex string.

Signature

export declare const toCBORHex: (data: Withdrawals, options?: CBOR.CodecOptions) => string

Added in v2.0.0

model

Withdrawals (class)

Schema for Withdrawals representing a map of reward accounts to coin amounts.

withdrawals = {+ reward_account => coin}

Signature

export declare class Withdrawals

Added in v2.0.0

toJSON (method)

Signature

toJSON()

toString (method)

Signature

toString(): string

[Inspectable.NodeInspectSymbol] (method)

Signature

[Inspectable.NodeInspectSymbol](): unknown

[Equal.symbol] (method)

Signature

[Equal.symbol](that: unknown): boolean

[Hash.symbol] (method)

Content-based hash for optimization of Equal.equals.

Signature

[Hash.symbol](): number

Added in v2.0.0

parsing

fromCBORBytes

Parse a Withdrawals from CBOR bytes.

Signature

export declare const fromCBORBytes: (bytes: Uint8Array, options?: CBOR.CodecOptions) => Withdrawals

Added in v2.0.0

fromCBORHex

Parse a Withdrawals from CBOR hex string.

Signature

export declare const fromCBORHex: (hex: string, options?: CBOR.CodecOptions) => Withdrawals

Added in v2.0.0

predicates

has

Check if Withdrawals contains a specific reward account.

Signature

export declare const has: (withdrawals: Withdrawals, rewardAccount: RewardAccount.RewardAccount) => boolean

Added in v2.0.0

isEmpty

Check if Withdrawals is empty.

Signature

export declare const isEmpty: (withdrawals: Withdrawals) => boolean

Added in v2.0.0

isWithdrawals

Check if the given value is a valid Withdrawals

Signature

export declare const isWithdrawals: (u: unknown, overrideOptions?: ParseOptions | number) => u is Withdrawals

Added in v2.0.0

schemas

FromCBORBytes

CBOR bytes transformation schema for Withdrawals.

Signature

export declare const FromCBORBytes: (
  options?: CBOR.CodecOptions
) => Schema.transform<
  Schema.transformOrFail<
    typeof Schema.Uint8ArrayFromSelf,
    Schema.declare<CBOR.CBOR, CBOR.CBOR, readonly [], never>,
    never
  >,
  Schema.transformOrFail<
    Schema.MapFromSelf<typeof Schema.Uint8ArrayFromSelf, typeof Schema.BigIntFromSelf>,
    Schema.SchemaClass<Withdrawals, Withdrawals, never>,
    never
  >
>

Added in v2.0.0

FromCBORHex

CBOR hex transformation schema for Withdrawals.

Signature

export declare const FromCBORHex: (
  options?: CBOR.CodecOptions
) => Schema.transform<
  Schema.Schema<Uint8Array, string, never>,
  Schema.transform<
    Schema.transformOrFail<
      typeof Schema.Uint8ArrayFromSelf,
      Schema.declare<CBOR.CBOR, CBOR.CBOR, readonly [], never>,
      never
    >,
    Schema.transformOrFail<
      Schema.MapFromSelf<typeof Schema.Uint8ArrayFromSelf, typeof Schema.BigIntFromSelf>,
      Schema.SchemaClass<Withdrawals, Withdrawals, never>,
      never
    >
  >
>

Added in v2.0.0

FromCDDL

CDDL schema for Withdrawals.

withdrawals = {+ reward_account => coin}

Signature

export declare const FromCDDL: Schema.transformOrFail<
  Schema.MapFromSelf<typeof Schema.Uint8ArrayFromSelf, typeof Schema.BigIntFromSelf>,
  Schema.SchemaClass<Withdrawals, Withdrawals, never>,
  never
>

Added in v2.0.0

testing

arbitrary

FastCheck arbitrary for Withdrawals instances.

Signature

export declare const arbitrary: FastCheck.Arbitrary<Withdrawals>

Added in v2.0.0

transformation

add

Add a withdrawal to existing Withdrawals.

Signature

export declare const add: (
  withdrawals: Withdrawals,
  rewardAccount: RewardAccount.RewardAccount,
  coin: Coin.Coin
) => Withdrawals

Added in v2.0.0

entries

Get all entries as an array of [reward account, coin] pairs.

Signature

export declare const entries: (withdrawals: Withdrawals) => Array<[RewardAccount.RewardAccount, Coin.Coin]>

Added in v2.0.0

get

Get the coin amount for a specific reward account.

Signature

export declare const get: (
  withdrawals: Withdrawals,
  rewardAccount: RewardAccount.RewardAccount
) => Coin.Coin | undefined

Added in v2.0.0

remove

Remove a withdrawal from existing Withdrawals.

Signature

export declare const remove: (withdrawals: Withdrawals, rewardAccount: RewardAccount.RewardAccount) => Withdrawals

Added in v2.0.0

size

Get the size (number of withdrawals) in Withdrawals.

Signature

export declare const size: (withdrawals: Withdrawals) => number

Added in v2.0.0

utils

CDDLSchema

Signature

export declare const CDDLSchema: Schema.MapFromSelf<typeof Schema.Uint8ArrayFromSelf, typeof Schema.BigIntFromSelf>