Skip to content

Add Bridge.Onramp functions + port old functions #7076

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

Merged
merged 54 commits into from
May 20, 2025
Merged

Conversation

joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented May 19, 2025


PR-Codex overview

This PR primarily focuses on enhancing the Onramp functionality within the thirdweb library, including the addition of new features, updates to existing types, and the removal of deprecated components related to fiat transactions.

Detailed summary

  • Removed Files: Deleted several .tsx files related to fiat transaction screens.
  • New Features: Introduced Bridge.Onramp.prepare and Bridge.Onramp.status functions for managing onramp transactions.
  • Type Updates: Added priceUsd to Token type and BridgeAction type for transaction actions.
  • Provider Changes: Updated the preferred payment providers in various components to remove KADO.
  • Functionality Adjustments: Simplified status checks in useOnRampStatus.
  • Removed Deprecated Functions: Eliminated old endpoint functions related to fiat transactions.
  • Testing Updates: Adjusted tests to reflect changes in expected addresses and removed tests for deleted components.
  • Code Cleanup: Streamlined code and removed unused imports across multiple files.

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

gregfromstl and others added 30 commits May 15, 2025 14:24
- Changes the behavior of buyWithCrypto to use the Universal Bridge service instead of the legacy API
- Updates getQuote and getTransfer implementation to use Bridge.Buy and Bridge.Sell
- Adds a new Transfer module to the Bridge namespace for token transfers
- Removes the legacy API endpoints from definitions.ts

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
- Adds new Transfer module for direct token transfers
- Implements prepare function for getting transfer quotes and transactions
- Adds tests for the Transfer module

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Switch useSendTransaction and useSwapSupportedChains to use Bridge.routes endpoint for retrieving supported destinations.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
- Changed import from Bridge to Transfer for better clarity and consistency.
- Updated the usage of the Transfer module in the getBuyWithCryptoTransfer function.
<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces documentation and assets for integrating thirdweb tools into the Stylus contract development workflow, specifically for Rust. It includes setup instructions, publishing and deployment commands, and images to enhance the documentation.

### Detailed summary
- Added new sections in `page.mdx` for Arbitrum Stylus.
- Included prerequisites for Rust and Solidity installations.
- Provided setup commands for creating a Stylus project.
- Added commands for publishing and deploying Stylus contracts.
- Included images (`stylus-publish-page.png`, `stylus-deploy-page.png`) to illustrate the process.

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

<!-- end pr-codex -->
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
<!-- start pr-codex -->

## PR-Codex overview
This PR focuses on updating the pricing plans and features for the embedded wallets in the dashboard application. It adjusts the plan requirements and modifies the features associated with different plans.

### Detailed summary
- Changed `authRequiredPlan` from `"accelerate"` to `"growth"`.
- Added `"Custom Wallet Branding & Auth"` to the features list.
- Removed `"Custom Wallet Branding & Auth"` from the `TEAM_PLANS` features.
- Increased `$400 Usage Credits` to `$500 Usage Credits` in the `TEAM_PLANS` features.

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

<!-- end pr-codex -->
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
// onrampChainId: 1, // chain to initially onramp to
// currency: "USD",
// maxSteps: 2,
// purchaseData: { customId: "123" }
Copy link
Member

Choose a reason for hiding this comment

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

We should include an optional country param in case calling from the server

Copy link
Member Author

Choose a reason for hiding this comment

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

btw i dont think the ip country detection works, its letting me see stripe stuff which is not available in NZ

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it does either and I don't know why

});

console.log(preparedOnramp.link); // URL to redirect the user to
console.log(preparedOnramp.destinationAmount); // Amount of token user will receive
Copy link
Member

Choose a reason for hiding this comment

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

Instead of destination amount (since they inputted that) I would highlight the currencyAmount, how much they'll pay

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -16,7 +16,7 @@ Developers can turn on Test Mode to test both fiat-to-crypto transactions and cr

## Buy With Fiat

By setting `testMode` to `true` for Buy With Fiat, you can enable test experiences for our underlying providers (Stripe, Kado, and Transak).
By setting `testMode` to `true` for Buy With Fiat, you can enable test experiences for our underlying providers (Coinbase, Stripe, and Transak).
Copy link
Member

Choose a reason for hiding this comment

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

This isn't true at the moment

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, we'll have to fix that :D pretty important

);
return toBuyWithFiatStatus({ intentId: params.intentId, result });
} catch (error) {
// If the session is not found, the Onramp.status endpoint will return a 404 which we map to
Copy link
Member

Choose a reason for hiding this comment

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

This should never happen since the onramps are stored on quote and if it does we should throw

Copy link
Member Author

Choose a reason for hiding this comment

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

ok i wasn't sure. fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages Portal Involves changes to the Portal (docs) codebase. SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants