Onramper API integration on Dapp

Hi, I’d like to try the Onramper Plug-in integrating it on a Dapp using Moralis.

My question is, once the user bought the token with their card or preferred fiat method, which wallet address does those tokens go to? do they go directly to Metamask or the wallet used to authenticate or sign in to my Dapp?

Also, that tokens list to buy are ALL the tokens available to buy? or can we add new tokens from different networks? For example, can I edit the code somehow to list only 1 specific token from the Ethereum network to be bought? My idea is to create a new tab in a Staking Dapp for an specific project, and offer the chance to buy their token onramp besides being able to swap it for ETH or USDT. Is this possible? in that case, how?

Thank you very much,

Marcel

Hi Marcel

I recommend trying buying some crypto yourself through the integration so you understand this first hand.

But the answer is that the user needs to provide the wallet address themselves in the buy process.

While many tokens are available, its not all tokens.

Onramper integration should be mainly used to buy big cryptos like ETH and USDC - and we will soon integrate a DEX plugin which will allow users to trade their cryptos from Onramper to ANY crypto that is on any DEX.

This DEX Plugin should be out this week!

1 Like

Thank you Ivan for the prompt response, I will try it. Also very hyped about the Dex plug-in, very looking forward to it.

I’m excited about Dapp development after completing the courses at the academy. I’ve been studying the Moralis documentation these last 2 weeks waiting for the Moralis course at the Academy. I’m hoping to being helpful here in the forum soon once I have built some dapps myself, as I also would love to be Moralis developer soon. I shill the academy and Moralis in every telegram and Discord group lol.
Thanks brother, greetings from the UK

1 Like

Amazing to hear @ivan

Waiting for the DEX plugin to launch, will need it for one of my applications.

I wanted to do some more customization of the onRamper widget so I’ve been experimenting with it raw in my dap. It has many more parameters than the Moralis plugin exposes and I want those. Specifically I want to limit my users to only buying USDC or Matic, but only on Polygon.

Fiddling with formatting the thing I found the following:

  • The defaultAmount parameter works a peach.
  • The “color” parameter only affects the button color.
  • The “fontFamily” parameter works well enough. Here I’ve switched it to “typewriter” for a touch more “unibomber” vibe.
  • Somehow it’s hooked into the same const {colorMode} = useColorMode(); context that @Chakra-react uses. Because when I flip my site colorMode to “dark” in its @Chakra context the widget’s text color responds and flips white. But its background color remains white. So it just blanks out all text.
  • I can manually select the Polygon versions of USDC, Matic and ETH. But I don’t know the code to filter for them in onlyCryptos or even defaultCrypto. I can’t find a list of supported crypto tokens and their OnRamper symbols anywhere.
  • Not entirely sure if I’m setting the defaultAddrs object right. I can’t get past this basic display formatting in my testing.
  • Along the way it occurs to me there is no provision for SELLING crypto in the ONramper interface. Is there a conjugate OFFramper somewhere?

image image

Much respect for aggregating fiat gateways. That’s a TON of security and KYC work done that I don’t have to. But…altogether onRamper’s front-end doesn’t seem very robust or customizable, nor quite ready for prime time in such simple things as pages with dark mode. Their documentation has a few examples but its woefully missing the necessary exhaustive tables of supported values that you need once you try and actually configure the thing. It’s left us all guessing for codes and I for one: failing.

And I don’t think this is the right place to be complaining about it. Can someone point me to the onRamper devs? I can’t find a “contact us” anywhere either.

Ah. NOW we’re talking

  • I see it has a BUNCH of undocumented parameters like ‘supportBuy/Sell’…but is still missing a “background-color”.
  • I see backgroundColor: inIframe() ? "transparent" : "whitesmoke", on Feb 20 but that’s not working. Do I not have the latest version? Or am I not supporting inIFrame() correctly?
  • I see there’s no font-color in it’s style object, so it’s just left to whatever framework’s running? But I can’t override it because it’s definition fires locally and would overwrite anything at my scope level.
  • Buggers squared off the frame in their css. I can’t round the corners. Dang.

Hm.

Ok so it probably works in general. However: my use case is all on Polygon for the moment to dodge main-net Tx fees. I don’t want my end-users landing on ETH. So when I do get things configured for Polygon “Moonpay” is the only service that onRamper routes us to. And Moonpay has this issue with Brave:
image

So that’s deal-killer #1. Anyway, working around that one by switching to Safari and I run into…“not quite ready for prime-time” #2:

Then Moonpay barfs up its own pop-up window and offers the USDC on Polygon we’ve been promised, right?

Wrong. You get nothing but USDC(erc20 on ETH Mainnet) and like it. That’s deal killer #2. There’s no way to change the token or networkId from here.

Thinking I’m wandering off to give Transak a try instead. This is too far from prod-ready.