GithubHelp home page GithubHelp logo

minterjs's Introduction

minterjs

Development in progress. Welcome to contribute!

NPM: https://www.npmjs.com/package/minterjs

Install

npm i minterjs

Automatic delegation usage example

(async () => {
    const moment = require('moment');
    const {privateKey, address, publicKey, nodeHost} = process.env;
    const MinterJS = require('minterjs')({privateKey, host: nodeHost || 'http://minter.digriz.tech:8841'});
    const BIP = parseFloat((await MinterJS.balances({address})).find(balance => balance.coin == 'BIP').amount || '0');
    const min = 24 - parseInt(moment().format('H'));
    if(BIP > min){
        await MinterJS.delegate({stake: BIP - 0.7, publicKey});
    }
})();

Run in cron:

privateKey=BLA_BLA_BLA address=YOUR_ADDRESS_FOR_MONITORING publicKey=PUBLIC_KEY_OF_FAVORITE_NODE nodeHost=http://minter.digriz.tech:8841 node /redelegate/index.js

Done

const MinterJS = require('minterjs')({host, privateKey});

/** /address?address=_&height=_ */
MinterJS.address({address: 'Mx41b2cfc557dc4661a9526a5a3efcd2cc984339d1'});

/** /coin_info?symbol=_&height=_ */
MinterJS.coin_info({symbol: 'KARMA'});

/** /block?height=_ */
MinterJS.block({height: 1});

/** Peers from net_info */
MinterJS.peers();

/** Balances on address */
MinterJS.balances({address});

/** Delegate */
MinterJS.delegate({coinSymbol /** = BIP */, feeCoinSymbol /** = BIP */, stake, publicKey  /** default: minter.store */});

/** Delegations */ 
MinterJS.delegations({address /** optional */, coinToBuy /** optional, if yo want to get .totals and converted */});

/** Transactions */
MinterJS.transactions({address /** optional */, startblock /** optional */, endblock /** optional */, page /** optional */});

/** Estimations */
MinterJS.estimateCoinSell({coinToBuy/** optional, BIP default */, valueToSell, coinToSell});

Contacts

Donations

Mx41b2cfc557dc4661a9526a5a3efcd2cc984339d1

Minter node:

We launched node, please delegate:

Mp3df654b34c167443ef52e8644266866813b92d4a6ff9c0245c259750a199a455 (3% only)

Use node:

http://minter.digriz.tech:8841

minterjs's People

Contributors

vvmspace 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.