# sdagwallet.js

> SDAG Wallet

Latest version **0.1.18** (published 2019-07-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install sdagwallet.js
pnpm add sdagwallet.js
yarn add sdagwallet.js
bun add sdagwallet.js
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.18 |
| Published | 2019-07-03 |
| First published | 2019-03-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8.9 |
| Dependencies | 2 |
| Unpacked size | 42.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | sdag |

## Links

- npm: https://www.npmjs.com/package/sdagwallet.js
- Repository: https://github.com/smart-dag/sdagwallet.js
- Homepage: https://github.com/smart-dag/sdagwallet.js#readme
- Issues: https://github.com/smart-dag/sdagwallet.js/issues
- npm.io page: https://npm.io/package/sdagwallet.js

## Dependencies (2)

- [bip39](https://npm.io/package/bip39.md) ^2.6.0
- [sdag.js](https://npm.io/package/sdag.js.md) ^0.2.22

## Recent versions

- 0.1.18 (latest) — 2019-07-03
- 0.1.17 — 2019-06-03
- 0.1.16 — 2019-06-03
- 0.1.15 — 2019-05-30
- 0.1.13 — 2019-04-22
- 0.1.12 — 2019-04-17
- 0.1.11 — 2019-04-04
- 0.1.10 — 2019-04-03
- 0.1.9 — 2019-04-02
- 0.1.6 — 2019-03-15
- 0.1.5 — 2019-03-15
- 0.1.4 — 2019-03-07
- 0.1.3 — 2019-03-07
- 0.1.2 — 2019-03-05
- 0.1.1 — 2019-03-05
- … 1 more at https://npm.io/package/sdagwallet.js/versions

## README

# SDAGWallet.js

SDAG Wallet for Javascript Developers

## Installation

```
npm i sdagwallet.js
```

## Usage

#### Import

```javascript
import Wallet from 'sdagwallet.js'

let wallet = new Wallet();
```

#### Auto configuration

```javascript
wallet.autoConfigHub("mainnet"); // Using mainnet
wallet.autoConfigHub("testnet"); // Using testnet
```

#### Manual configuration
```javascript
wallet.configHub("ws://10.168.3.131:6635");
```

#### Generate Mnemonic

```javascript
wallet.generateMnemonic();
```

#### Login

```javascript
await wallet.loginWithMnemonic(secret, password);
```

#### Keys

```javascript
wallet.getAddress();
wallet.getPrivateKey(); // Extened Private Key
wallet.getPublicKey();
```

#### Getting Balance

```javascript
await wallet.getBalance();
```

#### Getting History Txs

```javascript
await wallet.getHistory();
```

#### Getting a Unit

```javascript
await wallet.getUnit('AELe/VgaqoCJekPfVxd8huecW3g7n33ihFw1A3vVVPE=');
```

#### Sending Assets

```javascript
await wallet.send({ to: 'E5UR2ISKQWT3HISO55SHQYGYTF5BLWV6', amount: 2, text: 'Hello world' });
```

#### Subscribe
```javascript
wallet.onAssetMessage(msg => {});
wallet.watchAddress(addrs, msg => {});
```

## License

GPL-3.0

---
_Source: https://npm.io/package/sdagwallet.js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
