1.0.11 • Published 7 years ago

reforest-fungus v1.0.11

Weekly downloads
6
License
MIT
Repository
github
Last release
7 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

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago