wallet

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

0x-prefixed Ethereum address of sender

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

0x-prefixed Ethereum address associated with desired account.

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 payAll is true)

fromAddress String

0x-prefixed Ethereum address of sender

toAddress String

0x-prefixed Ethereum address of receiver

overage String

optional, the amount of fees to withhold if payAll is true)

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

0x-prefixed Ethereum address to create a signer around

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 0x-prefixed Ethereum address associated with this account

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

0x-prefixed Ethereum address associated with account to unlock

password String

to unlock the given account

Source: