@docknetwork/wallet-sdk-wasm

1.4.0 • Public • Published

Dock Wallet SDK

The Dock Wallet SDK provides all the required functions to build a PolkaDot Wallet on top of a Universal Wallet 2020 document storage. It supports both Node.js and React Native.

For React Native usage please check @docknetwork/wallet-sdk-react-native

This is the core package and includes basic functionalities such as:

  • Document storage following Universal Wallet 2020 spec
  • Manage a wallet (CRUD)
  • Manage accounts (CRUD)
  • Fetch account balances
  • Wallet/Account backup
  • Import wallet/accounts

You might require to install extra packages depending on your needs, please refer to:

Installation

yarn add @docknetwork/wallet-sdk-core

React Native Example

import {Wallet} from '@docknetwork/wallet-sdk-core/lib/modules/wallet';

const wallet = await Wallet.create();

const account1 = await wallet.accounts.create({
  name: 'test',
});

console.log(`Account1 address ${account1.address}`);
// result: Account1 address 3D1M9UnR684eBfVujjQr6ucPqvXERSxYxcVBFGAhRohhRXxq

// Create account using an existing mnemonic
const mnemonic =
  'indicate mention thing discover clarify grief inherit vivid dish health market spoil';
const account2 = await wallet.accounts.create({
  name: 'Test',
  mnemonic,
});

console.log(`Account2 address ${account2.address}`);

// result: Account2 address 3FENesfZgFmBruv2H9Hc17GmobeTfxFAp8gHKXFmUtA38hcW

// Fetch accounts balance
const balance = await account1.getBalance();

console.log('Account1 balance', balance);

// result: Account1 balance 0

Readme

Keywords

none

Package Sidebar

Install

npm i @docknetwork/wallet-sdk-wasm

Weekly Downloads

118

Version

1.4.0

License

https://github.com/docknetwork/react-native-sdk/LICENSE

Unpacked Size

2.37 MB

Total Files

578

Last publish

Collaborators

  • mayconmello
  • mikeatdock
  • samdock
  • lovesh_h