TON SDK Documentation - v15.3.1duck0.0.3
    Preparing search index...

    Class TonClient

    Index

    Constructors

    Properties

    api: HttpApi

    Methods

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

      Parameters

      • address: Address

        contract address

      • name: string

        name of method

      • stack: TupleItem[] = []

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

      stack and gas_used field

      use runMethodWithError instead

    • Estimate fees for external message

      Parameters

      • address: Address

        target address

      • args: {
            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;
              };
          },
      >

    • Resolves contract state

      Parameters

      Returns Promise<
          {
              balance: bigint;
              blockId: { seqno: number; shard: string; workchain: number };
              code: null | Buffer;
              data: null | Buffer;
              extra_currencies:
                  | undefined
                  | { "@type": "extraCurrency"; amount: string; id: number }[];
              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;
        }

      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

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

      Parameters

      • address: Address

        contract address

      • name: string

        name of method

      • params: any[] = []

        optional parameters

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

      stack and gas_used field

    • Send file to a network

      Parameters

      • src: Buffer

        source file

      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