Core

Class: Core

The Core contains all commonly-used ton's methods.

Do not call this constructor directly. Instead, instantiate an TONX API object
with const tonfura = new Tonfura(config) and then access the Core via tonfura.core.

Table of contents

Methods

Methods

detectAddress

▸ detectAddress(address): Promise<AxiosResponse<JsonRpcResponse<ReturnDetectAddress>, any>>

Get all possible address forms.

Parameters

NameTypeDescription
addressstringThe address of the account.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnDetectAddress>, any>>

Defined in

api/Core.ts:134


estimateFee

▸ estimateFee(params): Promise<AxiosResponse<JsonRpcResponse<ReturnEstimatefee>, any>>

Estimate fees required for query processing. body, init-code and init-data accepted in serialized format (b64-encoded).

Parameters

NameTypeDescription
paramsEstimatefeeParamsThe variable of the block.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnEstimatefee>, any>>

Defined in

api/Core.ts:358


getAddressBalance

▸ getAddressBalance(address): Promise<AxiosResponse<JsonRpcResponse<ReturnGetAddressbalance>, any>>

Get balance (in nanotons) of a given address.

Parameters

NameTypeDescription
addressstringThe address of the account.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetAddressbalance>, any>>

Defined in

api/Core.ts:76


getAddressInformation

▸ getAddressInformation(address): Promise<AxiosResponse<JsonRpcResponse<ReturnGetAddressInfromation>, any>>

Returns the information of a given address.
Information includes the balance, code, data and last_transaction_id

Parameters

NameTypeDescription
addressstringThe address of the account.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetAddressInfromation>, any>>

Defined in

api/Core.ts:22


getAddressState

▸ getAddressState(address): Promise<AxiosResponse<JsonRpcResponse<ReturnGetAddressstate>, any>>

Get state of a given address. State can be either unitialized, active or frozen.

Parameters

NameTypeDescription
addressstringThe address of the account.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetAddressstate>, any>>

Defined in

api/Core.ts:92


getBlockHeader

▸ getBlockHeader(params): Promise<AxiosResponse<JsonRpcResponse<ReturnGetBlockheader>, any>>

Get metadata of a given block.

Parameters

NameTypeDescription
paramsGetBlockHeaderParamsThe variable of the block.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetBlockheader>, any>>

Defined in

api/Core.ts:246


getBlockTransactions

▸ getBlockTransactions(params): Promise<AxiosResponse<JsonRpcResponse<ReturnGetBlockTransactions>, any>>

Get transactions of the given block.

Parameters

NameTypeDescription
paramsGetBlockTransactionsParamsThe variable of the block.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetBlockTransactions>, any>>

Defined in

api/Core.ts:274


getConfigParam

▸ getConfigParam(params): Promise<AxiosResponse<JsonRpcResponse<ReturnGetConfigparam>, any>>

Get config by id.

Parameters

NameTypeDescription
paramsGetConfigParamParamsThe variable of the config.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetConfigparam>, any>>

Defined in

api/Core.ts:330


getConsensusBlock

▸ getConsensusBlock(): Promise<AxiosResponse<JsonRpcResponse<ReturnConsensusblock>, any>>

Get consensus block and its update timestamp.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnConsensusblock>, any>>

Defined in

api/Core.ts:204


getExtendedAddressInformation

▸ getExtendedAddressInformation(address): Promise<AxiosResponse<JsonRpcResponse<ReturnGetExtendedaddressinformation>, any>>

Returns more information of a given address.
Information not only includes the balance, code, data and last_transaction_id,
But also includes the parsed additional information for known contract types
This method is based on tonlib's function getAccountState.
For detecting wallets we recommend to use getWalletInformation.

Parameters

NameTypeDescription
addressstringThe address of the account.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetExtendedaddressinformation>, any>>

Defined in

api/Core.ts:42


getMasterchainBlockSignatures

▸ getMasterchainBlockSignatures(seqno): Promise<AxiosResponse<JsonRpcResponse<ReturnGetMasterchainblocksignatures>, any>>

Get up-to-date masterchain state.

Parameters

NameType
seqnonumber

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetMasterchainblocksignatures>, any>>

Defined in

api/Core.ts:175


getMasterchainInfo

