-
Notifications
You must be signed in to change notification settings - Fork 544
[SDK] Feature: Adds explicit country param to onramps #7185
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
Conversation
🦋 Changeset detectedLatest commit: 20d9835 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Warning Rate limit exceeded@gregfromstl has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 38 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughA new changeset file was added to document a patch update for the "thirdweb" package. The main code change introduces an optional Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant OnrampModule
participant API
User->>OnrampModule: Call prepare({ ..., country })
OnrampModule->>API: Send request with country in body (if provided)
API-->>OnrampModule: Respond (may error if country unsupported)
OnrampModule-->>User: Return result or error
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/thirdweb/src/bridge/Onramp.ts (1)
141-141
: Clarify country code format specification.The documentation mentions defaulting to "US" but doesn't specify the expected country code format (ISO 3166-1 alpha-2, alpha-3, etc.). Consider adding format specification for clarity.
-@param [ options.country] - The user's country code (e.g. "US", "JP"). Defaults to "US". We highly recommend this be set (based on the user's IP address). +@param [options.country] - The user's country code in ISO 3166-1 alpha-2 format (e.g. "US", "JP"). Defaults to "US". We highly recommend this be set (based on the user's IP address).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.changeset/clear-books-allow.md
(1 hunks)packages/thirdweb/src/bridge/Onramp.ts
(6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Size
- GitHub Check: Build Packages
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Unit Tests
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (6)
packages/thirdweb/src/bridge/Onramp.ts (5)
56-56
: LGTM! Clean interface extension.The addition of the optional
country
parameter to theOnrampApiRequestBody
interface is well-structured and follows TypeScript best practices.
111-126
: Excellent documentation with clear example.The Global Support section provides valuable context for when and how to use the country parameter. The example code is clean and demonstrates proper usage.
166-166
: Consistent parameter handling.The destructuring pattern correctly includes the new country parameter alongside existing optional parameters.
208-210
: Proper conditional API request body handling.The country parameter is correctly added to the API request body following the same defensive pattern as other optional parameters.
272-272
: Type declaration consistency maintained.The
country?: string
addition to the Options type correctly matches the interface definition and function parameter..changeset/clear-books-allow.md (1)
1-6
: Well-formatted changeset documentation.The changeset correctly identifies this as a patch update and provides a clear, concise description of the feature addition.
size-limit report 📦
|
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (25.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #7185 +/- ##
=======================================
Coverage 55.66% 55.67%
=======================================
Files 904 904
Lines 58400 58404 +4
Branches 4116 4119 +3
=======================================
+ Hits 32510 32517 +7
+ Misses 25784 25781 -3
Partials 106 106
🚀 New features to boost your workflow:
|
9153edc
to
20d9835
Compare
PR-Codex overview
This PR adds support for specifying a user's
country
code in the onramp parameters for theprepare
function in theOnramp
API. This enhancement aims to improve user experience by ensuring compatibility with provider support based on the user's location.Detailed summary
country
parameter to theOnrampApiRequestBody
interface.country
code.country
parameter in theprepare
function.prepare
function to handle thecountry
parameter in the request body.Summary by CodeRabbit