I get data for exchange from dedust sdk (ton > jetton )
import { toNano } from '@ton/core';
// ...
const amountIn = toNano('5'); // 5 TON
await tonVault.sendSwap(sender, {
poolAddress: pool.address,
amount: amountIn,
gasAmount: toNano("0.25"),
});
how can i transfer them to the client and send the transaction via tonconnect/ui?
tonConnectUI.sendTransaction({...})
now i send transaction to stonfi this way:
const txParams = await router.getSwapTonToJettonTxParams({
userWalletAddress: user.ton_wallet,
proxyTon: new pTON.v1(),
offerAmount: toNano("0.1"),
askJettonAddress: token.ca,
minAskAmount: min_ask,
queryId: 123,
});
const tx = {
address: txParams.to.toString(),
amount: txParams.value.toString(),
payload: txParams.body?.toBoc().toString("base64"),
}