Flowee the Hub — API documentation

Service/Indexer

Indexer Service

Indexer is a service provided by the server of the same name. It operates on a different internet port (1234) and might run on a different IP address than the Hub.

Read more in the Indexer intro.

Messages

GetAvailableIndexers,

Indexer. sId=19 mId=0

GetAvailableIndexersReply

Indexer. sId=19 mId=1
AddressIndexer: 21booleanincluded (true) if available
TxIdIndexer 22booleanincluded (true) if available
SpentOutputIndexer 23booleanincluded (true) if available

FindTransaction

You can only ask for a transaction if the txid indexer is enabled.

Indexer. sId=19 mId=2
TxId: 4bytearray32-byte transaction hash

FindTransactionReply

Indexer. sId=19 mId=3
BlockHeight: 7natural-numberHeight of the block in the chain.
OffsetInBlock: 8natural-numberKey useful for BlockChain::GetTransaction

FindAddress

You can only ask about an address if the address indexer is enabled.

The indexer works on output-script-hash. The sha256 (single) hashing of the entire output script. You can use the BitcoinScriptHashed (32-byte) flag for such.

Additionally we support a simple p2pkh based bitcoin address. This is the ripe160 hash of the public key, which is the type of addresses most payments are made to. The indexer will convert this to a script-hash for you. Use the BitcoinP2PKHAddress tag for this.

Most user-interaction uses some encoding, base58 or cash-address are two examples. This API is not meant to be user-facing and we expect the string-based address to be decoded before using this API.

Please note that only the first hash or address found in the request is used to find data. The rest of the message is ignored.

Indexer. sId=19 mId=4
BitcoinP2PKHAddress: 2bytearray20-byte ripe160 hash
BitcoinScriptHashed: 9sha256sha256 (single) hash of the script-out (32 bytes)

FindAddressReply

The reply will list a combination of blockheight, offset in block (which together identifies one single transaction) and output-index.

The triplets will be separated by a Separator item.

Indexer. sId=19 mId=5
separator: 0boolindicator that next value will follow
BlockHeight: 7natural-numberHeight of the block in the chain.
OffsetInBlock: 8natural-numberKey useful for BlockChain::GetTransaction
output-index: 20natural-number(zero base) index of output in tx

FindSpentOutput

You can only ask about a spent txid when the spentOutputDB is enabled on the indexer.

This call takes a transaction-id and output-index and returns the transaction that spent it.

In case the spender is not found, a blockheight of -1 is returned. See FindSpentOutputReply

Indexer. sId=19 mId=6
TxId: 4bytearray32-byte transaction hash
output-index: 20natural-number(zero base) index of output in tx

FindSpentOutputReply

You can only ask about a spent txid when the spentOutputDB is enabled on the indexer.

In case the spender is not found, a blockheight of -1 is returned. See FindSpentOutputReply

Indexer. sId=19 mId=7
BlockHeight: 7natural-numberHeight of the block in the chain.
OffsetInBlock: 8natural-numberKey