UNPKG

@ton3/liteclient

Version:
60 lines (59 loc) 2.56 kB
import { ADNLClient } from 'adnl'; import { StreamWriter } from '../../tl/stream'; import * as dataTypes from '../../dataTypes'; import { AccountId, TransactionId3 } from '../../dataTypes/liteServer'; import { BlockIdExt } from '../../dataTypes/tonNode'; import { LookupBlockInput } from '../../functions/liteServer'; export interface WaitOptions { seqno: number; timeout?: number; } export declare class LiteApi { #private; private readonly adnlClient; constructor(adnlClient: ADNLClient); private parseLiteServerAnswer; protected query<T>(dataWriterFn: (dataWriter: StreamWriter) => void, wait?: WaitOptions): Promise<T>; getMasterchainInfo(wait?: WaitOptions): Promise<dataTypes.liteServer.MasterchainInfo>; getTime(wait?: WaitOptions): Promise<string>; getVersion(wait?: WaitOptions): Promise<dataTypes.liteServer.Version>; getBlock(blockId: BlockIdExt, wait?: WaitOptions): Promise<dataTypes.liteServer.BlockData>; getAllShardsInfo(blockId: BlockIdExt, wait?: WaitOptions): Promise<dataTypes.liteServer.AllShardsInfo>; getState(blockId: BlockIdExt, wait?: WaitOptions): Promise<unknown>; getBlockHeader(data: { blockId: BlockIdExt; mode: number; }, wait?: WaitOptions): Promise<dataTypes.liteServer.BlockHeader>; lookupBlock(input: LookupBlockInput, wait?: WaitOptions): Promise<dataTypes.liteServer.BlockHeader>; getAccountState(data: { blockId: BlockIdExt; account: AccountId; }, wait?: WaitOptions): Promise<dataTypes.liteServer.AccountState>; listBlockTransactions(data: { blockId: BlockIdExt; count: number; after?: TransactionId3 | null; options?: { reverseOrder?: boolean; wantProof?: boolean; }; }, wait?: WaitOptions): Promise<dataTypes.liteServer.BlockTransactions>; getTransactions(data: { account: AccountId; lt: bigint; hash: Uint8Array; count?: number; }, wait?: WaitOptions): Promise<dataTypes.liteServer.TransactionList>; getOneTransaction(data: { blockId: BlockIdExt; accountId: AccountId; lt: bigint; }, wait?: WaitOptions): Promise<dataTypes.liteServer.TransactionInfo>; runSmcMethod(data: { blockId: BlockIdExt; accountId: AccountId; methodId: bigint; params: Uint8Array; }, wait?: WaitOptions): Promise<dataTypes.liteServer.RunMethodResult>; sendMessage(body: Uint8Array, wait?: WaitOptions): Promise<dataTypes.liteServer.SendMsgStatus>; }