LocalWallet
Extends:
libsimba-js Local Wallet implementation Stores the wallet as encrypted json within the browsers localstorage Wraps the [ethersjs]https://docs.ethers.io/ethers.js/html/ library.
Constructor Summary
Public Constructor | ||
public |
constructor(signingConfirmation: function) Use a wallet stored in the browsers local storage |
Method Summary
Public Methods | ||
public |
|
|
public |
generateWallet(passkey: string, progressCB: function): Promise |
|
public |
generateWalletFromEncryptedJson(json: string, passkey: string, progressCB: function): Promise Generate a wallet from a encrypted json (see [ethers docs]{@link https://docs.ethers.io/ethers.js/html/api-wallet.html?highlight=fromencryptedjson}) |
|
public |
generateWalletFromMnemonic(mnemonic: string, passkey: string, progressCB: function): Promise Generate a wallet from a mnemonic |
|
public |
generateWalletFromPrivateKey(key: string, passkey: string, progressCB: function): Promise Generate a wallet from an existing private key |
|
public |
getAddress(): Promise<string> |
|
public |
getEncryptedJson(passkey: string, progressCB: function): Promise<string> |
|
public |
The mnemonic phrase for this wallet, or null if the mnemonic is unknown. |
|
public |
unlockWallet(passkey: string, progressCB: function): Promise |
|
public |
|
Protected Methods | ||
protected |
|
Private Methods | ||
private |
cleanPayload(payload: Object): string |
Inherited Summary
From class Wallet | ||
public |
|
|
public abstract |
|
|
public abstract |
generateWallet(passkey: string): Promise |
|
public abstract |
getAddress(): Promise<string> |
|
public abstract |
unlockWallet(passkey: string): Promise |
|
public abstract |
|
|
protected abstract |
|
Public Constructors
public constructor(signingConfirmation: function) source
Use a wallet stored in the browsers local storage
Override:
Wallet#constructorParams:
Name | Type | Attribute | Description |
signingConfirmation | function |
|
|
Public Methods
public generateWallet(passkey: string, progressCB: function): Promise source
Override:
Wallet#generateWalletpublic generateWalletFromEncryptedJson(json: string, passkey: string, progressCB: function): Promise source
Generate a wallet from a encrypted json (see [ethers docs]{@link https://docs.ethers.io/ethers.js/html/api-wallet.html?highlight=fromencryptedjson})
public generateWalletFromMnemonic(mnemonic: string, passkey: string, progressCB: function): Promise source
Generate a wallet from a mnemonic
public generateWalletFromPrivateKey(key: string, passkey: string, progressCB: function): Promise source
Generate a wallet from an existing private key
public getMnemonic(): string source
The mnemonic phrase for this wallet, or null if the mnemonic is unknown.
public unlockWallet(passkey: string, progressCB: function): Promise source
Override:
Wallet#unlockWalletProtected Methods
protected sign(payload: Object): Promise<string> source
Override:
Wallet#signParams:
Name | Type | Attribute | Description |
payload | Object | The transaction to sign |