▸ getMasterchainInfo(): Promise<AxiosResponse<JsonRpcResponse<ReturnGetMasterchaininfo>, any>>

Get up-to-date masterchain state.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetMasterchaininfo>, any>>

Defined in

api/Core.ts:161


getShardBlockProof

▸ getShardBlockProof(params): Promise<AxiosResponse<JsonRpcResponse<ReturnGetShardblockproof>, any>>

Get merkle proof of shardchain block.

Parameters

NameTypeDescription
paramsGetShardBlockProofParamsThe variable of the shardchain block.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetShardblockproof>, any>>

Defined in

api/Core.ts:191


getTokenData

▸ getTokenData(address): Promise<AxiosResponse<JsonRpcResponse<ReturnGetTokenData>, any>>

Get NFT or Jetton information.

Parameters

NameTypeDescription
addressstringThe address of the account.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetTokenData>, any>>

Defined in

api/Core.ts:148


getTransactions

▸ getTransactions(params): Promise<AxiosResponse<JsonRpcResponse<ReturnGetTransactions>, any>>

Get transaction history of a given address.

Parameters

NameTypeDescription
paramsGetTransactionsParamsThe variable of the transactions.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetTransactions>, any>>

Defined in

api/Core.ts:260


getWalletInformation

▸ getWalletInformation(address): Promise<AxiosResponse<JsonRpcResponse<ReturnGetWalletinformation>, any>>

Retrieve wallet information.
This method parses contract state and
currently supports more wallet types than getExtendedAddressInformation: simple wallet, standart wallet, v3 wallet, v4 wallet.

Parameters

NameTypeDescription
addressstringThe address of the account.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnGetWalletinformation>, any>>

Defined in

api/Core.ts:60


lookupBlock

▸ lookupBlock(params): Promise<AxiosResponse<JsonRpcResponse<ReturnLookupBlock>, any>>

Look up block by either seqno, lt or unixtime.

Parameters

NameTypeDescription
paramsLookupBlockParamsThe variable of the block.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnLookupBlock>, any>>

Defined in

api/Core.ts:218


packAddress

▸ packAddress(address): Promise<AxiosResponse<JsonRpcResponse<ReturnPackAddress>, any>>

Convert an address from raw to human-readable format.

Parameters

NameTypeDescription
addressstringThe address of the account.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnPackAddress>, any>>

Defined in

api/Core.ts:106


runGetMethod

▸ runGetMethod(params): Promise<AxiosResponse<JsonRpcResponse<ReturnCall>, any>>

Run get method on smart contract.

Parameters

NameTypeDescription
paramsRunGetMethodParamsThe variable of the block.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnCall>, any>>

Defined in

api/Core.ts:344


shards

▸ shards(seqno): Promise<AxiosResponse<JsonRpcResponse<ReturnShard>, any>>

Get shards information.

Parameters

NameType
seqnonumber

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnShard>, any>>

Defined in

api/Core.ts:232


tryLocateResultTx

▸ tryLocateResultTx(params): Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocateresulttx>, any>>

Locate outcoming transaction of destination address by incoming message

Parameters

NameTypeDescription
paramsTryLocateResultTxParamsThe variable of the transactions.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocateresulttx>, any>>

Defined in

api/Core.ts:302


tryLocateSourceTx

▸ tryLocateSourceTx(params): Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocatesourcetx>, any>>

Locate incoming transaction of source address by outcoming message.

Parameters

NameTypeDescription
paramsTryLocateSourceTxParamsThe variable of the transactions.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocatesourcetx>, any>>

Defined in

api/Core.ts:316


tryLocateTx

▸ tryLocateTx(params): Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocatetx>, any>>

Locate outcoming transaction of destination address by incoming message.

Parameters

NameTypeDescription
paramsTryLocateTxParamsThe variable of the transactions.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocatetx>, any>>

Defined in

api/Core.ts:288


unpackAddress

▸ unpackAddress(address): Promise<AxiosResponse<JsonRpcResponse<ReturnUnpackAddress>, any>>

Convert an address from human-readable to raw format.

Parameters

NameTypeDescription
addressstringThe address of the account.

Returns

Promise<AxiosResponse<JsonRpcResponse<ReturnUnpackAddress>, any>>

Defined in

api/Core.ts:120