Skip to content

smart-dag/sdagwallet.js

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors