bitcoinlib.services.bitcoinlibtest module

class bitcoinlib.services.bitcoinlibtest.BitcoinLibTestClient(network, base_url, denominator, *args)[source]

Bases: bitcoinlib.services.baseclient.BaseClient

Dummy service client for bitcoinlib test network. Only used for testing.

Does not make any connection to a service provider, so can be used offline.

blockcount()[source]
estimatefee(blocks)[source]

Dummy estimate fee method for the bitcoinlib testnet.

Parameters

blocks (int) – Number of blocks

Return int

Fee as 100000 // number of blocks

getbalance(addresslist)[source]

Dummy getbalance method for bitcoinlib testnet

Parameters

addresslist (list) – List of addresses

Return int

getutxos(address, after_txid='', limit=10, utxos_per_address=2)[source]

Dummy method to retreive UTXO’s. This method creates a new UTXO for each address provided out of the testnet void, which can be used to create test transactions for the bitcoinlib testnet.

Parameters
  • address (str) – Address string

  • after_txid (str) – Transaction ID of last known transaction. Only check for utxos after given tx id. Default: Leave empty to return all utxos. If used only provide a single address

  • limit (int) – Maximum number of utxo’s to return

Return list

The created UTXO set

mempool(txid='')[source]
sendrawtransaction(rawtx)[source]

Dummy method to send transactions on the bitcoinlib testnet. The bitcoinlib testnet does not exists, so it just returns the transaction hash.

Parameters

rawtx (bytes, str) – A raw transaction hash

Return str

Transaction hash