Skip to content

Commit

Permalink
Improve jetton text comment example
Browse files Browse the repository at this point in the history
  • Loading branch information
EmelyanenkoK authored Mar 31, 2023
1 parent b550969 commit 52bef80
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/test-jetton.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -179,4 +180,4 @@ const init = async () => {
// await burn();
}

init();
init();

1 comment on commit 52bef80

@NaeimHakmat
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7871996240

Please sign in to comment.