This content is not available in your language yet.
This page lists common examples of working with jettons.
Accepting jetton transfer
Transfer notification message have the following structure.
Use receiver function to accept token notification message.
Validation can be done using jetton wallet state init and calculating jetton address.
Note, that notifications are coming from YOUR contract’s jetton wallet, so myAddress() should be used in owner address field.
Wallet initial data layout is shown below, but sometimes it can differ.
Note that myJettonWalletAddress may also be stored in contract storage to use less gas in every transaction.
Sending jetton transfer
To send jetton transfer use send() function.
Note that myJettonWalletAddress may also be stored in contract storage to use less gas in every transaction.
Burning jetton
USDT jetton operations
Operations with USDT (on TON) remain the same, except that the JettonWalletData will have the following structure:
Function to calculate wallet address will look like this: