1.1.0 • Published 5 years ago

rpc-simple-wallet v1.1.0

Weekly downloads
43
License
ISC
Repository
-
Last release
5 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

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago