stake in farm

Staking of the LP tokens in Farm

import TonWeb from "tonweb";
import { FARM } from "@ston-fi/sdk";

const farm = new FARM.v3.NftMinter({
  tonApiClient: new TonWeb.HttpProvider(),
  address: "EQATBSfNArrEFmchmy1XabKmxMNp9KezscqjPzfmstCU7VXO", // STON/TON Farm v3
});

// Stake 1 STON/TON LP token in v3 farm
const txParams = farm.buildStakeTxParams({
  userWalletAddress: "", // ! replace with your address
  jettonAddress: "EQDtZHOtVWaf9UIU6rmjLPNLTGxNLNogvK5xUZlMRgZwQ4Gt", // STON/TON pool LP token address
  jettonAmount: "1000000000",
  queryId: 12345,
});

// To execute the transaction, you need to send a transaction to the blockchain.
// This code will be different based on the wallet you are using to send the tx from
// logging is used for demonstration purposes
console.log({
  to: txParams.to,
  amount: txParams.gasAmount,
  payload: txParams.payload,
});

Last updated