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
- detectAddress
- estimateFee
- getAddressBalance
- getAddressInformation
- getAddressState
- getBlockHeader
- getBlockTransactions
- getConfigParam
- getConsensusBlock
- getExtendedAddressInformation
- getMasterchainBlockSignatures
- getMasterchainInfo
- getShardBlockProof
- getTokenData
- getTransactions
- getWalletInformation
- lookupBlock
- packAddress
- runGetMethod
- shards
- tryLocateResultTx
- tryLocateSourceTx
- tryLocateTx
- unpackAddress
Methods
detectAddress
▸ detectAddress(address): Promise<AxiosResponse<JsonRpcResponse<ReturnDetectAddress>, any>>
Get all possible address forms.
Parameters
| Name | Type | Description |
|---|---|---|
address | string | The address of the account. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnDetectAddress>, any>>
Defined in
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
| Name | Type | Description |
|---|---|---|
params | EstimatefeeParams | The variable of the block. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnEstimatefee>, any>>
Defined in
getAddressBalance
▸ getAddressBalance(address): Promise<AxiosResponse<JsonRpcResponse<ReturnGetAddressbalance>, any>>
Get balance (in nanotons) of a given address.
Parameters
| Name | Type | Description |
|---|---|---|
address | string | The address of the account. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetAddressbalance>, any>>
Defined in
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
| Name | Type | Description |
|---|---|---|
address | string | The address of the account. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetAddressInfromation>, any>>
Defined in
getAddressState
▸ getAddressState(address): Promise<AxiosResponse<JsonRpcResponse<ReturnGetAddressstate>, any>>
Get state of a given address. State can be either unitialized, active or frozen.
Parameters
| Name | Type | Description |
|---|---|---|
address | string | The address of the account. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetAddressstate>, any>>
Defined in
getBlockHeader
▸ getBlockHeader(params): Promise<AxiosResponse<JsonRpcResponse<ReturnGetBlockheader>, any>>
Get metadata of a given block.
Parameters
| Name | Type | Description |
|---|---|---|
params | GetBlockHeaderParams | The variable of the block. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetBlockheader>, any>>
Defined in
getBlockTransactions
▸ getBlockTransactions(params): Promise<AxiosResponse<JsonRpcResponse<ReturnGetBlockTransactions>, any>>
Get transactions of the given block.
Parameters
| Name | Type | Description |
|---|---|---|
params | GetBlockTransactionsParams | The variable of the block. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetBlockTransactions>, any>>
Defined in
getConfigParam
▸ getConfigParam(params): Promise<AxiosResponse<JsonRpcResponse<ReturnGetConfigparam>, any>>
Get config by id.
Parameters
| Name | Type | Description |
|---|---|---|
params | GetConfigParamParams | The variable of the config. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetConfigparam>, any>>
Defined in
getConsensusBlock
▸ getConsensusBlock(): Promise<AxiosResponse<JsonRpcResponse<ReturnConsensusblock>, any>>
Get consensus block and its update timestamp.
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnConsensusblock>, any>>
Defined in
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
| Name | Type | Description |
|---|---|---|
address | string | The address of the account. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetExtendedaddressinformation>, any>>
Defined in
getMasterchainBlockSignatures
▸ getMasterchainBlockSignatures(seqno): Promise<AxiosResponse<JsonRpcResponse<ReturnGetMasterchainblocksignatures>, any>>
Get up-to-date masterchain state.
Parameters
| Name | Type |
|---|---|
seqno | number |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetMasterchainblocksignatures>, any>>
Defined in
getMasterchainInfo
▸ getMasterchainInfo(): Promise<AxiosResponse<JsonRpcResponse<ReturnGetMasterchaininfo>, any>>
Get up-to-date masterchain state.
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetMasterchaininfo>, any>>
Defined in
getShardBlockProof
▸ getShardBlockProof(params): Promise<AxiosResponse<JsonRpcResponse<ReturnGetShardblockproof>, any>>
Get merkle proof of shardchain block.
Parameters
| Name | Type | Description |
|---|---|---|
params | GetShardBlockProofParams | The variable of the shardchain block. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetShardblockproof>, any>>
Defined in
getTokenData
▸ getTokenData(address): Promise<AxiosResponse<JsonRpcResponse<ReturnGetTokenData>, any>>
Get NFT or Jetton information.
Parameters
| Name | Type | Description |
|---|---|---|
address | string | The address of the account. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetTokenData>, any>>
Defined in
getTransactions
▸ getTransactions(params): Promise<AxiosResponse<JsonRpcResponse<ReturnGetTransactions>, any>>
Get transaction history of a given address.
Parameters
| Name | Type | Description |
|---|---|---|
params | GetTransactionsParams | The variable of the transactions. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetTransactions>, any>>
Defined in
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
| Name | Type | Description |
|---|---|---|
address | string | The address of the account. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnGetWalletinformation>, any>>
Defined in
lookupBlock
▸ lookupBlock(params): Promise<AxiosResponse<JsonRpcResponse<ReturnLookupBlock>, any>>
Look up block by either seqno, lt or unixtime.
Parameters
| Name | Type | Description |
|---|---|---|
params | LookupBlockParams | The variable of the block. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnLookupBlock>, any>>
Defined in
packAddress
▸ packAddress(address): Promise<AxiosResponse<JsonRpcResponse<ReturnPackAddress>, any>>
Convert an address from raw to human-readable format.
Parameters
| Name | Type | Description |
|---|---|---|
address | string | The address of the account. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnPackAddress>, any>>
Defined in
runGetMethod
▸ runGetMethod(params): Promise<AxiosResponse<JsonRpcResponse<ReturnCall>, any>>
Run get method on smart contract.
Parameters
| Name | Type | Description |
|---|---|---|
params | RunGetMethodParams | The variable of the block. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnCall>, any>>
Defined in
shards
▸ shards(seqno): Promise<AxiosResponse<JsonRpcResponse<ReturnShard>, any>>
Get shards information.
Parameters
| Name | Type |
|---|---|
seqno | number |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnShard>, any>>
Defined in
tryLocateResultTx
▸ tryLocateResultTx(params): Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocateresulttx>, any>>
Locate outcoming transaction of destination address by incoming message
Parameters
| Name | Type | Description |
|---|---|---|
params | TryLocateResultTxParams | The variable of the transactions. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocateresulttx>, any>>
Defined in
tryLocateSourceTx
▸ tryLocateSourceTx(params): Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocatesourcetx>, any>>
Locate incoming transaction of source address by outcoming message.
Parameters
| Name | Type | Description |
|---|---|---|
params | TryLocateSourceTxParams | The variable of the transactions. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocatesourcetx>, any>>
Defined in
tryLocateTx
▸ tryLocateTx(params): Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocatetx>, any>>
Locate outcoming transaction of destination address by incoming message.
Parameters
| Name | Type | Description |
|---|---|---|
params | TryLocateTxParams | The variable of the transactions. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnTrylocatetx>, any>>
Defined in
unpackAddress
▸ unpackAddress(address): Promise<AxiosResponse<JsonRpcResponse<ReturnUnpackAddress>, any>>
Convert an address from human-readable to raw format.
Parameters
| Name | Type | Description |
|---|---|---|
address | string | The address of the account. |
Returns
Promise<AxiosResponse<JsonRpcResponse<ReturnUnpackAddress>, any>>
