destroy farm NFT

This section contains SDK example for destroying unstaked farm NFT

Destroy of the Farm NFT is a transfer of the Farm NFT from the user wallet to the zero address.

import { TonClient } from "@ton/ton";
import { FARM } from "@ston-fi/sdk";

const client = new TonClient({
  endpoint: "https://toncenter.com/api/v2/jsonRPC",
});

const farmNft = client.open(FARM.v3.NftItem.create(
  "EQA18JnBVNZZ8Wz-Kn6Mc5cy9pv798Pn8tfScjKw9NLPK3U2", // Farm v3 nft address
));

// Destroy farm NFT from the owner's wallet
const txParams = await farmNft.getDestroyTxParams({
  queryId: 12345,
});

To execute the transaction, you need to send a transaction with these parameters to the blockchain. This code will be different based on the wallet you are using to send the tx from, so please check our doc section about transaction sending guide with examples for different libraries.

Last updated