Options
All
  • Public
  • Public/Protected
  • All
Menu

Module index

Index

Type aliases

ContractSubStateQueryCast

ContractSubStateQueryCast<Keys>: Partial<{ [ Key in Keys]: "*" | ContractSubStateQuery }>

Type parameters

  • Keys: string

ReplaceStar

ReplaceStar<T>: { [ P in keyof T]: T[P] extends "*" ? unknown : T[P] extends {} ? ReplaceStar<T[P]> : T[P] }

Type parameters

  • T

TXLog

TXLog: (t: Transaction, msg: string) => void

Type declaration

    • (t: Transaction, msg: string): void
    • Parameters

      • t: Transaction
      • msg: string

      Returns void

Variables

MAGENTA

MAGENTA: "\u001b[35m%s\u001b[0m" = "\x1B[35m%s\x1b[0m"

Functions

concatHashed

  • concatHashed(...hashes: string[]): string
  • Parameters

    • Rest ...hashes: string[]

    Returns string

createAccount

  • createAccount(): { account: Account; address: ByStr20; pubkey: ByStr33 }

getBalance

  • getBalance(getZil: (requireSigner?: boolean) => Promise<{ zil: Zilliqa; teardown: any }>, a: ByStr20): Promise<Uint128>
  • Parameters

    • getZil: (requireSigner?: boolean) => Promise<{ zil: Zilliqa; teardown: any }>
        • (requireSigner?: boolean): Promise<{ zil: Zilliqa; teardown: any }>
        • Parameters

          • Optional requireSigner: boolean

          Returns Promise<{ zil: Zilliqa; teardown: any }>

    • a: ByStr20

    Returns Promise<Uint128>

getHashed

  • getHashed<T>(...hashes: T): { args: [...T]; chequeHash: string }
  • Type parameters

    • T: Signable[]

    Parameters

    • Rest ...hashes: T

    Returns { args: [...T]; chequeHash: string }

    • args: [...T]
    • chequeHash: string

getMainnetResolvers

  • returns resolvers to mainnet

    Parameters

    • Optional a: Account

      optional zilliqa account

    Returns SDKResolvers

getMinGasPrice

  • getMinGasPrice(zil: Zilliqa): Promise<{ gasPrice: BN }>
  • get min gas price return already as BN

    Parameters

    • zil: Zilliqa

    Returns Promise<{ gasPrice: BN }>

Const mappedPartialState

  • mappedPartialState(getZil: (requireSigner?: boolean) => Promise<{ zil: Zilliqa; teardown: any }>): (...partial: { contractAddress: ByStr20; includeBalance?: "true" | "false"; includeInit?: "true" | "false"; query: ContractSubStateQuery }[]) => Promise<{}>
  • Parameters

    • getZil: (requireSigner?: boolean) => Promise<{ zil: Zilliqa; teardown: any }>

      from SDK resolvers

        • (requireSigner?: boolean): Promise<{ zil: Zilliqa; teardown: any }>
        • Parameters

          • Optional requireSigner: boolean

          Returns Promise<{ zil: Zilliqa; teardown: any }>

    Returns (...partial: { contractAddress: ByStr20; includeBalance?: "true" | "false"; includeInit?: "true" | "false"; query: ContractSubStateQuery }[]) => Promise<{}>

    a map by address of the different contracts state you asked for the state map is indexed by address with ByStr20.toBech32()

      • (...partial: { contractAddress: ByStr20; includeBalance?: "true" | "false"; includeInit?: "true" | "false"; query: ContractSubStateQuery }[]): Promise<{}>
      • Parameters

        • Rest ...partial: { contractAddress: ByStr20; includeBalance?: "true" | "false"; includeInit?: "true" | "false"; query: ContractSubStateQuery }[]

        Returns Promise<{}>

Const normaliseAddress

  • normaliseAddress(address: string): string
  • Parameters

    • address: string

    Returns string

Const partialState

  • partialState(getZil: () => Promise<Zilliqa>): <T, E, B, Init>(...partial: B[]) => Promise<({ _this_address: ByStr20 } & ReplaceStar<T> & { _init: IsTrue<E, Init> })[]>
  • Parameters

    • getZil: () => Promise<Zilliqa>

      resolver to a zilliqa object

        • (): Promise<Zilliqa>
        • Returns Promise<Zilliqa>

    Returns <T, E, B, Init>(...partial: B[]) => Promise<({ _this_address: ByStr20 } & ReplaceStar<T> & { _init: IsTrue<E, Init> })[]>

    the state of the contracts lower level method using the boost-zil skds .state() is recommended instead

      • <T, E, B, Init>(...partial: B[]): Promise<({ _this_address: ByStr20 } & ReplaceStar<T> & { _init: IsTrue<E, Init> })[]>
      • Type parameters

        Parameters

        • Rest ...partial: B[]

        Returns Promise<({ _this_address: ByStr20 } & ReplaceStar<T> & { _init: IsTrue<E, Init> })[]>

sendZIL

  • Send zil to an account convinience method

    Parameters

    Returns Promise<Transaction>

    the transaction if successful

Const signTransition

  • signTransition(contractAddress: ByStr20): (transitionName: string) => (account: Account) => <T>(...args: T) => { args: [...T[], Uint128, ByStr64]; chequeHash: string }
  • dev

    signs the args in order like in the contracts implementation appending the nonce transition name _this_address at the end of the sig payload

    Parameters

    Returns (transitionName: string) => (account: Account) => <T>(...args: T) => { args: [...T[], Uint128, ByStr64]; chequeHash: string }

      • (transitionName: string): (account: Account) => <T>(...args: T) => { args: [...T[], Uint128, ByStr64]; chequeHash: string }
      • Parameters

        • transitionName: string

        Returns (account: Account) => <T>(...args: T) => { args: [...T[], Uint128, ByStr64]; chequeHash: string }

          • (account: Account): <T>(...args: T) => { args: [...T[], Uint128, ByStr64]; chequeHash: string }
          • Parameters

            • account: Account

            Returns <T>(...args: T) => { args: [...T[], Uint128, ByStr64]; chequeHash: string }

              • <T>(...args: T): { args: [...T[], Uint128, ByStr64]; chequeHash: string }
              • Type parameters

                • T: Signable[]

                Parameters

                • Rest ...args: T

                Returns { args: [...T[], Uint128, ByStr64]; chequeHash: string }

signWithAccount

  • signWithAccount(cheque_hash: string, acc: Account): ByStr64

Const signWithContractAddress

  • signWithContractAddress(contractAddress: ByStr20): (account: Account) => <T>(...args: T) => [...T[], ByStr64]
  • dev

    signs the args in order like in the contracts implementation appending the contract address | _this_address at the end of the sig payload

    Parameters

    Returns (account: Account) => <T>(...args: T) => [...T[], ByStr64]

      • (account: Account): <T>(...args: T) => [...T[], ByStr64]
      • Parameters

        • account: Account

        Returns <T>(...args: T) => [...T[], ByStr64]

          • Type parameters

            • T: Signable[]

            Parameters

            • Rest ...args: T

            Returns [...T[], ByStr64]

Const toAddrKey

  • toAddrKey(s: string): string

verifySignature

  • verifySignature(cheque_hash: string, signature: string, pubkey: string): boolean
  • Parameters

    • cheque_hash: string

      starts with 0x or not

    • signature: string

      starts with 0x or not

    • pubkey: string

      starts with 0x or not

    Returns boolean

    if valid

Generated using TypeDoc