Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add precision validation for Moonpay call #576

Merged
merged 1 commit into from
Nov 20, 2024
Merged

Conversation

ok300
Copy link
Contributor

@ok300 ok300 commented Nov 20, 2024

The Moonpay API defines BTC amounts as having precision = 5, so only 5 decimals are considered. This means sat amounts must be mutiples of 1_000.

When this is not the case, the Moonpay URL shows an ambiguous error:

"Invalid queries, check 'errors' property for more info."

which, when checked, shows another ambiguous

quoteCurrencyAmount must be a decimal number

thrown by the getbuyquote endpoint. Here, quoteCurrencyAmount is the sat amount expressed as BTC (e.g. 0.0005).

@ok300 ok300 merged commit bd38a99 into main Nov 20, 2024
8 checks passed
@ok300 ok300 deleted the ok300-fix-prepare-buy-btc branch November 20, 2024 15:07
roeierez added a commit that referenced this pull request Nov 20, 2024
* commit '14d5bc9c271340abd43f16600964fa0db49fcdc1':
  Remove 32bit support (#575)
  Add precision validation for Moonpay call (#576)
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.

2 participants