web3-wizzard-lib 1.1.0__py3-none-any.whl → 1.2.1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,11 +10,11 @@ class GmxRewardRouter(Contract):
10
10
  super().__init__(contract_address, web3, abi)
11
11
 
12
12
  @evm_transaction
13
- def unstake_and_redeem(self, account, shares):
13
+ def unstake_and_redeem(self, account, glp_amount):
14
14
  txn_params = self.build_generic_data(account.address, False)
15
15
 
16
- contract_txn = self.contract.functions.redeem(
17
- shares,
16
+ contract_txn = self.contract.functions.unstakeAndRedeemGlpETH(
17
+ glp_amount,
18
18
  0,
19
19
  account.address,
20
20
  ).build_transaction(txn_params)
@@ -26,3 +26,6 @@ class NewRageContract(Contract):
26
26
 
27
27
  def convert_to_shares(self, amount):
28
28
  return self.contract.functions.convertToShares(amount).call()
29
+
30
+ def max_redeem(self, account):
31
+ return self.contract.functions.maxRedeem(account.address).call()
@@ -1,6 +1,7 @@
1
1
  from loguru import logger
2
2
  from sybil_engine.data.contracts import get_contracts_for_chain
3
3
  from sybil_engine.data.networks import get_chain_instance
4
+ from sybil_engine.domain.balance.tokens import Erc20Token
4
5
  from sybil_engine.module.module import Module
5
6
  from sybil_engine.utils.accumulator import add_accumulator
6
7
  from sybil_engine.utils.utils import ConfigurationException
@@ -21,7 +22,8 @@ class GMXRewardRouter(Module):
21
22
  contract_address = get_contracts_for_chain(chain_instance['chain'])['GMX_REWARD_ROUTER']
22
23
  gmx_reward_router = GmxRewardRouter(contract_address, web3)
23
24
 
24
- gmx_reward_router.unstake_and_redeem(account)
25
+ token = Erc20Token(chain, '0x1aDDD80E6039594eE970E5872D247bf0414C8903', web3)
26
+ gmx_reward_router.unstake_and_redeem(account, token.balance(account).wei)
25
27
 
26
28
  def log(self):
27
29
  return "GMX REWARD WITHDRAW"
@@ -24,16 +24,16 @@ class NewRageModule(Module):
24
24
  raise ConfigurationException("No such token supported by Rage withdraw module")
25
25
  rage = NewRageContract(contract_address, web3)
26
26
 
27
- balance = rage.balance_of(account)
28
- shares = rage.convert_to_shares(balance)
27
+ #balance = rage.balance_of(account)
28
+ shares = rage.max_redeem(account)
29
29
 
30
- if balance > 0:
31
- logger.info(f"Withdraw {balance} {token} which is {shares} shares")
30
+ if shares > 0:
31
+ logger.info(f"Withdraw {shares} shares {token}")
32
32
  rage.redeem(account, shares)
33
33
  else:
34
34
  logger.info(f"Account {account.address} has 0 balance in Rage")
35
35
 
36
- add_accumulator("Total rage withdraw", balance)
36
+ #add_accumulator("Total rage withdraw", balance)
37
37
 
38
38
  def log(self):
39
39
  return "RAGE WITHDRAW"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: web3_wizzard_lib
3
- Version: 1.1.0
3
+ Version: 1.2.1
4
4
  Summary: Engine for web3 smart contracts automatization.
5
5
  Home-page: https://github.com/Indeoo/web3-wizzard-lib/
6
6
  Author: Indeoo
@@ -20,7 +20,7 @@ web3_wizzard_lib/core/contract/era_name.py,sha256=SyzGmm6HDlCHML3sLE1EouQn1gVfYH
20
20
  web3_wizzard_lib/core/contract/eralendcontract.py,sha256=agn2Z9dCHCgAeMzrzMkhO_x7KS2rtEfynIUWM64pPVk,1080
21
21
  web3_wizzard_lib/core/contract/eth_scroll_bridge_contract.py,sha256=zjiJN4uwaJTyAAPuugWQIisIdqfN0xh6prCGSeOWNvY,777
22
22
  web3_wizzard_lib/core/contract/frog_war_contract.py,sha256=AmpMHVfxubbbmPbMu_3ppSm-T5ZBvmSwaL6S0N548rw,1620
23
- web3_wizzard_lib/core/contract/gmx_reward_router.py,sha256=6zPu3ltPxu8K6jsKly3-cnhrtWAss81BbCgfIyRBOFw,699
23
+ web3_wizzard_lib/core/contract/gmx_reward_router.py,sha256=xDzmbaOnudjKmCpvnZ-ntxxlkbHZ3qMO7CzTbw83IEA,723
24
24
  web3_wizzard_lib/core/contract/horizondex_quoter.py,sha256=LLXBeAISVc87Ahx85_P-UZBcAGo3bXnh1phaJWbqVRI,548
25
25
  web3_wizzard_lib/core/contract/horizondex_router.py,sha256=qDNaJrjtguFG7fWhCUPQgcJYW9zTVOSHF8ae5tavnCY,3807
26
26
  web3_wizzard_lib/core/contract/imagine_contract.py,sha256=WdkqPhrEo86Ee7g3kRo-sq6c943R0-JGTXldF124FmY,672
@@ -41,7 +41,7 @@ web3_wizzard_lib/core/contract/mendi_token.py,sha256=hVC5fqdZ9PTdpfnOn4MDXx_Wx_B
41
41
  web3_wizzard_lib/core/contract/merkly_minter.py,sha256=UGpcobKj5X0cT4UKHXZSxwtGFobbtQ4RXaEel05PaL8,1876
42
42
  web3_wizzard_lib/core/contract/micro3_contract.py,sha256=qnzB1h5D6q_WHVAKBnSQswLrBMcXyefuP5GQ66U0k40,621
43
43
  web3_wizzard_lib/core/contract/mute_router.py,sha256=Bhu6-xRgaZbpjJvhcDfnPZGuRIBciEGh0MggGiLZ6ek,3575
44
- web3_wizzard_lib/core/contract/new_rage_contract.py,sha256=C9EOU47KIw4cCe6bz5EDK6adcW2ZK7ysKPtU33nzxRw,917
44
+ web3_wizzard_lib/core/contract/new_rage_contract.py,sha256=KLvBdeA50ZHHLUCiSpof9IRCyNSl4pOLqhtnl3onl0E,1026
45
45
  web3_wizzard_lib/core/contract/nidum_contract.py,sha256=6k8B1G5s8LJFl9K6acg2qWfgVPnoJrG9BEHegWjO8uU,1524
46
46
  web3_wizzard_lib/core/contract/nile_contract.py,sha256=F6T6Dj2h2u_VdgcpAD3QYKIFafE6e3h_dKJZYb3CD0Y,2024
47
47
  web3_wizzard_lib/core/contract/nomis_attest_contract.py,sha256=mxHzvf6-IZoOe3jUhNNTNdlzXzCvhoWeoyanfBt3cMs,1171
@@ -104,7 +104,7 @@ web3_wizzard_lib/core/modules/coredao_bridge_auto.py,sha256=lMKP07P5FuuSykN3eb3K
104
104
  web3_wizzard_lib/core/modules/debank_checker.py,sha256=XCJk8VedNoHpdAQXk36dbdpZxJamcUuWDmud3i8ycPI,2792
105
105
  web3_wizzard_lib/core/modules/dmail.py,sha256=ox5sMMQ7OqpSnLdt3VSvS0eFEhK5Qy8JZB5MsmNkp9k,1703
106
106
  web3_wizzard_lib/core/modules/erc20_balance.py,sha256=4mxd6QpOgnHHqUB0u6ya1Kh_xw3Mq7ObaILw8jgfVNk,1394
107
- web3_wizzard_lib/core/modules/gmx_reward.py,sha256=cdH3M-aCArtq56h9dDdYsvZFQrpog7_22nmDVITm4qU,1043
107
+ web3_wizzard_lib/core/modules/gmx_reward.py,sha256=tYKmDpSehpQLU7FFZALwXPnh_lY8pBDu1xq-uUjyNxA,1215
108
108
  web3_wizzard_lib/core/modules/intract_claim.py,sha256=jfXuLYCpgYsEZsf3FHxvDbfqcX1gI-ZC8QUiIIa71ZA,3753
109
109
  web3_wizzard_lib/core/modules/layer_2_20.py,sha256=1MvidKQBS5GhBzH6yAmjTf1VHnM96_Wb0sGF24TTXJo,2475
110
110
  web3_wizzard_lib/core/modules/lending_module.py,sha256=Sy0P-Ojt3e1JVMUCqpG06-DsiuTCvvHilgSj_QJPCwg,5517
@@ -112,7 +112,7 @@ web3_wizzard_lib/core/modules/linea_appeal.py,sha256=ic178q1PoSN3ea6OoTrfyWLZvUA
112
112
  web3_wizzard_lib/core/modules/linea_poh_lxp.py,sha256=keipTIhT3SrOESNJdIJesHBOOM-NKVzMGqKEACEKIvQ,2320
113
113
  web3_wizzard_lib/core/modules/liquidity_pool.py,sha256=vu0vBoXomvAJFa10n9woo66v62hQbEO726M4lkiLWNE,2181
114
114
  web3_wizzard_lib/core/modules/merkly_refuel.py,sha256=whQD6CplGt-hQxFN7lg40F6SmFU5niOO529lKMj0dyA,3488
115
- web3_wizzard_lib/core/modules/new_rage_withdraw.py,sha256=Z8AY0NDFP54sw_f9A6AhJYYxdQliEkdo5sZTHqcwV1c,1558
115
+ web3_wizzard_lib/core/modules/new_rage_withdraw.py,sha256=OosuYItBZavXeqcQQDHL6FqLZv7tD-J8UZZx_0VYzG8,1534
116
116
  web3_wizzard_lib/core/modules/nft_minter.py,sha256=Z6HamxMv6NfqmXKb8zG1x4ItN5yZhGg9kvNFfPrlbNE,4150
117
117
  web3_wizzard_lib/core/modules/orbiter.py,sha256=Y_1xX7QkRdju9wXo-RKgeIoNwPJYIqrhxPK6uC5TaHU,1400
118
118
  web3_wizzard_lib/core/modules/orbiter_checker.py,sha256=Zo3r2S986sz5srcKTz2g6vpwv9i3YVOJSGkQEvE7ul8,666
@@ -360,8 +360,8 @@ web3_wizzard_lib/resources/main/contracts.json,sha256=jGeEoEiys1Itg7s5WFIeVFKis9
360
360
  web3_wizzard_lib/resources/main/networks.json,sha256=dmZLOsSaj2_CJwLqS4Deb4FgQrxPWpIQKGml6cXfKzI,6465
361
361
  web3_wizzard_lib/resources/main/pairs.json,sha256=uvIFvY46Ctiw8hjGd9e-1WE0qLf_duo3MuZncRMLqGg,8262
362
362
  web3_wizzard_lib/resources/main/tokens.json,sha256=AoZz_I6AVoZuecNdyX5L-SnGm6TREuPrsYd2i9PJr7U,5707
363
- web3_wizzard_lib-1.1.0.data/data/requirements.txt,sha256=5oZVZuID8L00sR9kJZYJg-TYMRN1WY93ktdNIhPIzX8,20
364
- web3_wizzard_lib-1.1.0.dist-info/METADATA,sha256=m1OublvwCusma1Sar0UETQG2Xd_qkBQzeha5gz2tt2c,428
365
- web3_wizzard_lib-1.1.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
366
- web3_wizzard_lib-1.1.0.dist-info/top_level.txt,sha256=8dD8S5HQo4dKtxogttWY_sh4n3yCVy0MwiTelYp6kug,28
367
- web3_wizzard_lib-1.1.0.dist-info/RECORD,,
363
+ web3_wizzard_lib-1.2.1.data/data/requirements.txt,sha256=5oZVZuID8L00sR9kJZYJg-TYMRN1WY93ktdNIhPIzX8,20
364
+ web3_wizzard_lib-1.2.1.dist-info/METADATA,sha256=onl-Ahv-u14t5j11wIB4IdPAl4-w9f5tCdA99KtxGQk,428
365
+ web3_wizzard_lib-1.2.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
366
+ web3_wizzard_lib-1.2.1.dist-info/top_level.txt,sha256=8dD8S5HQo4dKtxogttWY_sh4n3yCVy0MwiTelYp6kug,28
367
+ web3_wizzard_lib-1.2.1.dist-info/RECORD,,