JavaScript access to the blockchain

FloweeJS enums

Flowee filters (Include) enum

In Flowee transactions can be downloaded from the server. There are two approaches to this concept. The blunt-force version that wastes bandwidth and memory is to simply download the entire transaction. This gives you a bytearray which you then need some library for to understand and parse.

The much more elegant way of getting your transaction data is using filters. You request certain parts of a transaction and the server will interpret the transaction and send you the data you are asking for. For instance you may only want the amount of Bitcoin Cash paid in a transaction, in which case you filter on Flowee.IncludeOutputAmounts and you receive an actual number for each output in the transaction.

The normal usage is to have an array and add those filters you need. Please note that there are some “group” filters. For instance the IncludeOutputs option is the same as the combination of the next two.

  • Flowee.IncludeOffsetInBlock
    Fetch the offset, in bytes, in a block of the transaction. Flowee the Hub regards a blockheight with this offset as a key for a specific transaction in the chain.
  • Flowee.IncludeInputs
    Include all inputs for the transaction.
  • Flowee.IncludeTxId
    Include the transaction-id hash.
  • Flowee.IncludeFullTxData
    This includes a byte-array of the raw transaction data.
  • Flowee.IncludeOutputs
    Include all properties of outputs. This is the same as setting the next 2 properties.
  • Flowee.IncludeOutputAmounts
    Include, for each output, the amount paid to it.
  • Flowee.IncludeOutputScripts
    Include, for each output, the full bitcoin-script.
  • Flowee.IncludeOutputAddresses (p2pkh only!) Instead of a script, include the p2pkh address we paid to, if any. Notice that this only works for pay-to-public-key-hash (P2PKH) type of outputs. Is ignored for other types.
  • Flowee.IncludeOutputScriptHash
    This returns a constant-length hash for the outputscript. This works for 100% of the output-types and thus is good for generic usage and you will be able to use this for instance in the Address Monitor where we call it BitcoinScriptHash.

Flowee.Job type enum

This enum is used by the Search function.

  • Flowee.Job.FetchTx
    Fetch a single transaction. The argument should be one of the below two options. In the case of providing a txid the framework will auto-replace this job with a LookupTxById and a new FetchTx.
    1) value: blockheight, value2: offset-in-block.
    2) value: TXID
  • Flowee.Job.FetchBlockHeader
    Fetches a list of meta-data about a block. The value should either be a blockheight or the block-hash.
  • Flowee.Job.FetchBlockOfTx
    Fetches a block of transactions based on the blockheight or the block-hash.
  • Flowee.Job.LookupTxById
    Use the Indexer to resolve a transaction-id hash to the key that the Hub uses. Returns the blockheight and offset-in-block.
  • Flowee.Job.LookupByAddress
    Fetches which transactions deposited funds in the specified address. The value here can be a legacy address, a bitcoin cash address or a sha256 hash of the output script.
  • Flowee.Job.LookupSpentTx
    Fetches a specific output of a transaction which spent it (if any). This is effectively the mirror functionality of the UTXO lookups. The “value” property should be a transaction-id and the value2 property should be set to the output of the creation transaction.
  • Flowee.Job.FetchUTXOUnspent
    Fetches a simple yes/no if a transaction output is unspent. Is the faster and cheaper version of the following option. The “value” property should be a transaction-id and the value2 property should be set to the output of the creation transaction.
  • Flowee.Job.FetchUTXODetails
    This is almost the same as the FetchUTXOUnspent, except that this one returns also the amount that was deposited in this output as well as the script which locks it.
  • Flowee.Job.FindAddressInMempool
    Limiting the search to the mempool, find transactions matching an address and based on your filters return it.
  • Flowee.Job.FindTxInMempool
    Find a transaction by transaction-id in the mempool only. And based on your filters return the result.