Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mooni/widget

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mooni/widget

Mooni Widget SDK

  • 2.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

🌚 Mooni Widget

npm (scoped)

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
// Import package 
import MooniWidget from '@mooni/widget';

// Instanciate the widget 
const mooni = new MooniWidget(); 

// Open the widget as a modal when you want it 
mooni.open();

That's it 🥂 !

🎛 API Reference

MooniWidget

constructor(opts: MooniWidgetOptions)  
Methods
Open widget
open(): void  

Opens Mooni as a widget.

Set Ethereum provider
setEthereum(ethereum?: EthereumProvider): void  

Set an Ethereum provider. Call this method when your users log in with their wallet. They will become automatically logged in Mooni.

MooniWidgetOptions

containerElement?: HTMLElement  

Include Mooni inside of an HTML element on your website if you don't want to use modal mode.

ethereum?: EthereumProvider  

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.

token?: string  

Automatically select a token to sell in Mooni. Must be an ERC20 contract address. Default is ETH.

referralId?: string  

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
  /* available as MooniWidget */  
</script> ```   
## 💻 Development  
  
``` # Install dependencies yarn    
 # Build package yarn build    
 # Publish package npm publish ```

FAQs

Package last updated on 12 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc