web3-wizzard-lib 1.9.1__py3-none-any.whl → 1.9.3__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.
@@ -14,7 +14,7 @@ class CompoundV3BulkerContract(Contract):
14
14
 
15
15
  @evm_transaction
16
16
  def invoke(self, account, amount, actions):
17
- hex_amount = decimal_to_padded_hexadecimal(amount, 32)
17
+ hex_amount = decimal_to_padded_hexadecimal(int(amount * 0.98), 32)
18
18
  data = f'0x000000000000000000000000b2f97c1bd3bf02f5e74d13f02e3e26f93d77ce44000000000000000000000000ef0f48dadd0abe4f99b4c14862df303ba956bd1300000000000000000000000000000000{hex_amount}'
19
19
 
20
20
  txn = self.contract.functions.invoke(
@@ -35,22 +35,22 @@ class MendiFinance(Bank):
35
35
  def repay_borrow(self, account, amount):
36
36
  logger.info(f"Mendi repay {amount.token}")
37
37
 
38
- def redeem(self, account, amount):
39
- me_token = f'me{amount.token}'
38
+ def redeem(self, account, amount, token):
39
+ me_token = f'mewe{token}'
40
40
  mendi_token_address = get_tokens_for_chain(self.chain)[me_token]
41
41
  mendi = MendiTokenContract(mendi_token_address, self.web3)
42
42
 
43
43
  redeem_balance = mendi.balance_of(account)
44
44
 
45
45
  if redeem_balance > 1000000000:
46
- logger.info(f"Mendi reedem {amount. token}")
46
+ logger.info(f"Mendi reedem {token}")
47
47
  mendi.redeem(account, redeem_balance)
48
48
  else:
49
49
  logger.info(f"Mendi balance is 0")
50
50
 
51
51
  def get_deposit_amount(self, account, token):
52
- #me_token = f'meweETH'
53
- mendi_token_address = get_tokens_for_chain(self.chain)[token]
52
+ me_token = f'meweETH'
53
+ mendi_token_address = get_tokens_for_chain(self.chain)[me_token]
54
54
  mendi = MendiTokenContract(mendi_token_address, self.web3)
55
55
 
56
56
  return mendi.balance_of(account)
@@ -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':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: web3-wizzard-lib
3
- Version: 1.9.1
3
+ Version: 1.9.3
4
4
  Summary: Engine for web3 smart contracts automatization.
5
5
  Author-email: Indeoo <indeooars@gmail.com>
6
6
  License: MIT
@@ -11,7 +11,7 @@ web3_wizzard_lib/core/contract/bilinear_contract.py,sha256=pCTkNQa4I1TqIAn_J6WgB
11
11
  web3_wizzard_lib/core/contract/bungee.py,sha256=vkuZmLhtdqvGOTkVe7MnIHsDGHUtm8zdqD-YYxVfkQ8,891
12
12
  web3_wizzard_lib/core/contract/cog_erc20.py,sha256=wkfKC7bqBHpgZGL5xZ4737pMaD5m8oEw0huw36ssX1M,1674
13
13
  web3_wizzard_lib/core/contract/compound_v3.py,sha256=ehsO6o53Av5s1dUknxj_6X4FBP4eNtZ_ZVMtvBzfTus,973
14
- web3_wizzard_lib/core/contract/compund_v3_bulker.py,sha256=88yUywma_Njzjm3B9U0p59UZYZtRRMP3Fii9Evb62M0,1490
14
+ web3_wizzard_lib/core/contract/compund_v3_bulker.py,sha256=SmmjGENtVwazJdjCI1Q2AIO_H-d51ykdLh4EYdBVTjI,1502
15
15
  web3_wizzard_lib/core/contract/coredao_contract.py,sha256=-M7gBYtVCxHLtoPfhNOwUaC9gHWuZMbd_xAbt7N66Tc,1035
16
16
  web3_wizzard_lib/core/contract/coredao_from_contract.py,sha256=cvQlLGjuri-1lhNKtnKJ79MDFcp_wXRFWlJRORt4ZEA,1221
17
17
  web3_wizzard_lib/core/contract/dmail_send_mail.py,sha256=_MVsSvrG17uMQTXNogrfxxKBeBsO8gq6zhaVc5w2AjQ,627
@@ -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
@@ -133,7 +133,7 @@ web3_wizzard_lib/core/modules/bank/cog_bank.py,sha256=v12iY78EESqJmZX3dJghU9Hulk
133
133
  web3_wizzard_lib/core/modules/bank/compound_v3.py,sha256=57-1JNfg76TyKOIjaF7X65e15mOBsfnI5JzYTlz0oVc,2205
134
134
  web3_wizzard_lib/core/modules/bank/eralend.py,sha256=2aVH4KMYCBwTYSslaULF0t_pQQwq9YBNOVV1_ailXS4,887
135
135
  web3_wizzard_lib/core/modules/bank/layerbank.py,sha256=btJr2GA8MY7R9jLoppTLddbtgHATKIck6sbhCeKUl_I,4547
136
- web3_wizzard_lib/core/modules/bank/mendi_finance.py,sha256=GAaTMop6tyxBe3HvsFxChNM4mNFk9vLzec5BpN0RcK0,1958
136
+ web3_wizzard_lib/core/modules/bank/mendi_finance.py,sha256=rRb_-_9N3uc5lfEeagVKutpn0Y64gRgegJIZk6Pxksw,1954
137
137
  web3_wizzard_lib/core/modules/bank/reactorfusion.py,sha256=EXxJn4u8c4F8pzaT0SMNLKQE8AJYNi4FMiZDJuimHVY,941
138
138
  web3_wizzard_lib/core/modules/bank/zerolend.py,sha256=H-YUpJt98kfhyKDdRJ-EpS0O2zXS_wBV821yLAXDDno,1327
139
139
  web3_wizzard_lib/core/modules/bridge/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -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.1.dist-info/METADATA,sha256=paWNbxRuIme-PEPrp6mzRsFIoRieGPCqyRRAOEUqedY,339
375
- web3_wizzard_lib-1.9.1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
376
- web3_wizzard_lib-1.9.1.dist-info/top_level.txt,sha256=31sEPHxuJ1p5fpc75vHQJ8eJdSs80aCZeeT3L8YAHNg,17
377
- web3_wizzard_lib-1.9.1.dist-info/RECORD,,
374
+ web3_wizzard_lib-1.9.3.dist-info/METADATA,sha256=KQIhv0Hb5DFQ7isKS9d8swTQyH7RN4BefxoJ7Pa4btY,339
375
+ web3_wizzard_lib-1.9.3.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
376
+ web3_wizzard_lib-1.9.3.dist-info/top_level.txt,sha256=31sEPHxuJ1p5fpc75vHQJ8eJdSs80aCZeeT3L8YAHNg,17
377
+ web3_wizzard_lib-1.9.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (76.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5