Closed Niten619 closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
solana-pay | ✅ Ready (Inspect) | Visit Preview | Sep 5, 2022 at 6:09PM (UTC) |
solana-pay-docs | ✅ Ready (Inspect) | Visit Preview | Sep 5, 2022 at 6:09PM (UTC) |
Thanks for the description of the issue! Could you remove the core/app stuff from the PR though?
Copy that.. anything else sir?
Thanks, much easier to review now. It looks like this fix is needed in a few more places though:
https://github.com/solana-labs/solana-pay/search?q=decimalPlaces&type=
Released: @solana/pay
v0.2.4
Thanks a lot, sir !
While invoking createTransfer method for transferring native SOL and SPL tokens, the logic which checks whether the amount provided has greater precision than the SOL/mint or not (line 119 & line 148 of core/src/createTransfer.ts) will always throw CreateTransferError('amount decimals invalid') error even if we provide the amount value which is less than 9 decimals (eg. 0.5 or 1.00254) because the logic "(amount.decimalPlaces() ?? 0 > SOL_DECIMALS)" will always be True for any decimal values (whether it be less than 9 decimal (eg. 0.08) or greater than 9 decimal (eg. 0.0021547854). Adding parenthesis to the logic like so would solve this.