Wondering what’s next for npm?Check out our public roadmap! »

    bitshares-login

    1.0.11 • Public • Published

    Bitshares Login API

    Setup

    This library can be obtained through npm:

    npm install bitshares-login
    

    Usage

    Import

    import {BitShares} from 'bitshares-login';
    
    

    Setup defaults

    BitShares.init("https://openledger.io", "refcode", "referrer");
    
    

    Get Account

    BitSharesApi.connect("wss://bitshares.openledger.info/ws").then(() => {
          return BitSharesApi.api().account.getAccount("username").then(acc => {
            console.log(acc)
            BitSharesApi.close();
          }).catch(e => {
            throw ...
          })
        }).catch(e => console.log(e));
    

    Register new Account

    BitSharesApi.connect("wss://bitshares.openledger.info/ws").then(() => {
          return BitSharesApi.api().account.create("username", "password").then(acc => {
            console.log(acc)
            BitSharesApi.close();
          }).catch(e => {
            throw ...
          })
        }).catch(e => console.log(e));
    

    Login

    BitSharesApi.connect("wss://bitshares.openledger.info/ws").then(() => {
          return BitSharesApi.api().account.login("username", "password").then(acc => {
            console.log(acc)
            BitSharesApi.close();
          }).catch(e => {
            throw ...
          })
        }).catch(e => console.log(e));
    

    Install

    npm i bitshares-login

    DownloadsWeekly Downloads

    0

    Version

    1.0.11

    License

    MIT

    Unpacked Size

    86.4 kB

    Total Files

    29

    Last publish

    Collaborators

    • avatar