Stake in Farm
SDK example for staking tokens - deposit LP tokens into STON.fi farming pools to earn rewards
import { TonClient, toNano } from "@ton/ton";
import { FARM } from "@ston-fi/sdk";
const client = new TonClient({
endpoint: "https://toncenter.com/api/v2/jsonRPC",
});
const farm = client.open(FARM.v3.NftMinter.create(
"EQATBSfNArrEFmchmy1XabKmxMNp9KezscqjPzfmstCU7VXO", // STON/TON Farm v3
));
// Stake 1 STON/TON LP token in v3 farm
const txParams = await farm.getStakeTxParams({
userWalletAddress: "", // ! replace with your address
jettonAddress: "EQDtZHOtVWaf9UIU6rmjLPNLTGxNLNogvK5xUZlMRgZwQ4Gt", // STON/TON pool LP token address
jettonAmount: toNano("1"),
queryId: 12345,
});Last updated