Module: lib/blockchains/bitcoin/transactions

Module to process Bitcoin transactions for Whiteflag

Source:

Methods

(inner) extractMessage(transaction, blockNumber, timestamp) → {Promise}

Extracts Whiteflag message from Bitcoin transaction data

Parameters:
Name Type Description
transaction Object
blockNumber number

the block number

timestamp number

the block or transaction time

Source:
Returns:

resolves to a Whiteflag message

Type
Promise

(inner) initTransactions(bcConfig, bcState) → {Promise}

Initialises Bitcoin transactions processing

Parameters:
Name Type Description
bcConfig Object

the Bitcoin blockchain configuration

bcState Object

the Bitcoin blockchain state

Source:
Returns:

resolves if completed

Type
Promise

(inner) sendTransaction(account, toAddress, amount, data) → {Promise}

Sends an transaction with an embedded Whiteflag message on the Bitcoin blockchain

Parameters:
Name Type Description
account Object

the account used to send the transaction

toAddress string

the address to send the transaction to

amount string

the amount of funds to be transfered with the transaction

data Buffer

the data to be embedded in the OP_RETURN of the transaction

Source:
Returns:

resolves to transaction hash

Type
Promise