diff --git a/resources/images/burning-ton-minter.png b/resources/images/burning-ton-minter.png new file mode 100644 index 00000000..24ab28bd Binary files /dev/null and b/resources/images/burning-ton-minter.png differ diff --git a/standard/tokens/jettons/how-to-burning.mdx b/standard/tokens/jettons/how-to-burning.mdx index 1feb3e0d..423e0520 100644 --- a/standard/tokens/jettons/how-to-burning.mdx +++ b/standard/tokens/jettons/how-to-burning.mdx @@ -1,7 +1,68 @@ --- title: "How to burn" +sidebarTitle: "Burning Jettons" --- -import { Stub } from '/snippets/stub.jsx'; +import { Image } from '/snippets/image.jsx'; - +Jettons burning is primarily intended to get rid of unnecessary jettons (those with low liquidity or a zero price) and +to influence the market (burning a large number of jettons could increase its liquidity). + +Here is the code for that: + +```typescript +import { Address, toNano, WalletContractV5R1, TonClient } from "@ton/ton"; + +import { mnemonicToPrivateKey } from "@ton/crypto"; + +import { + AssetsSDK, + createApi, +} from "@ton-community/assets-sdk"; + +async function main() { + const client = new TonClient({ + endpoint: "https://toncenter.com/api/v2/jsonRPC", + }); + + const your_mnemonic = "put your mnemonic here, ..."; + const keyPair = await mnemonicToPrivateKey(your_mnemonic.split(" ")); + + const wallet = WalletContractV5R1.create({ + workchain: 0, + publicKey: keyPair.publicKey, + }); + + const provider = client.provider(wallet.address); + const sender = wallet.sender(provider, keyPair.secretKey); + + const NETWORK = "testnet"; + const api = await createApi(NETWORK); + + const sdk = AssetsSDK.create({ + api, + sender, + }); + + const JETTON_ADDRESS = Address.parse("put youe Jetton wallet address"); + const jetton = sdk.openJettonWallet(JETTON_ADDRESS); + + const RECEIVER_ADDRESS = Address.parse("put receiver address"); + await jetton.sendBurn(sender, 1200000n); +} + +void main(); +``` + +An alternative way to burn tokens is to send them to a ["zero" account](https://tonviewer.com/UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ), see [How to transfer](/standard/tokens/jettons/how-to-transfer). + +## Web services + +You can also burn tokens without having to write code. Let's consider [TON MINTER](https://minter.ton.org/) as an example. + +- Connect your wallet using TON Connect. +- Enter the Jetton master contract address into the "Jetton address" field. +- Click the "Burn" button in your wallet's balance field and enter the amount you want to burn. +- Confirm burning in your wallet application. + +![Burning](/resources/images/burning-ton-minter.png)