web3-wizzard-lib 1.9.2__py3-none-any.whl → 1.10.0__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.
@@ -1,6 +1,7 @@
1
1
  from loguru import logger
2
2
  from sybil_engine.contract.send import Send
3
3
  from sybil_engine.data.networks import get_chain_instance
4
+ from sybil_engine.domain.balance.balance import NotEnoughNativeBalance
4
5
  from sybil_engine.domain.balance.balance_utils import interval_to_native_balance, interval_to_erc20_balance
5
6
  from sybil_engine.domain.balance.tokens import Erc20Token
6
7
  from sybil_engine.module.module import Module
@@ -24,7 +25,11 @@ class SendToCex(Module):
24
25
  amount = interval_to_native_balance(send_to_cex_amount_interval, account, chain_instance['chain'], web3)
25
26
 
26
27
  if send_to_cex_amount_interval == 'all_balance':
27
- amount = amount.minus(self.min_native_balance)
28
+ try:
29
+ amount = amount.minus(self.min_native_balance)
30
+ except NotEnoughNativeBalance as e:
31
+ logger.info("Wallet balance is empty or almost empty, skip")
32
+ return
28
33
  elif token in self.supported_chains:
29
34
  amount = interval_to_erc20_balance(send_to_cex_amount_interval, account, token, chain, web3)
30
35
  else:
@@ -38,7 +43,7 @@ class SendToCex(Module):
38
43
 
39
44
  add_accumulator_native_balance("Total sent to cex", amount.wei)
40
45
 
41
- @retry(max_attempts=5, retry_interval={'from': 60 * 2, 'to': 60 * 3})
46
+ @retry(max_attempts=5, retry_interval={'from': 60 * 1, 'to': 60 * 2})
42
47
  def send_funds(self, account, amount, cex_address, chain, chain_instance, token, web3):
43
48
  logger.info(f"Send {amount} to {cex_address} ({chain_instance['chain']})")
44
49
  if token == 'NATIVE':
@@ -5,7 +5,7 @@ from googleapiclient.discovery import build
5
5
  from loguru import logger
6
6
  from sybil_engine.utils.google_utils import get_google_credentials
7
7
 
8
- from sybil_engine.utils.telegram import get_config
8
+ from sybil_engine.utils.config_utils import get_config
9
9
 
10
10
  statistic_date_string = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
11
11
 
@@ -28,12 +28,10 @@ def import_all_modules(package):
28
28
  importlib.import_module(absolute_module_name)
29
29
 
30
30
 
31
- def launch():
31
+ def launch(config_map = None, module_map = None):
32
32
  import_all_modules(web3_wizzard_lib.core.modules)
33
33
 
34
34
  logger.info(Module.__subclasses__())
35
35
 
36
36
  modules_data = Modules(None, swap_facade)
37
- #modules_data = load_module_vars("web3-wizzard-lib.utils.modules")['modules_data']
38
-
39
- launch_with_data(modules_data)
37
+ launch_with_data(modules_data, config_map, module_map)
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: web3-wizzard-lib
3
- Version: 1.9.2
3
+ Version: 1.10.0
4
4
  Summary: Engine for web3 smart contracts automatization.
5
5
  Author-email: Indeoo <indeooars@gmail.com>
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://github.com/Indeoo/web3-wizzard-lib/
8
8
  Requires-Python: >=3.7
9
9
  Description-Content-Type: text/markdown
10
- Requires-Dist: sybil-engine==10.3.6
10
+ Requires-Dist: sybil-engine==10.4.0
@@ -1,5 +1,5 @@
1
1
  web3_wizzard_lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- web3_wizzard_lib/launcher.py,sha256=_c2W5YE3LNTCOCB6Od3jKnKtJD4tfLxCU0yVUn14oi0,1160
2
+ web3_wizzard_lib/launcher.py,sha256=7y_A29p8PCoI4Nc3Fldolm3-IjNNaYHXGVOgCqZ9qbM,1132
3
3
  web3_wizzard_lib/main.py,sha256=rrDyhZ_0JwvGJyxYKZ85qHs593E7Gdly0a0bdKNAyWM,85
4
4
  web3_wizzard_lib/core/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
5
  web3_wizzard_lib/core/contract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -95,7 +95,7 @@ web3_wizzard_lib/core/modules/airdrop_printer.py,sha256=k1w1m8WAS9MnQ7LkKaYlx5xg
95
95
  web3_wizzard_lib/core/modules/bank_module.py,sha256=UFwHoN1ncsWywzoxTiBnFDi9_mmjwPGST2VtD02L6dk,4229
