bitcoinwatcher 2.11b1__py3-none-any.whl → 2.11b2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,7 @@ class BitcoinRPCAddressDataExtractor(AbstractTxAddressDataExtractor):
20
20
  def fetch_all_inputs(self, inputs):
21
21
  unique_txids = list(set([input.prev_txid.hex() for input in inputs]))
22
22
  rpc_calls = [["getrawtransaction", tx_id, True] for tx_id in unique_txids]
23
- data = self.bitcoinrpc.rpc_connection.batch_(rpc_calls)
23
+ data = self.bitcoinrpc.get_new_connection().batch_(rpc_calls)
24
24
  tx_id_to_data = {tx_id: current_tx for tx_id, current_tx in zip(unique_txids, data)}
25
25
  list_of_vouts = []
26
26
  for input in inputs:
@@ -13,15 +13,17 @@ class BitcoinRPC:
13
13
  rpc_port = os.environ.get("RPC_PORT", 8332)
14
14
 
15
15
  def __init__(self):
16
- rpc_string = f"http://{self.rpc_user}:{self.rpc_password}@{self.rpc_host}:{self.rpc_port}"
17
- self.rpc_connection = AuthServiceProxy(rpc_string)
16
+ self.rpc_string = f"http://{self.rpc_user}:{self.rpc_password}@{self.rpc_host}:{self.rpc_port}"
17
+
18
+ def get_new_connection(self):
19
+ return AuthServiceProxy(self.rpc_string)
18
20
 
19
21
  def get_transaction(self, txid: str) -> dict:
20
- return self.rpc_connection.getrawtransaction(txid, True)
22
+ return self.get_new_connection().getrawtransaction(txid, True)
21
23
 
22
24
  def is_confirmed(self, txid: str) -> bool:
23
25
  try:
24
- self.rpc_connection.getmempoolentry(txid)
26
+ self.get_new_connection().getmempoolentry(txid)
25
27
  return False
26
28
  except JSONRPCException as e:
27
29
  return True
@@ -30,10 +32,11 @@ class BitcoinRPC:
30
32
  if __name__ == '__main__':
31
33
  logger = get_logger(__name__)
32
34
  rpc = BitcoinRPC()
33
- txid = '686d025f16d9f20353665a9d865e575e3e4d14214f6f7045149a17dd6bf0fac6'
35
+ txid = '775c85bb56a3fc86bf6b100a1e9ff54b6d4dcc3670fb76f98365d99a32c18e53'
34
36
  try:
35
37
  ctx_tx.set('686d025f16d9f20353665a9d865e575e3e4d14214f6f7045149a17dd6bf0fac6')
36
38
  ctx_tx_status.set('confirmed')
39
+ tx_data = rpc.get_transaction(txid)
37
40
  logger.info("Transaction is confirmed")
38
41
  except JSONRPCException as e:
39
42
  print(f"An error occurred: {e}")
@@ -1,2 +1,2 @@
1
- default_host = "192.168.29.108"
1
+ default_host = "192.168.1.105"
2
2
  default_port = 28333
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: bitcoinwatcher
3
- Version: 2.11b1
3
+ Version: 2.11b2
4
4
  Summary: bitcoinwatcher is a Python library that implements a ZMQ subscriber and provides abstractions to build custom address watchers. This library is designed to make it easy for developers to monitor Bitcoin addresses and react to changes in their state.
5
5
  Author: twosatsmaxi
6
6
  License: Apache License
@@ -230,6 +230,7 @@ Requires-Dist: pyzmq==25.1.2
230
230
  Requires-Dist: python-bitcoinrpc==1.0
231
231
  Requires-Dist: pytz~=2024.2
232
232
  Requires-Dist: colorlog~=6.9.0
233
+ Dynamic: license-file
233
234
 
234
235
  # bitcoinwatcher
235
236
 
@@ -12,7 +12,7 @@ bitcoin/tests/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
12
12
  bitcoin/tests/data/transactions.py,sha256=qIX9seGYguQ1lvLOCF8oe3NQhMJZP0SsBmz1iFbszhg,396279
