1.1.0 • Published 6 years ago

rpc-simple-wallet v1.1.0

Weekly downloads
43
License
ISC
Repository
-
Last release
6 years ago

RPC Simple Wallet

Uses a full node's wallet over RPC to send and receive. One wallet per address, designed for a single program to own a single bitocin address;

Configuration Environment Variables

Automatically checks for environment variables such as:

  • BCH_RPC_HOST
  • BCH_RPC_PORT
  • BCH_RPC_USER
  • BCH_RPC_PASSWORD

or

  • DASH_RPC_HOST
  • DASH_RPC_PORT
  • DASH_RPC_USER
  • DASH_RPC_PASSWORD

Installation

yarn add rpc-simple-wallet

USAGE

Your RPC node's wallet must maintain the private key to the address specified:

import { RPCSimpleWallet } from 'rpc-simple-wallet';

let account = 'Xxie51C2VsBC1bLUuWaCXKdJwEwtNzZPfU';

let wallet = new RPCSimpleWallet('DASH', account);

let balance = await wallet.getAddressUnspentBalance();

console.log('balance', balance);
import { RPCSimpleWallet } from 'rpc-simple-wallet';

let account = 'Xxie51C2VsBC1bLUuWaCXKdJwEwtNzZPfU'

let wallet = new RPCSimpleWallet('DASH', account);

let balance = await wallet.getAddressUnspentBalance();

let payment = await wallet.sendToAddress(destination, parseFloat(balance * 0.1));

console.log('payment', payment);
1.1.0

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

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