zpywallet.fees.btc package

Submodules

zpywallet.fees.btc.blockcypher module

class BlockcypherFeeEstimator(request_interval=(3, 1), api_key=None)[source]

Bases: object

A class representing a Bitcoin fee rate estimator using Blockcypher.

__init__(request_interval=(3, 1), api_key=None)[source]

Initializes an instance of the BlockcypherFeeEstimator class.

Parameters:
  • request_interval (tuple) – A pair of integers indicating the number of requests allowed during a particular amount of seconds. Set to (0, N) for no rate limiting, where N > 0.

  • api_key (str) – The API key for accessing the Blockcypher API.

get_fee_rate()[source]

Retrieves the current fee rate for Bitcoin transactions.

Raises:

NetworkException – If the API request fails or the fee rate cannot be retrieved

zpywallet.fees.btc.blockstream module

class BlockstreamFeeEstimator(request_interval=(3, 1), transactions=None)[source]

Bases: EsploraFeeEstimator

A class representing a Bitcoin fee rate estimator using Blockstream.

zpywallet.fees.btc.earndotcom module

class EarnDotComFeeEstimator(request_interval=(1000, 1))[source]

Bases: object

A class representing a Bitcoin fee rate estimator using Earn.com.

__init__(request_interval=(1000, 1))[source]

Initializes an instance of the EarnDotComFeeEstimator class.

Parameters:

request_interval (tuple) – A pair of integers indicating the number of requests allowed during a particular amount of seconds. Set to (0, N) for no rate limiting, where N > 0.

get_fee_rate()[source]

Retrieves the current fee rate for Bitcoin transactions.

Raises:

NetworkException – If the API request fails or the fee rate cannot be retrieved

zpywallet.fees.btc.esplora module

class EsploraFeeEstimator(request_interval=(3, 1), **kwargs)[source]

Bases: object

A class representing a Bitcoin fee rate estimator using Esplora.

__init__(request_interval=(3, 1), **kwargs)[source]

Initializes an instance of the EsploraFeeEstimator class.

Parameters:

request_interval (tuple) – A pair of integers indicating the number of requests allowed during a particular amount of seconds. Set to (0, N) for no rate limiting, where N > 0.

get_fee_rate()[source]

Retrieves the current fee rate for Bitcoin transactions.

Raises:

NetworkException – If the API request fails or the fee rate cannot be retrieved

zpywallet.fees.btc.fullnode module

class BitcoinRPCClient(**kwargs)[source]

Bases: object

A class representing a Bitcoin fee rate estimator using full nodes.

get_fee_rate(blocks=6)[source]

Get fee rate estimate for a target number of blocks.

Parameters:

blocks (int) – Target number of blocks for fee rate estimation.

Returns:

Fee rate in satoshis per virtual byte.

Return type:

float

zpywallet.fees.btc.loadbalancer module

class BitcoinFeeEstimator(**kwargs)[source]

Bases: object

A class representing a Bitcoin fee rate estimator.

Developers should use this class, because it autoselects the most stable providers to fetch data from.

get_fee_rate()[source]

Gets the network fee rate.

Returns:

The network fee rate.

Return type:

int

Raises:

Exception – If none of the fee providers are working after the specified number of tries.

zpywallet.fees.btc.mempoolspace module

class MempoolSpaceFeeEstimator(request_interval=(3, 1), transactions=None)[source]

Bases: EsploraFeeEstimator

A class representing a Bitcoin fee rate estimator using Mempool.space.

Module contents