Fiat On-Ramps

Fiat On-Ramps

Magic offers fiat on-ramp functionality in our wallet widget UI, allowing your US and international users to purchase crypto through multiple payment options, including instant ACH, credit card, debit card, Apple Pay, Google Pay, and SEPA transfer. 

#Use Cases

  • Let users purchase cryptocurrencies via our on-ramp partners through our wallet widget UI.
  • Prompt users to top-up their wallet’s token balance if they do not have enough to complete a certain on-chain transaction.

#Usage

How do I allow users to purchase cryptocurrencies through the wallet widget UI?

After following the quickstart to ensure the Magic SDK is set up correctly and the user has successfully logged in, the wallet widget can then be popped open in an iframe as follows: ⁠ ⁠

Javascript
01const walletInfo = await magic.wallet.getInfo();
02const walletType = walletInfo.walletType;
03
04if (walletType === "magic") {
05  await magic.wallet.showUI();
06};

How do I allow users to purchase crypto within the context of a transaction flow?

Fiat on-ramp functionality can also be invoked during the transaction signing flow with web3.eth.sendTransaction(). It allows the user to top-up their wallet if their token balance is insufficient to complete the on-chain transaction.

#On-Ramp Partners

We’ve partnered with PayPal, Sardine, Onramper, and Stripe to offer a wide variety of dependable on-ramp options to users in all 50 US states and a total of 150+ countries.

Please reference our partners’ documentation (linked below) for their fiat, token, and blockchain coverage.