TON API

TON API




GET https://tonapi.org

result: It's a private API, for subscription contact us box@tonapi.org


testgiver wallet information

POST https://tonapi.org/giver

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

result:

error - error code

message - error message

value: 870032749240000 - balance in nanograms

lt: 486908000001 - transaction logical time

hash:E5C4...D2D8 - transaction hash

chain: -1 - account chain (masterchain "-1", basechain "0")

address: 8156...0E0D - account address

seqno: 00002680 - outgoing operations sequence number

id: d9fe0c5f07f47594 - api request id

test: https://reqbin.com/ermhc2wi


wallet information

POST https://tonapi.org/account

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

address: wallet address (long or short format)

chain: [optional] default "0"

result:

error - error code

message - error message or account state message

value: 3095434000 - balance in nanograms

lt: 486912000002 - transaction logical time

hash: 2281...2769 - transaction hash

chain: 0 - account chain (masterchain "-1", basechain "0")

address: 3632...2BA6 - account address

seqno: 00000001- outgoing operations sequence number

id: 0835a7ce50b5bfee - api request id

test: https://reqbin.com/0ke3ibl0


wallet transactions history

POST https://tonapi.org/histfull

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

address: wallet address (long or short format)

chain: [optional] default "0"

lt: transaction logical time

hash: transaction hash

result:

error - error code

message - error message

list: transactions list

lt: 486912000002 - previous transaction logical time

hash: 2281...2769 - previous transaction hash

chain: 0 - account chain (masterchain "-1", basechain "0")

address: 3632...2BA6 - account address

id: 0835a7ce50b5bfee - api request id

test: https://reqbin.com/otkjoxb7


wallet transactions history (depricated, use histfull )

POST https://tonapi.org/history

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

address: wallet address (long or short format)

chain: [optional] default "0"

lt: transaction logical time

hash: transaction hash

full: 1 (extended mode, return lt and hash all transactions)

result:

error - error code

message - error message

list: transactions list

lt: 486912000002 - previous transaction logical time

hash: 2281...2769 - previous transaction hash

chain: 0 - account chain (masterchain "-1", basechain "0")

address: 3632...2BA6 - account address

id: 0835a7ce50b5bfee - api request id

test: https://reqbin.com/wtaqilj3


to beg some grams

POST https://tonapi.org/beg

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

address: wallet address (hex format)

chain: [optional] default "0"

value: [optional] amount of grams less 20. if empty beg random

balance: [optional] if "1" wait about 25 seconds and return account balance

result:

error - error code

error message or "request is sent" or account balance

status: "OK"

test: https://reqbin.com/gdkbsvee


to create new wallet with registration

POST https://tonapi.org/new

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

chain: [optional] default "0"

key: [optional] private key

noreg: [optional] if "1" - create a wallet without registration

result:

error - error code

message - error message

chain: 0 - account chain (masterchain "-1", basechain "0")

address: 3632...2BA6 - account address

short: kQDo...gZJH - short account address

init: 0QBW...7Ojg-bDa - non-bounceable account address

key: 07a3...2975 - private key

regdata: e6cc...cd0a - data for repeat wallet registration

test: https://reqbin.com/8o16qkg2


wallet registration

POST https://tonapi.org/reg

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

regdata: data for repeat wallet registration

result:

error - error code

message - error message or "wallet registration was successful"

status: "OK"

test: https://reqbin.com/c7xv4pgt


to send grams

POST https://tonapi.org/send

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

address: wallet address (long or short format)

dest: destination wallet address (long or short format, wallets must be of the same type)

value: amount of grams for send

key: private key hex code

comments: [optional] transaction comment

chain: [optional] default "0", wallet chain

destchain: [optional] default "0", destination wallet chain

result:

error - error code

message - error message or "transaction file is sent"

status: "OK"

id: 0835a7ce50b5bfee - api request id

the data below is relevant before the transaction

value: 3095434000 - balance in nanograms before transaction sent

lt: 486912000002 - transaction logical time

hash: 2281...2769 - transaction hash

chain: 0 - account chain (masterchain "-1", basechain "0")

address: 3632...2BA6 - account address

seqno: 00000001- outgoing operations sequence number

test: https://reqbin.com/o19pbggr


to get privious block address

POST https://tonapi.org/prevblock

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

block: (-1,8000000000000000,79004):4F58...CFFE:52AB...56FE

result:

error - error message

chain: block workchain (masterchain "-1", basechain "0")

blfull: (-1,8000000000000000,79003):6A35...AEAE:25BA...FE65

block: (-1,8000000000000000,79003)

roothash: 6A35...AEAE

filehash: 25BA...FE65

id: 0835a7ce50b5bfee - api request id

test: https://reqbin.com/zurfmyzg


to get block transactions list

POST https://tonapi.org/blocktrans

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

block: (-1,8000000000000000,79005):4F58...CFFE:52AB...56FE

result:

error - error message

chain: block workchain (masterchain "-1", basechain "0")

block: (-1,8000000000000000,79005)

roothash: 4F58...CFFE

filehash: 52AB...56FE

list: transactions list

id: 0835a7ce50b5bfee - api request id

test: https://reqbin.com/yome4uzd


to get wallet addresses (depricated, use /v2/short)

POST https://tonapi.org/short

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

address: wallet address (long or short format)

chain: [optional] default "0"

result:

error - error message

chain: 0 - account chain (masterchain "-1", basechain "0")

address: 3632...2BA6 - account address

short: kQA2...poTq - short account address

init: 0QBW...7Ojg-bDa - non-bounceable account address

id: 0835a7ce50b5bfee - api request id

test: https://reqbin.com/zv36ika7


to get wallet addresses

POST https://tonapi.org/v2/short

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

address: wallet address (long or short format)

chain: [optional] default "0"

result:

error - error message

chain: 0 - account chain (masterchain "-1", basechain "0")

hex: 3632...2BA6 - hex part of account address

address: 0:3632...2BA6 - account address

short: kQA2...poTq - short account address (for testnet)

init: 0QBW...7Ojg-bDa - non-bounceable account address (for testnet)

m_short: Ef_8...poTq - short account address

m_init: Uf_8...7Ojg-bDa - non-bounceable account address

id: 0835a7ce50b5bfee - api request id

test: https://reqbin.com/9q843rck


monitoring masterchain transactions

POST https://tonapi.org/txlist

headers: Content-Type:application/x-www-form-urlencoded

body:

token: test

result:

error - error message

status: "OK"

count: transactions count

list: transactions list (200 max)

test: https://reqbin.com/8qidajyv


to send .boc file

POST https://tonapi.org/sendfile

multipart/form-data

body:

token: test

file: .boc file

result:

error - error code

message - error message or "file is sent"

status: "OK"

id: 0835a7ce50b5bfee - api request id


It's a private API, for subscription contact us box@tonapi.org