hedera-sdk-js
hedera-sdk-js copied to clipboard
addTokenTransferWithDecimals() method not working
Description
Trying to use the addTokenTransferWithDecimals() to handle increasing the order of magnitude of a token but not making a difference.
Am on SDK "@hashgraph/sdk": "^2.45.0",
Steps to reproduce
e.g. this token has 4 decimals. would expect this to send 1 of tokenId but it sends 0.0001
const tx = await new TransferTransaction() .addHbarTransfer(clientAccountId, -1) .addHbarTransfer(secondId, 1) .addTokenTransferWithDecimals(tokenId, secondId, 1, 4) .addTokenTransferWithDecimals(tokenId, clientAccountId, -1, 4) .setTransactionId(transactionId) .setNodeAccountIds([new AccountId(3)]) .freeze() .sign(PrivateKey.fromStringED25519(secondKey));
Additional context
No response
Hedera network
mainnet
Version
latest
Operating system
macOS