Module: lib/blockchains/ethereum/accounts

Module for managing Ethereum accounts for Whiteflag

Source:
Source:

Methods

(inner) createAccount(privateKeyopt) → {Promise}

Creates a new Ethereum blockchain account

Parameters:
Name Type Attributes Description
privateKey string <optional>

hexadecimal encoded private key

Source:
Returns:

resolves to newly created account

Type
Promise

(inner) deleteAccount(address) → {Promise}

Deletes Ethereum blockchain account

Parameters:
Name Type Description
address string

the address of the account to be deleted

Source:
Returns:

resolves to updated account

Type
Promise

(inner) formatAddressApi() → {string}

Ensures that addresses are in generic api format

Source:
Returns:

The Ethereum address without 0x hex prefix

Type
string

(inner) formatHexApi() → {string}

Ensures that keys are in generic api format

Source:
Returns:

The Ethereum key without 0x hex prefix

Type
string

(inner) formatHexEthereum() → {string}

Ensures that addresses and keys are in Ethereum format

Source:
Returns:

The Ethereum address or key with the 0x hex prefix

Type
string

(inner) formatPubkeyApi() → {string}

Ensures that public keys are in generic api format

Source:
Returns:

The Ethereum public key without 0x hex prefix but with prefix byte

Type
string

(inner) getAccount(address) → {Promise}

Gets Ethereum account from the blockchain state by address

Parameters:
Name Type Description
address string

the account address

Source:
Returns:

resolves to the requested account

Type
Promise

(inner) initAccounts(ethConfig, ethState, web3) → {Promise}

Initialises Ethereum accounts management

Parameters:
Name Type Description
ethConfig Object

the Ethereum blockchain configuration

ethState Object

the Ethereum blockchain state

web3 Object

the Ethereum Web3 instance

Source:
Returns:

resolve if succesfully initialised

Type
Promise

(inner) updateAccount(account) → {Promise}

Updates Ethereum blockchain account attributes

Parameters:
Name Type Description
account Object

the account information including address to be updated

Source:
Returns:

resolves to updated account

Type
Promise

Module for common functions used by all Ethereum wub-modules

Source:
Source:

Methods

(inner) createAccount(privateKeyopt) → {Promise}

Creates a new Ethereum blockchain account

Parameters:
Name Type Attributes Description
privateKey string <optional>

hexadecimal encoded private key

Source:
Returns:

resolves to newly created account

Type
Promise

(inner) deleteAccount(address) → {Promise}

Deletes Ethereum blockchain account

Parameters:
Name Type Description
address string

the address of the account to be deleted

Source:
Returns:

resolves to updated account

Type
Promise

(inner) formatAddressApi() → {string}

Ensures that addresses are in generic api format

Source:
Returns:

The Ethereum address without 0x hex prefix

Type
string

(inner) formatHexApi() → {string}

Ensures that keys are in generic api format

Source:
Returns:

The Ethereum key without 0x hex prefix

Type
string

(inner) formatHexEthereum() → {string}

Ensures that addresses and keys are in Ethereum format

Source:
Returns:

The Ethereum address or key with the 0x hex prefix

Type
string

(inner) formatPubkeyApi() → {string}

Ensures that public keys are in generic api format

Source:
Returns:

The Ethereum public key without 0x hex prefix but with prefix byte

Type
string

(inner) getAccount(address) → {Promise}

Gets Ethereum account from the blockchain state by address

Parameters:
Name Type Description
address string

the account address

Source:
Returns:

resolves to the requested account

Type
Promise

(inner) initAccounts(ethConfig, ethState, web3) → {Promise}

Initialises Ethereum accounts management

Parameters:
Name Type Description
ethConfig Object

the Ethereum blockchain configuration

ethState Object

the Ethereum blockchain state

web3 Object

the Ethereum Web3 instance

Source:
Returns:

resolve if succesfully initialised

Type
Promise

(inner) updateAccount(account) → {Promise}

Updates Ethereum blockchain account attributes

Parameters:
Name Type Description
account Object

the account information including address to be updated

Source:
Returns:

resolves to updated account

Type
Promise