TON API

Making requests

localhost:8000/getAddressInformation?address=0QCyt4ltzak71h6XkyK4ePfZCzJQDSVUNuvZ3VE7hP_Q-GTE

Default query type is GET if otherwise was not specified

The response contains a JSON object, which always has a boolean field 'ok' and may have an optional string field 'description' with a human-readable description of the result. If 'ok' equals true, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'.

getAddressInformation

Use this method to get balance (in nanograms) and state of a given address.

Parameter Description
address Identifier of target account in TON

getTransactions

Use this method to get transaction history of a given address. Along with 'result', API may return 'previous_transaction' with 'lt' and 'hash' fields, if there are more transactions to see. Use them to get more transactions.

Parameter Required Description
address Yes Identifier of target account in TON
limit Optional
lt Optional Logical time of transaction to start with, must be sent with hash
hash Optional Hash of transaction to start with, must be sent with lt
to_lt Optional Logical time of transaction to finish with (that way it is possible to get tx from lt to to_lt)

getAddressBalance

Use this method to get balance (in nanograms) of a given address.

Parameter Description
address Identifier of target account in TON

getAddressState

Use this method to get state of a given address. State can be either "unitialized", "active" or "frozen".

Parameter Description
address Identifier of target account in TON

unpackAddress

Use this method to convert an address from human-readable to raw format.

Parameter Description
address Identifier of target account in TON in human-readable format

packAddress

Use this method to convert an address from raw to human-readable format.

Parameter Description
address Identifier of target account in TON in raw format

detectAddress

Use this method to get all possible address forms

Parameter Description
address Identifier of target account in TON in raw format

sendboc

POST method

Use this method to send serialized boc file

Parameter Description
boc b64 encoded bag of cells

sendcell

POST method

Use this method to send cell as object: {"data": {"b64": "...", "len": int }, "refs": [...subcells...]}

Parameter Description
cell Cell serialized as object

runGetMethod

POST method

Use this method run getMethod

Parameter Description
address contract address
method method name or method id
stack Array of stack elements: [['num',3], ['cell', cell_object], ['slice', slice_object]]