Claim Rewards
SDK example for claiming farming rewards - harvest your earned tokens from STON.fi farming pools
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
));
// Unstake all staked funds from Farm NFT back to the owner's wallet
const txParams = await farmNft.getClaimRewardsTxParams({
queryId: 12345,
});Last updated