Proporcionar liquidez (v0.5)
Depósitos heredados en pools Jetton/Jetton v0.5: proporciona liquidez a pares de tokens
Depósito en pool Jetton/Jetton
import TonWeb from "tonweb";
import { DEX } from "@ston-fi/sdk";
const USER_WALLET_ADDRESS = ""; // ! reemplaza con tu dirección
const JETTON_0_ADDRESS = "EQA2kCVNwVsil2EM2mB0SkXytxCqQjS4mttjDpnXmwG9T6bO"; // STON
const JETTON_1_ADDRESS = "EQBX6K9aXVl3nXINCyPPL86C4ONVmQ8vK360u6dykFKXpHCa"; // GEMSTON
const router = new DEX.v1.Router({
tonApiClient: new TonWeb.HttpProvider(),
});
const txsParams = await Promise.all([
// depositar 5 STON en el pool STON/GEMSTON y obtener al menos 1 token LP nano
router.buildProvideLiquidityJettonTxParams({
userWalletAddress: USER_WALLET_ADDRESS,
sendTokenAddress: JETTON_0_ADDRESS,
sendAmount: new TonWeb.utils.BN("500000000"),
otherTokenAddress: JETTON_1_ADDRESS,
minLpOut: new TonWeb.utils.BN("1"),
queryId: 12345,
}),
// depositar 2 GEMSTON en el pool STON/GEMSTON y obtener al menos 1 token LP nano
router.buildProvideLiquidityJettonTxParams({
userWalletAddress: USER_WALLET_ADDRESS,
sendTokenAddress: JETTON_1_ADDRESS,
sendAmount: new TonWeb.utils.BN("200000000"),
otherTokenAddress: JETTON_0_ADDRESS,
minLpOut: new TonWeb.utils.BN("1"),
queryId: 123456,
}),
]);
// Para ejecutar la transacción, necesitas enviar una transacción a la cadena de bloques.
// Este código será diferente según la billetera que uses para enviar la tx desde
// se usa el registro con fines demostrativos
txsParams.map((txParams) => console.log({
to: txParams.to,
amount: txParams.gasAmount,
payload: txParams.payload,
}));Depósito en pool TON/Jetton
Última actualización