1.0.12 • Published 10 months ago

redbelly-wallet-js v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Redbelly Wallet JS

A JavaScript library for interacting with Redbelly blockchain wallets.

Installation

npm install redbelly-wallet-js

Usage

const RedbellyWallet = require('redbelly-wallet-js');
const network = 'DEVNET'; // or 'TESTNET' or 'MAINNET'
const wallet = new RedbellyWallet(network);
// Create a new wallet from mnemonic
const mnemonic = 'your twelve word mnemonic phrase here';
wallet.createWalletFromMnemonic(mnemonic)
.then(account => console.log(account))
.catch(error => console.error(error));
// Get balance
wallet.getBalance('0x1234567890123456789012345678901234567890')
.then(balance => console.log(balance))
.catch(error => console.error(error));
// Send transaction
const privateKey = 'your private key here';
const toAddress = '0x1234567890123456789012345678901234567890';
const amount = 1.5; // in Ether
wallet.sendTransaction(privateKey, toAddress, amount)
.then(receipt => console.log(receipt))
.catch(error => console.error(error));

License

MIT

1.0.12

10 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago