1.0.11 • Published 6 years ago

reforest-fungus v1.0.11

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

fungus

Client-side JavaScript SDK to read/write wallets and transactions to Basecoin

Usage

import Fungus from 'reforest-fungus';
const fungus = new Fungus({
    lotionUrl: 'localhost:3000' // Ensure lotion is running on port 3000
})

const privateKey = fungus.generatePrivateKey().toString('hex');
const address = fungus.createPublicKey(privateKey).toString('hex');
let balance; 

fungus.getBalance(address).then(b=>{
    balance = b;
    console.log(balance);
}).catch(err=>{
    console.error(err);
})

// save it savely somewhere, for example(bad)
localStorage.setItem('privateKey', privateKey);

API

  • generatePrivateKey
  • createPublicKey
  • getBalance
  • createTransaction
  • getAllTransactions

Running example

npm run example
1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago