Frontend integration
Integrate Mooni into your app
Mooni is the off-ramping solution for the DeFi ecosystem, which can enable users of your dApp to cash out the cryptocurrencies they earn directly into their bank account.
Our widget SDK is a super simple solution to integrate Mooni into your already existing application. The widget can either appear as a modal on top of an app, or included inside an HTML element. If the hosting app already has a connected user with web3, this wallet can be forwarded to the widget.
๐บ Example integration
Check our live integration example (code)
๐ Quick start
Install
yarn add @mooni/widget
Start widget
Thatโs it ๐ฅ !
๐ API Reference
MooniWidget
Methods
Open widget
Opens Mooni as a widget.
Set Ethereum provider
Set an Ethereum provider. Call this method when your users log in with their wallet. They will become automatically logged in Mooni.
MooniWidgetOptions
Include Mooni inside of an HTML element on your website if you donโt want to use modal mode.
A standard JSON-RPC provider. This is useful if the hosting app already authenticated the web3 wallet of the user, so he doesnโt have to login again on Mooni.
Automatically select a token to sell in Mooni. Must be an ERC20 contract address. Default is ETH.
Sets a referral account. All orders passed with this referral ID through the widget will share profit. You can find your referral ID on your Account page.
Additional information
Import on different module systems
ES6
import MooniWidget from '@mooni/widget';
CommonJS
const MooniWidget = require('@mooni/widget');
UMD
Last updated