Skip to content

Add Rampnow as a fiat onramp provider#8764

Merged
0xFirekeeper merged 3 commits into
mainfrom
firekeeper/rampnow
May 11, 2026
Merged

Add Rampnow as a fiat onramp provider#8764
0xFirekeeper merged 3 commits into
mainfrom
firekeeper/rampnow

Conversation

@0xFirekeeper
Copy link
Copy Markdown
Member

@0xFirekeeper 0xFirekeeper commented May 11, 2026

Add support for the new "rampnow" onramp provider across the codebase. Updates include: adding "rampnow" to Onramp types and API request body, adding it to the FiatProviders list and provider->onramp mapping, including it in the useBuyWithFiatQuotesForProviders hook, and adding the provider entry (icon/description) plus selection typing/handlers in the Bridge UI and payment types.


PR-Codex overview

This PR introduces RampNow as a new onramp provider in the thirdweb SDK, enhancing the payment options available for users. It updates various types and interfaces to include this new provider and adds related tests to ensure functionality.

Detailed summary

  • Added RampNow as an onramp provider in packages/thirdweb/src/react/web/ui/Bridge/types.ts.
  • Updated FiatProviders to include rampnow in packages/thirdweb/src/pay/utils/commonTypes.ts.
  • Modified PaymentSelection.tsx and FiatProviderSelection.tsx to support rampnow.
  • Enhanced useBuyWithFiatQuotesForProviders to include rampnow in quotes retrieval.
  • Updated getQuote.ts to map rampnow correctly.
  • Added tests for RampNow functionality in useBuyWithFiatQuotesForProviders.test.tsx and Onramp.test.ts.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Added RampNow as a fiat on‑ramp provider option for purchasing crypto, now available alongside Stripe, Coinbase, and Transak.
  • Tests

    • Added/updated tests to cover RampNow support and ensure multi-provider quote preparation and onramp preparation flows behave as expected.

Review Change Stack

Add support for the new "rampnow" onramp provider across the codebase. Updates include: adding "rampnow" to Onramp types and API request body, adding it to the FiatProviders list and provider->onramp mapping, including it in the useBuyWithFiatQuotesForProviders hook, and adding the provider entry (icon/description) plus selection typing/handlers in the Bridge UI and payment types.
@0xFirekeeper 0xFirekeeper requested review from a team as code owners May 11, 2026 20:45
@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-v2 Error Error May 11, 2026 9:51pm
nebula Ready Ready Preview, Comment May 11, 2026 9:51pm
thirdweb_playground Ready Ready Preview, Comment May 11, 2026 9:51pm
thirdweb-www Ready Ready Preview, Comment May 11, 2026 9:51pm
wallet-ui Ready Ready Preview, Comment May 11, 2026 9:51pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 11, 2026

🦋 Changeset detected

Latest commit: 2e47528

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
thirdweb Minor
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch
wagmi-inapp Patch

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

@github-actions github-actions Bot added packages SDK Involves changes to the thirdweb SDK labels May 11, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cdc74eba-f334-4437-8836-2df4d9f48a33

📥 Commits

Reviewing files that changed from the base of the PR and between 507c17e and 2e47528.

📒 Files selected for processing (5)
  • packages/thirdweb/src/bridge/Onramp.test.ts
  • packages/thirdweb/src/bridge/Onramp.ts
  • packages/thirdweb/src/pay/buyWithFiat/getQuote.ts
  • packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.test.tsx
  • packages/thirdweb/src/react/core/hooks/useBridgePrepare.test.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/thirdweb/src/bridge/Onramp.ts

Walkthrough

This PR adds RampNow as a fourth supported fiat onramp provider in the thirdweb SDK. Type definitions, quote mapping, React hooks, and UI components are updated to accept and handle the new rampnow provider option alongside the existing Stripe, Coinbase, and Transak providers.

Changes

Rampnow Provider Addition

