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

feat(onramp): adding onramp buy options endpoint #499

Merged
merged 4 commits into from
Feb 20, 2024

Conversation

geekbrother
Copy link
Contributor

@geekbrother geekbrother commented Feb 5, 2024

Description

This PR adds the new endpoint for getting buy options for the onramp payments from the CB payment options endpoint.

  • /v1/onramp/buy/options GET parameters:
    • projectId - project ID
    • country - ISO 3166-1 two-digit country code string representing the purchasing user’s country of residence, e.g., US.
    • subdivision (optional) - ISO 3166-2 two-digit country subdivision code representing the purchasing user’s subdivision of residence within their country, e.g. NY. Required if the country=“US” because certain states (e.g., NY) have state specific asset restrictions.

The new endpoint response object contains the following fields:

  • paymentCurrencies - List of supported fiat currencies that can be exchanged for crypto on CBPay in the given location. Each currency contains a list of available payment methods, with min and max transaction limits for that currency id.
  • purchaseCurrencies - List of available crypto assets that can be bought on CBPay in the given location.

Context of this requirement: https://walletconnect.slack.com/archives/C03SCF66K2T/p1706780083868789?thread_ts=1706744422.369399&cid=C03SCF66K2T

How Has This Been Tested?

  1. New integration test included with this PR.

  2. Manual.

  • Start the server locally: cargo run.
  • Run the following curl request: curl -v 'http://localhost:3000/v1/onramp/buy/options?projectId=xxx&country=US' | jq .

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

@geekbrother geekbrother self-assigned this Feb 5, 2024
@geekbrother geekbrother changed the title feat: adding onramp buy options endpoint feat(onramp): adding onramp buy options endpoint Feb 5, 2024
@geekbrother geekbrother marked this pull request as ready for review February 5, 2024 09:43
@geekbrother geekbrother requested a review from xav as a code owner February 5, 2024 09:43
@geekbrother geekbrother requested a review from tomiir February 5, 2024 09:43
src/providers/coinbase.rs Outdated Show resolved Hide resolved
integration/integration.test.ts Outdated Show resolved Hide resolved
integration/integration.test.ts Outdated Show resolved Hide resolved
@geekbrother geekbrother marked this pull request as draft February 15, 2024 14:56
@geekbrother geekbrother force-pushed the feat/coinbase_options branch from f1f331e to 74d235f Compare February 19, 2024 10:37
@geekbrother geekbrother marked this pull request as ready for review February 19, 2024 10:41
@geekbrother geekbrother merged commit 2c98a73 into master Feb 20, 2024
12 checks passed
@geekbrother geekbrother deleted the feat/coinbase_options branch February 20, 2024 13:39
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