mona-js-sdk
v1.0.12
Published
Mona JS SDK wrapping the Monaverse HTTP API
Downloads
14
Readme
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('[email protected]');
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('[email protected]', 123123);
if (p.success) {
...
}
Get User :
const user = await Mona.getUser();
console.log(user)
> {
wallets: ['0x0fa074262d6af...'],
email: '[email protected]',
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;