JavaScript access to the blockchain

parseAddress()

This chapter describes a helper function to take user input and convert it to a bitcoin-script-hash which is used by the Flowee APIs.

Where the name Flowee is used, this is the variable which results from a call similar to:

const FloweeServices = require('floweejs');
var Flowee = new FloweeServices();

Function

Flowee.parseAddress()

Parameters

  • address
    We accept:

    1. P2PKH or P2SH type addresses.
    2. Bitcoincash style addresses (typically starting with q) or the legacy btc style (typically starting with 1).
    3. a string of hex characters signifying the bitcoin-cash-script hash.
  • prefix (optional)
    Addresses that are for testnet have a different prefix, you can pass the prefix here.

Return-value

The hash (32 bytes) over the entire output script. This can be used in the Flowee APIs.