From e2b5914aeac86d8ad083f2fe89c83ba16a204027 Mon Sep 17 00:00:00 2001 From: ndatg Date: Sat, 2 Nov 2024 01:01:15 +0400 Subject: [PATCH] fix jettonAmount --- README.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/HighloadWallet.spec.ts | 2 +- src/HighloadWallet.ts | 2 +- src/HighloadWalletV2.spec.ts | 2 +- src/HighloadWalletV2.ts | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9534c57..de0c5ce 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ await contract.sendTransfer({ body: contract.createTokenTransferBody({ toAddress: "EQA3wBIL7tklY8yBlNkErY2HDI9OKP5TbxoLVomYSLX1JlDe", // destination responseAddress: "EQA3wBIL7tklY8yBlNkErY2HDI9OKP5TbxoLVomYSLX1JlDe", // sender address - jettonAmount: "1", // amount + jettonAmount: "1000000000", // 1 token amount (amount with 9 decimals) forwardPayload: "test token transfer" }) }), diff --git a/package-lock.json b/package-lock.json index 7b8f4f1..548f986 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ton-highload-wallet-contract", - "version": "1.1.1", + "version": "1.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ton-highload-wallet-contract", - "version": "1.1.1", + "version": "1.1.2", "license": "MIT", "devDependencies": { "@types/jest": "^29.5.4", diff --git a/package.json b/package.json index 95b401b..c5d9527 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ton-highload-wallet-contract", - "version": "1.1.1", + "version": "1.1.2", "description": "TON Highload Wallet Contract", "main": "dist/index.js", "files": [ diff --git a/src/HighloadWallet.spec.ts b/src/HighloadWallet.spec.ts index 0094114..ba752ae 100644 --- a/src/HighloadWallet.spec.ts +++ b/src/HighloadWallet.spec.ts @@ -63,7 +63,7 @@ describe("HighloadWallet", () => { // body: contract.createTokenTransferBody({ // toAddress: "EQA3wBIL7tklY8yBlNkErY2HDI9OKP5TbxoLVomYSLX1JlDe", // destination // responseAddress: "EQA3wBIL7tklY8yBlNkErY2HDI9OKP5TbxoLVomYSLX1JlDe", // sender address - // jettonAmount: "1", // amount + // jettonAmount: "1000000000", // 1 token amount (amount with 9 decimals) // forwardPayload: "test token transfer" // }) // }), diff --git a/src/HighloadWallet.ts b/src/HighloadWallet.ts index 3bcc55d..c4100c1 100644 --- a/src/HighloadWallet.ts +++ b/src/HighloadWallet.ts @@ -139,7 +139,7 @@ export class HighloadWalletContract implements Contract { const data = beginCell() .storeUint(0xf8a7ea5, 32) .storeUint(0, 64) - .storeCoins(toNano(args.jettonAmount)) + .storeCoins(BigInt(args.jettonAmount)) .storeAddress(Address.parse(args.toAddress)) .storeAddress(Address.parse(args.responseAddress)) .storeBit(false) diff --git a/src/HighloadWalletV2.spec.ts b/src/HighloadWalletV2.spec.ts index d2c412b..31b4b51 100644 --- a/src/HighloadWalletV2.spec.ts +++ b/src/HighloadWalletV2.spec.ts @@ -60,7 +60,7 @@ describe("HighloadWalletV2", () => { // body: contract.createTokenTransferBody({ // toAddress: "EQA3wBIL7tklY8yBlNkErY2HDI9OKP5TbxoLVomYSLX1JlDe", // destination // responseAddress: "EQA3wBIL7tklY8yBlNkErY2HDI9OKP5TbxoLVomYSLX1JlDe", // sender address - // jettonAmount: "1", // amount + // jettonAmount: "1000000000", // 1 token amount (amount with 9 decimals) // forwardPayload: "test token transfer" // }) // }), diff --git a/src/HighloadWalletV2.ts b/src/HighloadWalletV2.ts index 84165a9..9f9b42d 100644 --- a/src/HighloadWalletV2.ts +++ b/src/HighloadWalletV2.ts @@ -147,7 +147,7 @@ export class HighloadWalletContractV2 implements Contract { const data = beginCell() .storeUint(0xf8a7ea5, 32) .storeUint(0, 64) - .storeCoins(toNano(args.jettonAmount)) + .storeCoins(BigInt(args.jettonAmount)) .storeAddress(Address.parse(args.toAddress)) .storeAddress(Address.parse(args.responseAddress)) .storeBit(false)