13
13
  bitcoin/tx_extractors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  bitcoin/tx_extractors/abstract_extractor.py,sha256=YLnuqc3jva15NpOX8xV4oB5PEXc6rXbG8Lx0cBXW66s,291
15
- bitcoin/tx_extractors/bitcoin_rpc.py,sha256=vIRCc36vulk5cwKVVkEKAMJ8S82Gx_HJK7ePx3AjpOs,3317
15
+ bitcoin/tx_extractors/bitcoin_rpc.py,sha256=00rAn1wtuvTmJMws4VfJWUv_Mf5WEe4eKbOGEtBjTQY,3323
16
16
  bitcoin/tx_extractors/default.py,sha256=KLT0EIbrp9yzFTQ-U5JRGI4ACHkvEMmycdXQGoPRU20,1509
17
17
  bitcoin/tx_extractors/mempool.py,sha256=mPPY1GOvBmZWn7UVP2sUaXtfcyeTCj-LmRDl2F4WhC8,2090
18
18
  bitcoin/tx_listener/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -20,13 +20,13 @@ bitcoin/tx_listener/abstract_tx_listener.py,sha256=rGp9na-aOSl_aPaIqf44RTZaFF3Sv
20
20
  bitcoin/tx_listener/zmq_listener.py,sha256=X3R-DwC2e_V_28WQZcThKuoAhT4_0QOscsrDTV_aHjU,1237
21
21
  bitcoin/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  bitcoin/utils/benchmark.py,sha256=HXZy9vU34MKrBoVjx3y982TFEOuSmOz5HWf5LcFwaZA,817
23
- bitcoin/utils/bitcoin_rpc.py,sha256=wyTIahgdSyiR1ryPi75n33ERuKQK630YTO9hNs_MML4,1358
23
+ bitcoin/utils/bitcoin_rpc.py,sha256=WndxBpUuztx7SdHttfUOubFYRwijWmgJ3_DGWzdXTjs,1444
24
24
  bitcoin/utils/bitcoin_utils.py,sha256=mrnRPqUa2U2EMKu7rrPV_bW1sL2CJUfbAom0Zdamydk,631
25
- bitcoin/utils/constants.py,sha256=irZLlArgica2VckyckEYxH5D5KjvdF52dtBMWswqw8k,52
25
+ bitcoin/utils/constants.py,sha256=bolLU7V3pFt6dQQ__CK5ESC8bkg0jO_Akn4iubaUum0,51
26
26
  bitcoin/utils/context_aware_logging.py,sha256=p3PuFnHjJcgEH8O9ng7UrXvW3SVDWGaeYgxysDuqRyI,1874
27
27
  bitcoin/utils/inscription_utils.py,sha256=8QbOJ1o1n1bMFsPREGLzwFjnGzfuARgJCPr6ORhP44o,193
28
- bitcoinwatcher-2.11b1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
29
- bitcoinwatcher-2.11b1.dist-info/METADATA,sha256=9R6TAJrjEmQ0FZux2qYzZS3blJJoOaq1Lw7DdWKs7iU,15023
30
- bitcoinwatcher-2.11b1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
31
- bitcoinwatcher-2.11b1.dist-info/top_level.txt,sha256=YdUgzLdCiMlrwaKyDqHA1acEd23QFko5bv7D6nBANJ0,8
32
- bitcoinwatcher-2.11b1.dist-info/RECORD,,
28
+ bitcoinwatcher-2.11b2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
29
+ bitcoinwatcher-2.11b2.dist-info/METADATA,sha256=FD8IwJdWQ0AiyGuY_Tplr4N8XzgA9TMAzkag8Jn-KZE,15045
30
+ bitcoinwatcher-2.11b2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
31
+ bitcoinwatcher-2.11b2.dist-info/top_level.txt,sha256=YdUgzLdCiMlrwaKyDqHA1acEd23QFko5bv7D6nBANJ0,8
32
+ bitcoinwatcher-2.11b2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5