Open kasahh opened 3 months ago
Have you found a solution?
No I didn't, I settled for the python version
I also encountered this problem and was returned inexplicably.
Debug variable sender.address, u will be surprised
Then change
const jettonWallet = tonClient.open(await jettonRoot.getWallet(sender.address));
to
const jettonWallet = tonClient.open(await jettonRoot.getWallet(walletContract.address));
Debug variable sender.address, u will be surprised
It worked after changing:
const jettonWallet = tonClient.open(await jettonRoot.getWallet(sender.address));
to
const jettonWallet = tonClient.open(await jettonRoot.getWallet(walletContract.address));
Thank you!
i solved this by ensuring forward_amount < attached_amount
await jettonWallet.sendTransfer(
sender,
toNano("0.3"), // attached_amount
{
amount: tokenInAmount,
destination: vault.address,
responseAddress: wallet.address, // return gas
forwardAmount: toNano("0.25"), // forward_amount has to be less than attached_amount
forwardPayload: VaultJetton.createSwapPayload({
poolAddress: pool.address,
limit: minAmountOut,
}),
},
);
I am trying to swap jetton to ton programmatically using the "Swapping Jettons" example here: https://docs.dedust.io/docs/swaps. For some reasons it doesn't work and I have no idea why. 0.3Ton gets sent out and 0.2999Ton is immediately returned.
This is my code:
`
This is the transaction on chain: https://tonviewer.com/transaction/b229c7b02616f8b698fa1efa602fb89070f9fd77fa7c49fde6c11d00d01f0d8e