rubic-sdk
Version:
Simplify dApp creation
35 lines (34 loc) • 1.75 kB
TypeScript
import { TonCenterBlockInfo } from '../../models/ton/ton-center-types';
import { TonApiAccountInfoResp, TonApiAllNonNullableTokenInfoForWalletResp, TonApiTokenInfoForWalletResp, TonApiTokenInfoResp, TonApiTxDataByBocResp } from '../../models/ton/tonapi-types';
import { Web3PrimitiveType } from '../../models/web3-primitive-type';
export declare class TonApiService {
private readonly xApiUrl;
private readonly xApiKey;
/**
*
* @param walletAddress in any format: raw or friendly
*/
fetchWalletSeqno(walletAddress: string): Promise<number>;
fetchTxInfo(txHash: string): Promise<TonApiTxDataByBocResp>;
fetchTxInfoByMessageHash(txHash: string): Promise<TonApiTxDataByBocResp>;
checkIsTxCompleted(txHash: string): Promise<boolean>;
healthcheck(): Promise<boolean>;
fetchLastBlockInfo(): Promise<TonCenterBlockInfo>;
/**
*
* @param walletAddress in any format: raw or friendly
*/
callContractMethod<T>(walletAddress: string, methodName: string, methodArgs: Web3PrimitiveType[]): Promise<T>;
fetchTokenInfo(tokenAddress: string): Promise<TonApiTokenInfoResp['metadata']>;
/**
*
* @param tokenAddress in any form: raw or friendly
* @returns balance, decimals, name, symbol, walletJettonAddress, jettonAddress
*/
fetchTokenInfoForWallet(walletAddress: string, tokenAddress: string): Promise<TonApiTokenInfoForWalletResp>;
fetchAllNonNullableTokensInfoForWallet(walletAddress: string): Promise<TonApiAllNonNullableTokenInfoForWalletResp['balances']>;
/**
* @returns available methods for walletAddress(contract), raw address and native coin TON balance
*/
fetchAccountInfo(walletAddress: string): Promise<TonApiAccountInfoResp>;
}