Message with Ton
Messaging with Ton Network
Chain Id and Contract
Ton Testnet contract
Ton Network message out
Call message out
slice bridge_addr = <bridge address>;
;; message out body
cell body = begin_cell()
.store_uint(0x136a3529, 32) ;; op::message_out
.store_uint(0, 64) ;; queryId
.store_uint(0, 8) ;; relay, 0 or 1
.store_uint(0, 8) ;; msgType, 1 for message
.store_uint(56, 64) ;; toChain, eg. 56 for bnb
.storeAddress(<initiator_address>) ;; initiator
.store_slice(<target>) ;; target address
.store_uint(200000000, 64) ;; gasLimit
.store_ref(<payload>) ;; payload, custom data
).end_cell();
;; internal message
cell msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(bridge_addr)
.store_coins(50000000) ;; 0.05 TON for fees
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.store_slice(body)
.end_cell();data example
parameter
data
Message to Ton Network
data example
parameter
data
Execute on Ton Network
Last updated