Class TonClient4

Hierarchy

  • TonClient4

Constructors

Properties

#adapter?: AxiosAdapter
#endpoint: string
#timeout: number

Methods

  • Get block info by unix timestamp

    Returns

    account info

    Parameters

    • seqno: number

      block sequence number

    • address: Address

      account address

    Returns Promise<{
        account: { state: { type: "uninit"; } | { type: "active"; code: string | null; data: string | null; } | { type: "frozen"; stateHash: string; }; balance: { coins: string; }; last: { lt: string; hash: string; } | null; storageStat: { ...; } | null; };
        block: { workchain: number; seqno: number; shard: string; rootHash: string; fileHash: string; };
    }>

  • Get account lite info (without code and data)

    Returns

    account lite info

    Parameters

    • seqno: number

      block sequence number

    • address: Address

      account address

    Returns Promise<{
        account: { state: { type: "uninit"; } | { type: "active"; codeHash: string; dataHash: string; } | { type: "frozen"; stateHash: string; }; balance: { coins: string; }; last: { lt: string; hash: string; } | null; storageStat: { ...; } | null; };
    }>

  • Load unparsed account transactions

    Returns

    unparsed transactions

    Parameters

    • address: Address

      address

    • lt: bigint

      last transaction lt

    • hash: Buffer

      last transaction hash

    Returns Promise<{
        block: {
            fileHash: string;
            rootHash: string;
            seqno: number;
            shard: string;
            workchain: number;
        };
        tx: Transaction;
    }[]>

  • Get block info

    Returns

    block info

    Parameters

    • seqno: number

      block sequence number

    Returns Promise<{
        shards: ({ workchain: number; seqno: number; shard: string; rootHash: string; fileHash: string; transactions: { account: string; hash: string; lt: string; }[]; })[];
    }>

  • Get block info by unix timestamp

    Returns

    block info

    Parameters

    • ts: number

      unix timestamp

    Returns Promise<{
        shards: ({ workchain: number; seqno: number; shard: string; rootHash: string; fileHash: string; transactions: { account: string; hash: string; lt: string; }[]; })[];
    }>

  • Get network config

    Returns

    network config

    Parameters

    • seqno: number

      block sequence number

    • Optional ids: number[]

      optional config ids

    Returns Promise<{
        config: { cell: string; address: string; globalBalance: { coins: string; }; };
    }>

  • Get Last Block

    Returns

    last block info

    Returns Promise<{
        init: { fileHash: string; rootHash: string; };
        last: { seqno: number; shard: string; workchain: number; fileHash: string; rootHash: string; };
        now: number;
        stateRootHash: string;
    }>

  • Load one unparsed account transaction

    Returns

    one unparsed transaction

    Parameters

    • seqno: number

      block sequence number

    • address: Address

      account address

    • lt: bigint

      account last transaction lt

    Returns Promise<{
        block: {
            rootHash: string;
            seqno: number;
            shard: string;
            workchain: number;
        };
        boc: string;
        proof: string;
        tx: {
            address: bigint;
            description: TransactionDescription;
            endStatus: AccountStatus;
            inMessage: undefined | Message;
            lt: bigint;
            now: number;
            oldStatus: AccountStatus;
            outMessages: Dictionary<number, Message>;
            outMessagesCount: number;
            prevTransactionHash: bigint;
            prevTransactionLt: bigint;
            stateUpdate: HashUpdate;
            totalFees: CurrencyCollection;
        };
    }>

  • Check if account was updated since

    Returns

    account change info

    Parameters

    • seqno: number

      block sequence number

    • address: Address

      account address

    • lt: bigint

      account last transaction lt

    Returns Promise<{
        block: { workchain: number; seqno: number; shard: string; rootHash: string; fileHash: string; };
        changed: boolean;
    }>

  • Open smart contract

    Returns

    opened contract

    Type Parameters

    Parameters

    • contract: T

      contract

    Returns OpenedContract<T>

  • Open smart contract

    Returns

    opened contract

    Type Parameters

    Parameters

    • block: number

      block number

    • contract: T

      contract

    Returns OpenedContract<T>

  • Execute run method

    Returns

    method result

    Parameters

    • seqno: number

      block sequence number

    • address: Address

      account address

    • name: string

      method name

    • Optional args: TupleItem[]

      method arguments

    Returns Promise<{
        block: {
            fileHash: string;
            rootHash: string;
            seqno: number;
            shard: string;
            workchain: number;
        };
        exitCode: number;
        result: TupleItem[];
        resultRaw: null | string;
        shardBlock: {
            fileHash: string;
            rootHash: string;
            seqno: number;
            shard: string;
            workchain: number;
        };
    }>

  • Send external message

    Returns

    message status

    Parameters

    • message: Buffer

      message boc

    Returns Promise<{
        status: number;
    }>

Generated using TypeDoc