https://github.com/reforest/fungus
Client-side JavaScript SDK to read/write wallets and transactions to Lotion-based coin
https://github.com/reforest/fungus
blockchain cosmos lotionjs mit-license opensource tendermint transaction wallets web3
Last synced: about 1 year ago
JSON representation
Client-side JavaScript SDK to read/write wallets and transactions to Lotion-based coin
- Host: GitHub
- URL: https://github.com/reforest/fungus
- Owner: reforest
- License: mit
- Created: 2018-04-07T21:24:12.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-09T03:26:07.000Z (about 8 years ago)
- Last Synced: 2024-10-29T03:32:16.361Z (over 1 year ago)
- Topics: blockchain, cosmos, lotionjs, mit-license, opensource, tendermint, transaction, wallets, web3
- Language: JavaScript
- Homepage:
- Size: 504 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fungus
Client-side JavaScript SDK to read/write wallets and transactions to Basecoin

## Usage
```javascript
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
```bash
npm run example
```