Layer / File(s) Summary
Core Type Definitions
packages/thirdweb/src/pay/utils/commonTypes.ts, packages/thirdweb/src/bridge/Onramp.ts, packages/thirdweb/src/react/web/ui/Bridge/types.ts
FiatProviders constant adds "rampnow" literal. OnrampIntent and OnrampApiRequestBody types extend the onramp union to include "rampnow". PaymentMethod fiat variant expands onramp union with "rampnow".
Public API Contract
packages/thirdweb/src/bridge/Onramp.ts
Exported prepare.Options.onramp type documentation and union updated to include "rampnow" as a valid provider option.
Quote Mapping Logic
packages/thirdweb/src/pay/buyWithFiat/getQuote.ts
Internal mapProviderToOnramp helper extended with "rampnow" case to forward the provider to Onramp.prepare. Defaulted quote provider string normalized to "coinbase" when unspecified.
Hook Integration
packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.ts
Hook updated to fetch prepared onramp quotes for the expanded four-provider set (Coinbase, Stripe, Transak, Rampnow).
UI Components
packages/thirdweb/src/react/web/ui/Bridge/payment-selection/FiatProviderSelection.tsx, packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
FiatProviderSelectionProps callback expands provider union to "rampnow". PROVIDERS catalog gains a new rampnow entry with icon and display name. PaymentSelection handler type expanded to accept "rampnow".
Tests
packages/thirdweb/src/bridge/Onramp.test.ts, packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.test.tsx, packages/thirdweb/src/react/core/hooks/useBridgePrepare.test.ts
Add tests exercising rampnow in Onramp.prepare (gated by env var), hook fan-out across four providers, and BridgePrepare request acceptance for "rampnow".
Release Notes
.changeset/chatty-peaches-drop.md
Changeset marks thirdweb package as minor version release with RampNow onramp provider addition.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description explains the changes well and includes a detailed PR-Codex summary, but does not follow the template structure with required sections like 'Notes for the reviewer' and 'How to test'. Consider adding explicit 'Notes for the reviewer' section and 'How to test' section to match the repository template for better consistency and clarity.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding Rampnow as a fiat onramp provider, which is the primary objective of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch firekeeper/rampnow

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

size-limit report 📦

Path Size
@thirdweb-dev/nexus (esm) 105.66 KB (0%)
@thirdweb-dev/nexus (cjs) 319.47 KB (0%)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/thirdweb/src/pay/buyWithFiat/getQuote.ts (1)

468-468: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix hardcoded provider value to use lowercase.

The fallback value "COINBASE" is uppercase but FiatProvider expects lowercase "coinbase". This causes a type mismatch that is masked by the as FiatProvider cast.

🐛 Proposed fix
-      provider: (params.preferredProvider ?? "COINBASE") as FiatProvider,
+      provider: params.preferredProvider ?? "coinbase",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/thirdweb/src/pay/buyWithFiat/getQuote.ts` at line 468, The fallback
provider value is incorrectly hardcoded as uppercase "COINBASE" which conflicts
with the FiatProvider lowercase enum; update the provider default in the
getQuote creation/params object (the line using provider:
(params.preferredProvider ?? "COINBASE") as FiatProvider) to use the lowercase
string "coinbase" and remove the unnecessary type cast so the expression becomes
provider: params.preferredProvider ?? "coinbase" (ensuring it matches the
FiatProvider type).
🧹 Nitpick comments (2)
packages/thirdweb/src/bridge/Onramp.ts (2)

131-131: ⚡ Quick win

Update documentation to include the new provider.

The JSDoc comment should list all supported providers including "rampnow" for completeness.

📝 Suggested documentation update
- * `@param` options.onramp - The onramp provider to use (e.g., "stripe", "coinbase", "transak").
+ * `@param` options.onramp - The onramp provider to use (e.g., "stripe", "coinbase", "transak", "rampnow").
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/thirdweb/src/bridge/Onramp.ts` at line 131, Update the JSDoc for the
onramp parameter in Onramp.ts to list all supported providers and include the
new "rampnow" provider; locate the comment describing the options.onramp
parameter (near the function or type that defines Onramp or the onramp option)
and add "rampnow" to the example provider list alongside "stripe", "coinbase",
and "transak" so the docs reflect the new supported provider.

275-276: ⚡ Quick win

Update documentation to include the new provider.

The JSDoc comment should list all supported providers including "rampnow" for completeness.

