Key and signer management
- Source:
Members
(static, constant) assert
Wallet functions and state
- Source:
Methods
(static) createEncryptedAccount(creatorFunc) → {String|String|JSON|JSON}
Create an encrypted account.
Parameters:
Name | Type | Description |
---|---|---|
creatorFunc |
function |
a factory function with no parameters that returns an account as an Immutable Map, with possible extra leading bytes in the public key that can be safely ignored / sliced. |
- Source:
(static) createSignerEth(url, address)
Create a signer provider given the current URL and account. TODO: change democracy API to return the endpoint url from a config name
Parameters:
Name | Type | Description |
---|---|---|
url |
String |
the URL of an endpoint |
address |
String |
|
- Source:
(static) init(autoConfig, unlockSeconds)
Initialize the wallet.
Parameters:
Name | Type | Description |
---|---|---|
autoConfig |
boolean | |
unlockSeconds |
Number |
- Source:
(static) loadEncryptedAccount(address)
Retrieves encrypted account for this address from a (possibly remote) persistent store.
Parameters:
Name | Type | Description |
---|---|---|
address |
String |
|
- Source:
(static) pay(payAll, weiValue, fromAddress, toAddress, overage, label)
Transfer ETH between the given addresses, whose accounts have already been unlocked.
Parameters:
Name | Type | Description |
---|---|---|
payAll |
boolean |
whether to transfer all spendable value |
weiValue |
String |
the amount in wei to transfer (ignored if |
fromAddress |
String |
|
toAddress |
String |
|
overage |
String |
optional, the amount of fees to withhold if |
label |
String |
optional, a debug label to log for this transaction |
- Source:
(static) payTest(weiValue, fromAddress, toAddress)
Pay from a test account (that is already unlocked on the Ethereum node)
Parameters:
Name | Type | Description |
---|---|---|
weiValue |
String |
representing the value in wei |
fromAddress |
String |
Ethereum address of payer/sender |
toAddress |
String |
Ethereum address of recipient |
- Source:
(static) prepareSignerEth(address, password) → {String|String|Eth}
Convenience method to create a new account if no address/password is given,
otherwise load and unlock the given address
from the (remote) store. Finally create a signerEth with it.
Equivalent to calling
wallet.loadEncryptedAccount
, wallet.unlockEncryptedAccount
, wallet.createSignerEth
Parameters:
Name | Type | Description |
---|---|---|
address |
String |
|
password |
String |
password to unlock the given Ethereum account |
- Source:
(static) saveEncryptedAccount(address, encryptedAccount)
Saves the encrypted account to a (remote) store
Parameters:
Name | Type | Description |
---|---|---|
address |
String |
a |
encryptedAccount |
JSON |
geth-formatted key to save in a (remote) store |
- Source:
(static) unlockEncryptedAccount(address, password)
Unlock an encrypted account.
Parameters:
Name | Type | Description |
---|---|---|
address |
String |
|
password |
String |
to unlock the given account |
- Source: