UNPKG

@ton3/liteclient

Version:
114 lines (113 loc) 3.99 kB
import { Account, AccountTransactionId, BlockId, Transaction, TransactionId } from '@tonkite/core'; import { Address, Bit } from 'ton3-core'; import { LiteApi, WaitOptions } from '../liteapi'; import { AccountId, RunMethodResult } from '../../dataTypes/liteServer'; import { StackValue } from '../../utils/stack'; type Modify<T, R> = Omit<T, keyof R> & R; type GetMethodResponse<T> = Modify<RunMethodResult, { result: T | null; }>; export declare class BlockchainClient { private readonly api; constructor(api: LiteApi); getMasterchainInfo(wait?: WaitOptions): Promise<BlockId>; getAllShardsInfo(blockId: BlockId, wait?: WaitOptions): Promise<BlockId[]>; lookupBlock(blockId: Pick<BlockId, 'workchain' | 'shard' | 'seqno'>, wait?: WaitOptions): Promise<BlockId>; getAccountState(data: { account: Address; blockId: BlockId; }, wait?: WaitOptions): Promise<Account>; private shardIdent; private globalVersion; private extBlkRef; private blkMasterInfo; private blkPrevInfo; private blkInfo; getBlock(blockId: BlockId, wait?: WaitOptions): Promise<{ global_id: number; info: { version: number; not_master: Bit; after_merge: Bit; before_split: Bit; after_split: Bit; want_split: boolean; want_merge: boolean; key_block: boolean; vert_seqno_incr: Bit; flags: number; seq_no: number; vert_seq_no: number; shard: { shard_pfx_bits: Bit[]; workchain_id: number; shard_prefix: bigint; }; gen_utime: number; start_lt: bigint; end_lt: bigint; gen_validator_list_hash_short: number; gen_catchain_seqno: number; min_ref_mc_seqno: number; prev_key_block_seqno: number; gen_software: { version: number; capabilities: bigint; }; master_ref: { master: { end_lt: bigint; seq_no: number; root_hash: Uint8Array; file_hash: Uint8Array; }; }; prev_ref: { end_lt: bigint; seq_no: number; root_hash: Uint8Array; file_hash: Uint8Array; } | { end_lt: bigint; seq_no: number; root_hash: Uint8Array; file_hash: Uint8Array; }[]; prev_vert_ref: { end_lt: bigint; seq_no: number; root_hash: Uint8Array; file_hash: Uint8Array; } | { end_lt: bigint; seq_no: number; root_hash: Uint8Array; file_hash: Uint8Array; }[]; }; value_flow: import("ton3-core/dist/boc/cell").Cell; state_update: import("ton3-core/dist/boc/cell").Cell; extra: import("ton3-core/dist/boc/cell").Cell; }>; getBlockTransactions(data: { blockId: BlockId; after?: Pick<TransactionId, 'account' | 'lt'> | null; }, wait?: WaitOptions): Promise<TransactionId[]>; getOneTransaction(data: { blockId: BlockId; account: AccountId; lt: bigint; }, wait?: WaitOptions): Promise<import("../../dataTypes/liteServer").TransactionInfo>; getTransactions(data: { account: Address; after: AccountTransactionId; take?: number; }): AsyncIterable<Transaction>; invokeGetMethod<T extends StackValue[] = StackValue[]>(data: { account: Account; method: string | number; stack: StackValue[]; }, wait?: WaitOptions): Promise<GetMethodResponse<T>>; getTime(wait?: WaitOptions): Promise<string>; } export {};