📝 Suggested documentation update
- /** The onramp provider to use (e.g., "stripe", "coinbase", "transak") */
- onramp: "stripe" | "coinbase" | "transak" | "rampnow";
+ /** The onramp provider to use (e.g., "stripe", "coinbase", "transak", "rampnow") */
+ onramp: "stripe" | "coinbase" | "transak" | "rampnow";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/thirdweb/src/bridge/Onramp.ts` around lines 275 - 276, Update the
JSDoc for the onramp property in Onramp.ts so it enumerates all supported
providers including "rampnow"; locate the onramp declaration (onramp: "stripe" |
"coinbase" | "transak" | "rampnow") and change the comment to list "stripe",
"coinbase", "transak", and "rampnow" so the doc matches the type definition.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/thirdweb/src/pay/buyWithFiat/getQuote.ts`:
- Line 468: The fallback provider value is incorrectly hardcoded as uppercase
"COINBASE" which conflicts with the FiatProvider lowercase enum; update the
provider default in the getQuote creation/params object (the line using
provider: (params.preferredProvider ?? "COINBASE") as FiatProvider) to use the
lowercase string "coinbase" and remove the unnecessary type cast so the
expression becomes provider: params.preferredProvider ?? "coinbase" (ensuring it
matches the FiatProvider type).

---

Nitpick comments:
In `@packages/thirdweb/src/bridge/Onramp.ts`:
- Line 131: Update the JSDoc for the onramp parameter in Onramp.ts to list all
supported providers and include the new "rampnow" provider; locate the comment
describing the options.onramp parameter (near the function or type that defines
Onramp or the onramp option) and add "rampnow" to the example provider list
alongside "stripe", "coinbase", and "transak" so the docs reflect the new
supported provider.
- Around line 275-276: Update the JSDoc for the onramp property in Onramp.ts so
it enumerates all supported providers including "rampnow"; locate the onramp
declaration (onramp: "stripe" | "coinbase" | "transak" | "rampnow") and change
the comment to list "stripe", "coinbase", "transak", and "rampnow" so the doc
matches the type definition.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2f15c213-bd1b-4545-a1c5-17f97bab24a3

📥 Commits

Reviewing files that changed from the base of the PR and between eb07340 and 507c17e.

📒 Files selected for processing (8)
  • .changeset/chatty-peaches-drop.md
  • packages/thirdweb/src/bridge/Onramp.ts
  • packages/thirdweb/src/pay/buyWithFiat/getQuote.ts
  • packages/thirdweb/src/pay/utils/commonTypes.ts
  • packages/thirdweb/src/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.ts
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/FiatProviderSelection.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/types.ts

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 52.78%. Comparing base (eb07340) to head (2e47528).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...b/ui/Bridge/payment-selection/PaymentSelection.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8764      +/-   ##
==========================================
+ Coverage   52.76%   52.78%   +0.01%     
==========================================
  Files         934      934              
  Lines       62970    62976       +6     
  Branches     4142     4137       -5     
==========================================
+ Hits        33228    33241      +13     
+ Misses      29642    29635       -7     
  Partials      100      100              
Flag Coverage Δ
packages 52.78% <87.50%> (+0.01%) ⬆️
Files with missing lines Coverage Δ
packages/thirdweb/src/bridge/Onramp.ts 60.37% <ø> (ø)
...core/hooks/pay/useBuyWithFiatQuotesForProviders.ts 90.00% <100.00%> (+77.50%) ⬆️
...Bridge/payment-selection/FiatProviderSelection.tsx 23.39% <100.00%> (+2.78%) ⬆️
...b/ui/Bridge/payment-selection/PaymentSelection.tsx 6.96% <0.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Fix uppercase 'COINBASE' fallback to lowercase 'coinbase' in getBuyWithFiatQuote, matching the FiatProvider enum and dropping the redundant cast.
- Add 'rampnow' to the @param options.onramp JSDoc example list in bridge/Onramp.ts.
- Add useBuyWithFiatQuotesForProviders.test.tsx that mocks prepareOnramp/getToken and asserts the hook fans out to all four providers (coinbase, stripe, transak, rampnow) plus disabled-when-no-params.
- Add a useBridgePrepare.test.ts case that iterates over all four onramp providers including 'rampnow' to validate the BridgePrepareRequest discriminated union.
- Add a Rampnow case to bridge/Onramp.test.ts gated on TW_BRIDGE_RAMPNOW for once the bridge backend deploys with rampnow support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant