Coder Social home page Coder Social logo

muon-wallet's Introduction

Muon Wallet

Installation

Run the following command to install the package

npm install muon-wallet

Include the styles file in your project

For React applications :

import 'muon-wallet/src/css/index.css'

Getting Started

Importing

Now you can import the "Muon" class

Using Node.js require()

const { Muon } = require('muon-wallet')

Using ES6 imports

import { Muon } from 'muon-wallet'

Usage

The Muon class accepts an optional base url as string that will replace the package default base url. Then you can call the request method of the constructed muon class.

const muon = new Muon()
muon.request()

The "request" method, accepts these required parameters :

  1. appName : This parameter must be the name of one of apps that exist in the Muon Explorer apps list and it should be string.

  2. methodName : This parameter must be the name of one of method of the app that is entered as the first parameter.

  3. params : This parameter must be the params of the method that is entered as the second parameter and it should be an object.

Examples

This function returns a promise that should be handled correctly.

const muon = new Muon()
muon.request(app, method, params)
   .then(res => {
      console.log(res)
   })
   .catch(err => {
      console.error(err)
   })
try{
	const muon = new Muon()
   const res = await request(app, method, params)
   console.log(res)
}
catch(err){
   console.error(err)
}

muon-wallet's People

Contributors

kmmrcap avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.