Class TonHttpApiV3

Constructors

Properties

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

Methods

  • Estimate fee for external message.

    Parameters

    • address: string
    • body: string
    • init_code: string
    • init_data: string
    • ignore_chksig: boolean

    Returns Promise<{
        destination_fees: ({ fwd_fee: number; storage_fee: number; in_fwd_fee: number; gas_fee: number; })[];
        source_fees: { fwd_fee: number; storage_fee: number; in_fwd_fee: number; gas_fee: number; };
    }>

  • Private

    Get method of adapter.

    Type Parameters

    • T

    Parameters

    • method: string
    • params: any
    • returnSchema: ZodType<T, ZodTypeDef, T>

    Returns Promise<T>

  • Get smart contract information.

    Parameters

    • address: string

    Returns Promise<{
        balance: string;
        code: null | string;
        data: null | string;
        frozen_hash: null | string;
        last_transaction_hash: null | string;
        last_transaction_lt: null | string;
        status: "active" | "frozen" | "uninit" | "nonexist";
    }>

  • Get parent and/or children for specified transaction.

    Parameters

    • hash: string
    • Optional optional: {
          direction?: "in" | "out" | "both";
          limit?: number;
          offset?: number;
          sort?: "asc" | "desc";
      }
      • Optional direction?: "in" | "out" | "both"
      • Optional limit?: number
      • Optional offset?: number
      • Optional sort?: "asc" | "desc"

    Returns Promise<{
        address_book: Record<string, ({ user_friendly: string; })>;
        transactions: ({ lt: string; hash: string; account: string; in_msg: { value: string | null; hash: string; init_state: { hash: string; body: string; } | null; source: string | null; destination: string | null; ... 9 more ...; message_content: { ...; } | null; } | null; ... 11 more ...; description?: any; })[];
    }>

  • Returns blocks by specified filters.

    Parameters

    • Optional optional: {
          end_lt?: string;
          end_utime?: string;
          limit?: number;
          offset?: number;
          seqno?: number;
          shard?: string;
          sort?: "asc" | "desc";
          start_lt?: string;
          start_utime?: string;
          workchain?: number;
      }
      • Optional end_lt?: string
      • Optional end_utime?: string
      • Optional limit?: number
      • Optional offset?: number
      • Optional seqno?: number
      • Optional shard?: string
      • Optional sort?: "asc" | "desc"
      • Optional start_lt?: string
      • Optional start_utime?: string
      • Optional workchain?: number

    Returns Promise<{
        blocks: ({ workchain: number; shard: string; seqno: number; root_hash: string; file_hash: string; global_id: number; version: number; flags: number; after_merge: boolean; after_split: boolean; before_split: boolean; ... 15 more ...; masterchain_block_ref?: { ...; } | ... 1 more ... | undefined; })[];
    }>

  • Get Jetton burns by specified filters.

    Parameters

    • Optional optional: {
          address?: string;
          end_lt?: string;
          end_utime?: string;
          jetton_master?: string;
          jetton_wallet?: string;
          limit?: number;
          offset?: number;
          sort?: "asc" | "desc";
          start_lt?: string;
          start_utime?: string;
      }
      • Optional address?: string
      • Optional end_lt?: string
      • Optional end_utime?: string
      • Optional jetton_master?: string
      • Optional jetton_wallet?: string
      • Optional limit?: number
      • Optional offset?: number
      • Optional sort?: "asc" | "desc"
      • Optional start_lt?: string
      • Optional start_utime?: string

    Returns Promise<{
        jetton_burns: ({ query_id: string; transaction_hash: string; transaction_lt: string; transaction_now: number; response_destination: string | null; custom_payload: string | null; owner: string; jetton_master: string; })[];
    }>

  • Get Jetton masters by specified filters.

    Parameters

    • Optional optional: {
          address?: string;
          admin_address?: string;
          limit?: number;
          offset?: number;
      }
      • Optional address?: string
      • Optional admin_address?: string
      • Optional limit?: number
      • Optional offset?: number

    Returns Promise<{
        jetton_masters: ({ address: string; code_hash: string; data_hash: string; last_transaction_lt: string; total_supply: string; mintable: boolean; admin_address: string | null; jetton_wallet_code_hash: string; jetton_content?: any; })[];
    }>

  • Get Jetton transfers by specified filters.

    Parameters

    • Optional optional: {
          address?: string;
          direction?: "in" | "out" | "both";
          end_lt?: string;
          end_utime?: string;
          jetton_master?: string;
          jetton_wallet?: string;
          limit?: number;
          offset?: number;
          sort?: "asc" | "desc";
          start_lt?: string;
          start_utime?: string;
      }
      • Optional address?: string
      • Optional direction?: "in" | "out" | "both"
      • Optional end_lt?: string
      • Optional end_utime?: string
      • Optional jetton_master?: string
      • Optional jetton_wallet?: string
      • Optional limit?: number
      • Optional offset?: number
      • Optional sort?: "asc" | "desc"
      • Optional start_lt?: string
      • Optional start_utime?: string

    Returns Promise<{
        jetton_transfers: ({ source: string; destination: string; query_id: string; transaction_hash: string; transaction_lt: string; transaction_now: number; response_destination: string | null; custom_payload: string | null; ... 4 more ...; forward_ton_amount: string | null; })[];
    }>

  • Get Jetton wallets by specified filters.

    Parameters

    • Optional optional: {
          address?: string;
          jetton_address?: string;
          limit?: number;
          offset?: number;
          owner_address?: string;
      }
      • Optional address?: string
      • Optional jetton_address?: string
      • Optional limit?: number
      • Optional offset?: number
      • Optional owner_address?: string

    Returns Promise<{
        jetton_wallets: ({ balance: string; address: string; code_hash: string; data_hash: string; last_transaction_lt: string; owner: string; jetton: string; })[];
    }>

  • Returns all workchain blocks, that appeared after previous masterchain block.

    Parameters

    • seqno: number
    • Optional optional: {
          include_mc_block?: boolean;
      }
      • Optional include_mc_block?: boolean

    Returns Promise<{
        blocks: ({ workchain: number; shard: string; seqno: number; root_hash: string; file_hash: string; global_id: number; version: number; flags: number; after_merge: boolean; after_split: boolean; before_split: boolean; ... 15 more ...; masterchain_block_ref?: { ...; } | ... 1 more ... | undefined; })[];
    }>

  • Get masterchain info.

    Returns Promise<{
        first: { workchain: number; shard: string; seqno: number; root_hash: string; file_hash: string; global_id: number; version: number; flags: number; after_merge: boolean; after_split: boolean; before_split: boolean; ... 15 more ...; masterchain_block_ref?: { ...; } | ... 1 more ... | undefined; };
        last: { workchain: number; shard: string; seqno: number; root_hash: string; file_hash: string; global_id: number; version: number; flags: number; after_merge: boolean; after_split: boolean; before_split: boolean; ... 15 more ...; masterchain_block_ref?: { ...; } | ... 1 more ... | undefined; };
    }>

  • Get messages by specified filters.

    Parameters

    • Optional optional: {
          body_hash?: string;
          destination?: string;
          hash?: string;
          limit?: number;
          offset?: number;
          source?: string;
      }
      • Optional body_hash?: string
      • Optional destination?: string
      • Optional hash?: string
      • Optional limit?: number
      • Optional offset?: number
      • Optional source?: string

    Returns Promise<{
        messages: ({ value: string | null; hash: string; init_state: { hash: string; body: string; } | null; source: string | null; destination: string | null; fwd_fee: string | null; ihr_fee: string | null; ... 7 more ...; message_content: { ...; } | null; })[];
    }>

  • Get NFT collections.

    Parameters

    • Optional optional: {
          collection_address?: string;
          limit?: number;
          offset?: number;
          owner_address?: string;
      }
      • Optional collection_address?: string
      • Optional limit?: number
      • Optional offset?: number
      • Optional owner_address?: string

    Returns Promise<{
        nft_collections: ({ address: string; code_hash: string; data_hash: string; last_transaction_lt: string; owner_address: string | null; next_item_index: string; collection_content?: any; })[];
    }>

  • Get NFT items.

    Parameters

    • Optional optional: {
          address?: string;
          collection_address?: string;
          index?: string;
          limit?: number;
          offset?: number;
          owner_address?: string;
      }
      • Optional address?: string
      • Optional collection_address?: string
      • Optional index?: string
      • Optional limit?: number
      • Optional offset?: number
      • Optional owner_address?: string

    Returns Promise<{
        nft_items: ({ address: string; init: boolean; code_hash: string; data_hash: string; last_transaction_lt: string; owner_address: string | null; collection_address: string | null; index: string; collection: { ...; } | null; content?: any; })[];
    }>

  • Get NFT transfers by specified filters.

    Parameters

    • Optional optional: {
          address?: string;
          collection_address?: string;
          direction?: "in" | "out" | "both";
          end_lt?: string;
          end_utime?: string;
          item_address?: string;
          limit?: number;
          offset?: number;
          sort?: "asc" | "desc";
          start_lt?: string;
          start_utime?: string;
      }
      • Optional address?: string
      • Optional collection_address?: string
      • Optional direction?: "in" | "out" | "both"
      • Optional end_lt?: string
      • Optional end_utime?: string
      • Optional item_address?: string
      • Optional limit?: number
      • Optional offset?: number
      • Optional sort?: "asc" | "desc"
      • Optional start_lt?: string
      • Optional start_utime?: string

    Returns Promise<{
        nft_transfers: ({ query_id: string; nft_address: string; transaction_hash: string; transaction_lt: string; transaction_now: number; old_owner: string; new_owner: string; response_destination: string | null; custom_payload: string | null; forward_amount: string; forward_payload: string | null; })[];
    }>

  • Get batch of trace graph by ids.

    Parameters

    • Optional optional: {
          trace_id?: string[];
          tx_hash?: string[];
      }
      • Optional trace_id?: string[]
      • Optional tx_hash?: string[]

    Returns Promise<(null | {
        children: any[];
        id: string;
        transaction: { lt: string; hash: string; account: string; in_msg: { value: string | null; hash: string; init_state: { hash: string; body: string; } | null; source: string | null; destination: string | null; ... 9 more ...; message_content: { ...; } | null; } | null; ... 11 more ...; description?: any; };
    })[]>

  • Get trace graph for specified transaction.

    Parameters

    • hash: string
    • Optional optional: {
          sort?: "asc" | "desc";
      }
      • Optional sort?: "asc" | "desc"

    Returns Promise<{
        children: any[];
        id: string;
        transaction: { lt: string; hash: string; account: string; in_msg: { value: string | null; hash: string; init_state: { hash: string; body: string; } | null; source: string | null; destination: string | null; ... 9 more ...; message_content: { ...; } | null; } | null; ... 11 more ...; description?: any; };
    }>

  • Get transactions by specified filters.

    Parameters

    • Optional optional: {
          account?: string | string[];
          end_lt?: string;
          end_utime?: string;
          exclude_account?: string | string[];
          hash?: string;
          limit?: number;
          lt?: string;
          offset?: number;
          seqno?: number;
          shard?: string;
          sort?: "asc" | "desc";
          start_lt?: string;
          start_utime?: string;
          workchain?: number;
      }
      • Optional account?: string | string[]
      • Optional end_lt?: string
      • Optional end_utime?: string
      • Optional exclude_account?: string | string[]
      • Optional hash?: string
      • Optional limit?: number
      • Optional lt?: string
      • Optional offset?: number
      • Optional seqno?: number
      • Optional shard?: string
      • Optional sort?: "asc" | "desc"
      • Optional start_lt?: string
      • Optional start_utime?: string
      • Optional workchain?: number

    Returns Promise<{
        address_book: Record<string, ({ user_friendly: string; })>;
        transactions: ({ lt: string; hash: string; account: string; in_msg: { value: string | null; hash: string; init_state: { hash: string; body: string; } | null; source: string | null; destination: string | null; ... 9 more ...; message_content: { ...; } | null; } | null; ... 11 more ...; description?: any; })[];
    }>

  • Returns transactions from masterchain block and from all shards.

    Parameters

    • seqno: number
    • Optional optional: {
          limit?: number;
          offset?: number;
          sort?: "asc" | "desc";
      }
      • Optional limit?: number
      • Optional offset?: number
      • Optional sort?: "asc" | "desc"

    Returns Promise<{
        address_book: Record<string, ({ user_friendly: string; })>;
        transactions: ({ lt: string; hash: string; account: string; in_msg: { value: string | null; hash: string; init_state: { hash: string; body: string; } | null; source: string | null; destination: string | null; ... 9 more ...; message_content: { ...; } | null; } | null; ... 11 more ...; description?: any; })[];
    }>

  • Get transactions whose inbound/outbound message has the specified hash. This endpoint returns list of Transaction objects since collisions of message hashes can occur.

    Parameters

    • direction: "in" | "out"
    • msg_hash: string
    • Optional optional: {
          limit?: number;
          offset?: number;
      }
      • Optional limit?: number
      • Optional offset?: number

    Returns Promise<{
        address_book: Record<string, ({ user_friendly: string; })>;
        transactions: ({ lt: string; hash: string; account: string; in_msg: { value: string | null; hash: string; init_state: { hash: string; body: string; } | null; source: string | null; destination: string | null; ... 9 more ...; message_content: { ...; } | null; } | null; ... 11 more ...; description?: any; })[];
    }>

  • Get wallet smart contract information. The following wallets are supported: v1r1, v1r2, v1r3, v2r1, v2r2, v3r1, v3r2, v4r1, v4r2. In case the account is not a wallet error code 409 is returned.

    Parameters

    • address: string

    Returns Promise<{
        balance: string;
        last_transaction_hash: null | string;
        last_transaction_lt: null | string;
        seqno: null | number;
        status: string;
        wallet_id: null | number;
        wallet_type: null | string;
    }>

  • Post method of adapter.

    Type Parameters

    • T

    Parameters

    • method: string
    • params: any
    • returnSchema: ZodType<T, ZodTypeDef, T>

    Returns Promise<T>

  • Run get method of smart contract. Stack supports only num, cell and slice types.

    Parameters

    • address: string
    • method: string
    • stack: TupleItem[]

    Returns Promise<{
        exit_code: number;
        gas_used: number;
        stack: ({ type: "slice" | "cell" | "tuple" | "num" | "list" | "unsupported_type"; value?: any; })[];
    }>

  • Send external message to TON network.

    Parameters

    • boc: string

    Returns Promise<{
        message_hash: string;
    }>

  • Get list of accounts sorted descending by balance.

    Parameters

    • Optional optional: {
          limit?: number;
          offset?: number;
      }
      • Optional limit?: number
      • Optional offset?: number

    Returns Promise<{
        account: string;
        balance: string;
    }[]>

Generated using TypeDoc