0.1.18 • Published 5 years ago
sdagwallet.js v0.1.18
SDAGWallet.js
SDAG Wallet for Javascript Developers
Installation
npm i sdagwallet.js
Usage
Import
import Wallet from 'sdagwallet.js'
let wallet = new Wallet();
Auto configuration
wallet.autoConfigHub("mainnet"); // Using mainnet
wallet.autoConfigHub("testnet"); // Using testnet
Manual configuration
wallet.configHub("ws://10.168.3.131:6635");
Generate Mnemonic
wallet.generateMnemonic();
Login
await wallet.loginWithMnemonic(secret, password);
Keys
wallet.getAddress();
wallet.getPrivateKey(); // Extened Private Key
wallet.getPublicKey();
Getting Balance
await wallet.getBalance();
Getting History Txs
await wallet.getHistory();
Getting a Unit
await wallet.getUnit('AELe/VgaqoCJekPfVxd8huecW3g7n33ihFw1A3vVVPE=');
Sending Assets
await wallet.send({ to: 'E5UR2ISKQWT3HISO55SHQYGYTF5BLWV6', amount: 2, text: 'Hello world' });
Subscribe
wallet.onAssetMessage(msg => {});
wallet.watchAddress(addrs, msg => {});
License
GPL-3.0