96
96
  web3_wizzard_lib/core/modules/bridge_module.py,sha256=ZoO80ody9cP_ezhah680ezTAEdM2VyxRqmmUH7b2xHE,2011
97
97
  web3_wizzard_lib/core/modules/bungee.py,sha256=CVjZH5_nmBWO5Vg5Xx-_dDzfaJ7oCDgFp0gG8VHd76E,4881
98
- web3_wizzard_lib/core/modules/cex_sender.py,sha256=2akfVhaMvHnuKUBfiCTqnVuP3VWrJIStArBqQKpiU2I,2723
98
+ web3_wizzard_lib/core/modules/cex_sender.py,sha256=JnMOWag9bC9Py2HdU5N2aYeWYwCzBbt2cKLtgl4qZlM,2979
99
99
  web3_wizzard_lib/core/modules/cex_subaccount_transfer.py,sha256=wgD96jLBmmql9HlPOvx1M22JfXnvxGh78qDEtXNcZu0,1164
100
100
  web3_wizzard_lib/core/modules/cex_withdraw.py,sha256=fCuiO4DTuWp2OTeRlsMqbvXh7poYO-QCU2Syco7OV3M,3846
101
101
  web3_wizzard_lib/core/modules/claimer.py,sha256=zjlbckMB6YWOZ3NFZrYWIhZ0wMqV4RdbdbqKrx99gC8,1346
@@ -261,7 +261,7 @@ web3_wizzard_lib/core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
261
261
  web3_wizzard_lib/core/utils/ai_utils.py,sha256=hNRgDbD363RNS35bOgYFlSo6P6yqU6ptZ6fIkoMkL44,1025
262
262
  web3_wizzard_lib/core/utils/benchmark_utils.py,sha256=3YBPXseWJb_BpBJtWWU6Dc5kydyhX4YWSvEWj4v6ekk,286
263
263
  web3_wizzard_lib/core/utils/module_memory.py,sha256=Ot-C3g9ax9frTTpWSLQqsbGcp7WMmmHKM9R7qI920xk,436
264
- web3_wizzard_lib/core/utils/statistic_utils.py,sha256=WpdEYwAcZnOpLwDjNLJFI5e1bguhkbETRxPIrK3MHtQ,5652
264
+ web3_wizzard_lib/core/utils/statistic_utils.py,sha256=K_dkODk_as7Sk6AvQVpQxZ1iz81UziE-8R45UZEG5K4,5656
265
265
  web3_wizzard_lib/core/utils/sub_module.py,sha256=r7C89nhlOUAYtCI92JINapS_-5hUUYX7YnY9hQLgHKg,117
266
266
  web3_wizzard_lib/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
267
267
  web3_wizzard_lib/data/config_default.py,sha256=a9LFBQXKauKyBSGWP_KbEIoA5rqxhYZ3h9-fK9E0d5o,1668
@@ -371,7 +371,7 @@ web3_wizzard_lib/resources/main/pairs.json,sha256=uvIFvY46Ctiw8hjGd9e-1WE0qLf_du
371
371
  web3_wizzard_lib/resources/main/tokens.json,sha256=AoZz_I6AVoZuecNdyX5L-SnGm6TREuPrsYd2i9PJr7U,5707
372
372
  web3_wizzard_lib/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
373
373
  web3_wizzard_lib/utils/debank_utils.py,sha256=CE2SUN9RpFK_j9KjJgxf7a__VRJ75tLIw9tLrVNrn3c,484
374
- web3_wizzard_lib-1.9.2.dist-info/METADATA,sha256=5tcMqI1rs7SXr4cceQt1Z9njRQIKIgIHZceoHYZyJHY,339
375
- web3_wizzard_lib-1.9.2.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
376
- web3_wizzard_lib-1.9.2.dist-info/top_level.txt,sha256=31sEPHxuJ1p5fpc75vHQJ8eJdSs80aCZeeT3L8YAHNg,17
377
- web3_wizzard_lib-1.9.2.dist-info/RECORD,,
374
+ web3_wizzard_lib-1.10.0.dist-info/METADATA,sha256=V-0NvgpCZmZrY17AjIVL6WD2gub831zj2IlWYe_GGQc,340
375
+ web3_wizzard_lib-1.10.0.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
376
+ web3_wizzard_lib-1.10.0.dist-info/top_level.txt,sha256=31sEPHxuJ1p5fpc75vHQJ8eJdSs80aCZeeT3L8YAHNg,17
377
+ web3_wizzard_lib-1.10.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (76.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5