Module: lib/blockchains/

Module to use the Fennel parachain as underlying blockchain for Whiteflag

Source:
Tutorials:

Methods

(inner) createAccount(seedopt, callback)

Creates a new Fennel blockchain account

Parameters:
Name Type Attributes Description
seed string <optional>

hexadecimal encoded secret seed

callback bcAccountCb

function called on completion

Source:

(inner) deleteAccount(fnlAddress, callback)

Deletes Fennel blockchain account

Parameters:
Name Type Description
fnlAddress string

the address of the account to be deleted

callback bcAccountCb

function called on completion

Source:

(inner) getBinaryAddress(fnlAddress, callback)

Returns a Fennel address in binary encoded form

Parameters:
Name Type Description
fnlAddress string

the Fennel blockchain address

callback bcBinaryAddressCb

function called on completion

Source:

(inner) getMessage(wfQuery, callback)

Performs a simple query to find a message by transaction hash

Parameters:
Name Type Description
wfQuery Object

the property of the transaction to look up

callback bcGetMessageCb

function called after Whiteflag message lookup

Source:
To Do:
  • Implement function

(inner) initFennel(callback)

Initialises configured blockchains

Parameters:
Name Type Description
callback bcInitCb

function called after intitialising the blockchain

Source:

(inner) requestSignature(wfSignPayload, callback)

Requests a Whiteflag signature for a specific Fennel address

Parameters:
Name Type Description
wfSignPayload wfSignPayload

the JWS payload for the Whiteflag signature

callback authRequestSignatureCb

function called on completion

Source:

(inner) scanBlocks(firstBlock, lastBlock, callback)

Scans a number of blocks for Whiteflag messages

Parameters:
Name Type Description
firstBlock number

the starting block

lastBlock number

the ending block

callback bcScanBlocksCb

function called on completion

Source:

(inner) sendMessage(wfMessage, callback)

Sends an encoded message on the blockchain

Parameters:
Name Type Description
wfMessage wfMessage

the Whiteflag message to be sent on the blockchain

callback bcSendMessageCb

function called after sending Whiteflag message

Source:

(inner) transferFunds(transfer, callback)

Transfers fennel from one Fennel address to an other address

Parameters:
Name Type Description
transfer wfTransfer

the transaction details for the funds transfer

callback bcSendTransactionCb

function called on completion

Source:

(inner) updateAccount(account, callback)

Updates Fennel blockchain account attributes

Parameters:
Name Type Description
account wfAccount

the account information including address to be updated

callback bcAccountCb

function called on completion

Source:

(inner) verifySignature(wfSignature, fnlAddress, fnlPublicKey, callback)

Verifies a Whiteflag signature for the Fennel blockchain

Parameters:
Name Type Description
wfSignature wfSignature

the Whiteflag authentication signature

fnlAddress string

the address of the Whiteflag signature

fnlPublicKey string

the raw hex public key of the originator

callback authVerifySignatureCb

function called on completion

Source: