Module: lib/blockchains/ethereum

Module to use Ethereum as underlying blockchain for Whiteflag

Source:
Tutorials:

Methods

(inner) createAccount(privateKeyopt, callback)

Creates a new Ethereum blockchain account

Parameters:
Name Type Attributes Description
privateKey string <optional>

hexadecimal encoded private key

callback blockchainCreateAccountCb

function to be called upon completion

Source:

(inner) deleteAccount(address, callback)

Deletes Ethereum blockchain account

Parameters:
Name Type Description
address string

the address of the account to be deleted

callback blockchainDeleteAccountCb

function to be called upon completion

Source:

(inner) getBinaryAddress(address, callback)

Returns an Ethereum address in binary encoded form

Parameters:
Name Type Description
address string

the blockchain address

callback blockchainBinaryAddressCb

function to be called upon completion

Source:

(inner) getMessage(wfQuery, callback)

Performs a simple query to find a message on Ethereum by transaction hash

Parameters:
Name Type Description
wfQuery Object

the property of the transaction to look up

callback blockchainLookupMessageCb

function to be called after Whiteflag message lookup

Source:

(inner) initEthereum(ethConfig, callback)

Initialises the Ethereum blockchain

Parameters:
Name Type Description
ethConfig Object

the blockchain configuration

callback blockchainInitCb

function to be called after intitialising Ethereum

Source:

(inner) requestKeys(publicKey, callback)

Requests the Ethereum address and correctly encoded public key of an originator

Parameters:
Name Type Description
publicKey string

the raw hex public key of the originator

callback blockchainRequestKeysCb

function to be called upon completion

Source:

(inner) requestSignature(payload, callback)

Requests a Whiteflag signature for a specific Ethereum address

Parameters:
Name Type Description
payload wfSignaturePayload

the JWS payload for the Whiteflag signature

callback blockchainRequestSignatureCb

function to be called upon completion

Source:

(inner) sendMessage(wfMessage, callback)

Sends an encoded message on the Ethereum blockchain

Parameters:
Name Type Description
wfMessage wfMessage

the Whiteflag message to be sent on Ethereum

callback blockchainSendMessageCb

function to be called after sending Whiteflag message

Source:

(inner) transferFunds(transfer, callback)

Transfers ether from one Ethereum address to an other address

Parameters:
Name Type Description
transfer Object

the object with the transaction details to transfer funds

callback blockchainTransferValueCb

function to be called upon completion

Source:

(inner) updateAccount(account, callback)

Updates Ethereum blockchain account attributes

Parameters:
Name Type Description
account Object

the account information including address to be updated

callback blockchainUpdateAccountCb

function to be called upon completion

Source: