Skip to content

Preserve Solana transfer amount precision - #184

Open
samsamtrum wants to merge 1 commit into
getpara:3.0.0from
samsamtrum:fix-solana-transfer-amount-precision
Open

Preserve Solana transfer amount precision#184
samsamtrum wants to merge 1 commit into
getpara:3.0.0from
samsamtrum:fix-solana-transfer-amount-precision

Conversation

@samsamtrum

Copy link
Copy Markdown

The Solana Signers v2 transfer example converted SOL amounts through parseFloat before converting to lamports. That can lose precision for decimal inputs and also accepts partially numeric strings such as 1abc.

This parses the amount as a decimal string directly into lamports, rejects malformed values and inputs with more than 9 decimal places, and keeps the balance check in bigint arithmetic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant