Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 6 days 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 (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-09T03:26:07.000Z (over 6 years ago)
- Last Synced: 2024-08-08T21:52:05.930Z (3 months 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
![Stack Diagram](https://github.com/reforest/fungus/blob/master/images/Screen%20Shot%202018-04-08%20at%207.58.34%20PM.png?raw=true)
## 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
```