toncenter/tonweb

No message is sent for jetton transfers

StasVitAlex opened this issue · 1 comments

I'm using example from test file: https://github.com/toncenter/tonweb/blob/c2d5d0fc23d2aec55a0412940ce6e580344a288c/src/test-jetton.js.

await wallet.methods.transfer({
    secretKey: keyPair.secretKey,
    toAddress: JETTON_WALLET_ADDRESS,
    amount: TonWeb.utils.toNano('0.05'),
    seqno: seqno,
    payload: await jettonWallet.createTransferBody({
        jettonAmount: TonWeb.utils.toNano('500'),
        toAddress: new TonWeb.utils.Address(WALLET2_ADDRESS),
        forwardAmount: TonWeb.utils.toNano('0.01'),
        forwardPayload: new TextEncoder().encode('gift'),
        responseAddress: walletAddress
    }),
    sendMode: 3,
}).send()

Sending jetton tokens works well, but transaction payload doesn't contain any message ('gift' in that example). What's wrong?

this works for me.

// first four zero bytes are tag of text comment
forwardPayload: new Uint8Array([... new Uint8Array(4), ... new TextEncoder().encode('gift)]);