Constructors

  • Parameters

    • parameters: TonClientParameters

    Returns TonClient

Properties

api: HttpApi
parameters: TonClientParameters

Methods

  • Invoke get method

    Parameters

    • address: Address

      contract address

    • name: string

      name of method

    • Optional stack: TupleItem[]

    Returns Promise<{
        gas_used: number;
        stack: TupleReader;
    }>

    stack and gas_used field

    Deprecated

    use runMethod instead

  • Invoke get method that returns error code instead of throwing error

    Parameters

    • address: Address

      contract address

    • name: string

      name of method

    • Optional stack: TupleItem[]

    Returns Promise<{
        gas_used: number;
        stack: TupleReader;
    }>

    stack and gas_used field

    Deprecated

    use runMethodWithError instead

  • Estimate fees for external message

    Parameters

    • address: Address

      target address

    • args: {
          body: Cell;
          ignoreSignature: boolean;
          initCode: null | Cell;
          initData: null | Cell;
      }
      • body: Cell
      • ignoreSignature: boolean
      • initCode: null | Cell
      • initData: null | Cell

    Returns Promise<{
        @type: "query.fees";
        source_fees: {
            @type: "fees";
            fwd_fee: number;
            gas_fee: number;
            in_fwd_fee: number;
            storage_fee: number;
        };
    }>

  • Get Address Balance

    Parameters

    • address: Address

      address for balance check

    Returns Promise<bigint>

    balance

  • Resolves contract state

    Parameters

    Returns Promise<{
        balance: bigint;
        blockId: {
            seqno: number;
            shard: string;
            workchain: number;
        };
        code: null | Buffer;
        data: null | Buffer;
        lastTransaction: null | {
            hash: string;
            lt: string;
        };
        state: "active" | "uninitialized" | "frozen";
        timestampt: number;
    }>

  • Fetch latest masterchain info

    Returns Promise<{
        initSeqno: number;
        latestSeqno: number;
        shard: string;
        workchain: number;
    }>

    masterchain info

  • Fetch transactions inf shards

    Parameters

    • workchain: number
    • seqno: number
    • shard: string

    Returns Promise<{
        account: Address;
        hash: string;
        lt: string;
    }[]>

  • Get transaction by it's id

    Parameters

    • address: Address

      address

    • lt: string

      logical time

    • hash: string

      transaction hash

    Returns Promise<null | Transaction>

    transaction or null if not exist

  • Get transactions

    Parameters

    • address: Address

      address

    • opts: {
          archival?: boolean;
          hash?: string;
          inclusive?: boolean;
          limit: number;
          lt?: string;
          to_lt?: string;
      }
      • Optional archival?: boolean
      • Optional hash?: string
      • Optional inclusive?: boolean
      • limit: number
      • Optional lt?: string
      • Optional to_lt?: string

    Returns Promise<Transaction[]>

  • Fetch latest workchain shards

    Parameters

    • seqno: number

      masterchain seqno

    Returns Promise<{
        seqno: number;
        shard: string;
        workchain: number;
    }[]>

  • Check if contract is deployed

    Parameters

    Returns Promise<boolean>

    true if contract is in active state

  • Open contract

    Type Parameters

    • T extends Contract

    Parameters

    • src: T

      source contract

    Returns OpenedContract<T>

    contract

  • Create a provider

    Parameters

    • address: Address

      address

    • Optional init: null | StateInit

      optional init

    Returns ContractProvider

    provider

  • Invoke get method

    Parameters

    • address: Address

      contract address

    • name: string

      name of method

    • Optional stack: TupleItem[]

    Returns Promise<{
        gas_used: number;
        stack: TupleReader;
    }>

    stack and gas_used field

  • Invoke get method that returns error code instead of throwing error

    Parameters

    • address: Address

      contract address

    • name: string

      name of method

    • Optional params: any[]

      optional parameters

    Returns Promise<{
        exit_code: number;
        gas_used: number;
        stack: TupleReader;
    }>

    stack and gas_used field

  • Send external message to contract

    Parameters

    • contract: Contract

      contract to send message

    • src: Cell

      message body

    Returns Promise<void>

  • Send file to a network

    Parameters

    • src: Buffer

      source file

    Returns Promise<void>

  • Send message to a network

    Parameters

    • src: Message

      source message

    Returns Promise<void>

  • Locate outcoming transaction of destination address by incoming message

    Parameters

    • source: Address

      message source address

    • destination: Address

      message destination address

    • created_lt: string

      message's created lt

    Returns Promise<Transaction>

    transaction

  • Locate incoming transaction of source address by outcoming message

    Parameters

    • source: Address

      message source address

    • destination: Address

      message destination address

    • created_lt: string

      message's created lt

    Returns Promise<Transaction>

    transaction

Generated using TypeDoc