Class TonClient

Hierarchy

  • TonClient

Constructors

Properties

#api: HttpApi
parameters: TonClientParameters

Methods

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

    Returns

    stack and gas_used field

    Parameters

    • address: Address

      contract address

    • name: string

      name of method

    • params: any[] = []

      optional parameters

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

  • Estimate fees for external message

    Returns

    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"; in_fwd_fee: number; storage_fee: number; gas_fee: number; fwd_fee: number; };
    }>

  • Resolves contract state

    Parameters

    • address: Address

      contract address

    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

    masterchain info

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

  • Fetch transactions inf shards

    Parameters

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

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

  • Get transactions

    Parameters

    • address: Address

      address

    • opts: {
          hash?: string;
          inclusive?: boolean;
          limit: number;
          lt?: string;
          to_lt?: string;
      }
      • 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

    Returns

    true if contract is in active state

    Parameters

    Returns Promise<boolean>

  • Open contract

    Returns

    contract

    Type Parameters

    Parameters

    • src: T

      source contract

    Returns OpenedContract<T>

  • Send file to a network

    Parameters

    • src: Buffer

      source file

    Returns Promise<void>

Generated using TypeDoc