From 52bef80dde9fef39c7573c3eca25bfeb62950e7b Mon Sep 17 00:00:00 2001 From: EmelyanenkoK Date: Fri, 31 Mar 2023 17:32:53 +0300 Subject: [PATCH] Improve jetton text comment example --- src/test-jetton.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test-jetton.js b/src/test-jetton.js index bc9770ef..8500cf76 100644 --- a/src/test-jetton.js +++ b/src/test-jetton.js @@ -128,7 +128,8 @@ const init = async () => { const transfer = async () => { const seqno = (await wallet.methods.seqno().call()) || 0; console.log({seqno}) - + // first four zero bytes are tag of text comment + const comment = new Uint8Array([... new Uint8Array(4), ... new TextEncoder().encode('gift')]); console.log( await wallet.methods.transfer({ secretKey: keyPair.secretKey, @@ -139,7 +140,7 @@ const init = async () => { jettonAmount: TonWeb.utils.toNano('500'), toAddress: new TonWeb.utils.Address(WALLET2_ADDRESS), forwardAmount: TonWeb.utils.toNano('0.01'), - forwardPayload: new TextEncoder().encode('gift'), + forwardPayload: comment, responseAddress: walletAddress }), sendMode: 3, @@ -179,4 +180,4 @@ const init = async () => { // await burn(); } -init(); \ No newline at end of file +init();