You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

mona-js-sdk

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mona-js-sdk

Mona JS SDK wrapping the Monaverse HTTP API

1.0.12
latest
Source
npm
Version published
Weekly downloads
1
-94.44%
Maintainers
0
Weekly downloads
 
Created
Source

Javascript Wrapper around the Monaverse API

A wrapper written in typescript that wraps around the Monaverse API;

How to use:

  • Install with npm i mona-js-sdk
  • Instance the Mona class and use it as you want;

Instancing:

const Mona = new MonaAPI({
  apiKey: api,
  autoLogin: {
    enabled: true,
    callbackOnLogin: setUser
  }
});
export default Mona;

Generate one time password:

await Mona.OTP_Generate('my@email.com');

Note that OTP_Generate will always resolve (unless the api key is wrong) for security reasons.

Verify One time password:

const p = await Mona.OTP_Verify('my@email.com', 123123);
if (p.success) {
        ...
}

Get User :

const user = await Mona.getUser();
console.log(user) 
> {
    wallets: ['0x0fa074262d6af...'],
    email: 'my@email.com',
    username: 'fayelure',
    name: 'Fayelure'
  };

Dev

  • Git clone the repo;
  • Run npm i

Contributing

Create a new branch and push your changes, make sure npm run build still works. Then make a PR;

Keywords

mona

FAQs

Package last updated on 23 Sep 2024

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