web3-wizzard-lib 1.4.1__py3-none-any.whl → 1.5.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,8 +1,8 @@
1
- import requests
2
1
  from sybil_engine.module.module import Module
3
2
  from sybil_engine.utils.accumulator import add_accumulator, get_value
4
3
 
5
4
  from web3_wizzard_lib.core.utils.statistic_utils import statistic_date_string, get_statistic_writer
5
+ from web3_wizzard_lib.utils.debank_utils import debank_request
6
6
 
7
7
  TOTAL_USD = "TotalUSD"
8
8
  DEBANK_ACC_NUM = "DEBANK_ACC_NUM"
@@ -34,7 +34,7 @@ class DebankChecker(Module):
34
34
  ]
35
35
 
36
36
  def execute(self, account, statistic_write='GOOGLE'):
37
- data = self.debank_request(account)
37
+ data = debank_request(account)
38
38
 
39
39
  job_name = f"debank_{statistic_date_string}"
40
40
  statistics_writer = get_statistic_writer()
@@ -74,18 +74,5 @@ class DebankChecker(Module):
74
74
 
75
75
  statistics_writer.write_row(job_name, cumulative_row)
76
76
 
77
- def debank_request(self, account):
78
- url = "https://pro-openapi.debank.com/v1/user/total_balance"
79
- params = {
80
- 'id': account.address
81
- }
82
- headers = {
83
- 'accept': 'application/json',
84
- 'AccessKey': '6cd56a970242386fa2a57e380c39f00f10b31778'
85
- }
86
- response = requests.get(url, headers=headers, params=params)
87
- data = response.json()
88
- return data
89
-
90
77
  def log(self):
91
78
  return "Debank Checker"
@@ -15,7 +15,7 @@ class NilePool(Pool):
15
15
  super().__init__(chain_instance, web3)
16
16
  self.nile_contract = NileContract(self.velocore_pool_contract_address, self.web3)
17
17
 
18
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
18
+ @retry(max_attempts=2, retry_interval={'from': 10, 'to': 20})
19
19
  def deposit(self, amount_interval, account, token, min_native_balance, chain):
20
20
  amount = interval_to_eth_balance(amount_interval, account, chain, self.web3)
21
21
 
@@ -33,7 +33,7 @@ class NilePool(Pool):
33
33
  logger.info(f"Deposit {amount} and {nile_token.balance(account)}")
34
34
  self.nile_contract.add_liquidity_eth(account, nile_token.erc20_contract.contract_address, pool_amount, amount)
35
35
 
36
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
36
+ @retry(max_attempts=2, retry_interval={'from': 10, 'to': 20})
37
37
  def withdraw(self, account, token, chain):
38
38
  weth_zero_address = get_tokens_for_chain(chain)[f"WETH_{token}_LP"]
39
39
 
File without changes
@@ -0,0 +1,19 @@
1
+ import requests
2
+
3
+
4
+ def debank_request(account):
5
+ url = "https://pro-openapi.debank.com/v1/user/total_balance"
6
+ params = {
7
+ 'id': account.address
8
+ }
9
+ headers = {
10
+ 'accept': 'application/json',
11
+ 'AccessKey': '6cd56a970242386fa2a57e380c39f00f10b31778'
12
+ }
13
+ response = requests.get(url, headers=headers, params=params)
14
+ data = response.json()
15
+ return data
16
+
17
+
18
+ def debank_total_balance(account):
19
+ return debank_request(account).get('total_usd_value', 0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: web3_wizzard_lib
3
- Version: 1.4.1
3
+ Version: 1.5.0
4
4
  Summary: Engine for web3 smart contracts automatization.
5
5
  Home-page: https://github.com/Indeoo/web3-wizzard-lib/
6
6
  Author: Indeoo
@@ -102,7 +102,7 @@ web3_wizzard_lib/core/modules/claimer.py,sha256=zjlbckMB6YWOZ3NFZrYWIhZ0wMqV4Rdb
102
102
  web3_wizzard_lib/core/modules/concrete_swap.py,sha256=nKhMX5Rlv4kqcNtfmEP8IFW9a4xnlAhjNkyTPrYby5s,3442
103
103
  web3_wizzard_lib/core/modules/coredao_bridge.py,sha256=WPC8wZlu25s7Hb-Uj34HyapbBu2kkT-hP8xAeEqv9bw,1023
104
104
  web3_wizzard_lib/core/modules/coredao_bridge_auto.py,sha256=lMKP07P5FuuSykN3eb3KN8R-MPBOdZHHN5IGkV8Zn8U,1447
105
- web3_wizzard_lib/core/modules/debank_checker.py,sha256=AE7uCHAQY2VMxvY8QooDkH4O5GdmRAjJKG9uaIKCCYQ,2802
105
+ web3_wizzard_lib/core/modules/debank_checker.py,sha256=gBDjLORbbwUnPgMocd6n33ABQ0QJPwF-tsjATGU6uj4,2412
106
106
  web3_wizzard_lib/core/modules/dmail.py,sha256=ox5sMMQ7OqpSnLdt3VSvS0eFEhK5Qy8JZB5MsmNkp9k,1703
107
107
  web3_wizzard_lib/core/modules/erc20_balance.py,sha256=4mxd6QpOgnHHqUB0u6ya1Kh_xw3Mq7ObaILw8jgfVNk,1394
108
108
  web3_wizzard_lib/core/modules/gmx_reward.py,sha256=tYKmDpSehpQLU7FFZALwXPnh_lY8pBDu1xq-uUjyNxA,1215
@@ -147,7 +147,7 @@ web3_wizzard_lib/core/modules/intract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCe
147
147
  web3_wizzard_lib/core/modules/intract/intract_api.py,sha256=Pc4LNhp0BoHvr2qLlUXGVFQjh-s0_eG8VcTPG5LB7zQ,8597
148
148
  web3_wizzard_lib/core/modules/intract/utils.py,sha256=i3LbPGLHtMQ3qjbwfADJ0W2CjJo04sc5CYBPKl5zHhg,2811
149
149
  web3_wizzard_lib/core/modules/liquidity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
150
- web3_wizzard_lib/core/modules/liquidity/nile_pool.py,sha256=7bQJpRTgyhctBhFLkjqJulMuNT94Lzz7HX7tOQ1BsIo,2616
150
+ web3_wizzard_lib/core/modules/liquidity/nile_pool.py,sha256=dvKJzo43qtZcGXA9xsolks403cnbXHcDVTvRzr_DfVU,2614
151
151
  web3_wizzard_lib/core/modules/liquidity/pool.py,sha256=fiQ_EtxUMxcmtSPPQq601qL8cxNfEnaQgtlaOF-jsfg,498
152
152
  web3_wizzard_lib/core/modules/liquidity/syncswap_pool.py,sha256=rJtoGsz4DPtediDHlAQBttH4hCFpEAYccf8v6GRy2VY,2591
153
153
  web3_wizzard_lib/core/modules/liquidity/velocore_pool.py,sha256=rgCaFX20FJyHI94EGKH0lV7E9QhiyC0bRYY29rJGjVk,2286
@@ -361,8 +361,10 @@ web3_wizzard_lib/resources/main/contracts.json,sha256=jGeEoEiys1Itg7s5WFIeVFKis9
361
361
  web3_wizzard_lib/resources/main/networks.json,sha256=dmZLOsSaj2_CJwLqS4Deb4FgQrxPWpIQKGml6cXfKzI,6465
362
362
  web3_wizzard_lib/resources/main/pairs.json,sha256=uvIFvY46Ctiw8hjGd9e-1WE0qLf_duo3MuZncRMLqGg,8262
363
363
  web3_wizzard_lib/resources/main/tokens.json,sha256=AoZz_I6AVoZuecNdyX5L-SnGm6TREuPrsYd2i9PJr7U,5707
364
- web3_wizzard_lib-1.4.1.data/data/requirements.txt,sha256=1yiy6f7m2XBGiXoYhSVTxI8SEsfimGGxBJU9708bYFE,20
365
- web3_wizzard_lib-1.4.1.dist-info/METADATA,sha256=LpHL5AIJyCoz_G6dWXhI06_oikW7e5AZfbiMdKmHDTI,428
366
- web3_wizzard_lib-1.4.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
367
- web3_wizzard_lib-1.4.1.dist-info/top_level.txt,sha256=8dD8S5HQo4dKtxogttWY_sh4n3yCVy0MwiTelYp6kug,28
368
- web3_wizzard_lib-1.4.1.dist-info/RECORD,,
364
+ web3_wizzard_lib/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
365
+ web3_wizzard_lib/utils/debank_utils.py,sha256=9Sip0peXl66oDzEsITjOfrBoY7mIzebCTt0fNioLuwc,492
366
+ web3_wizzard_lib-1.5.0.data/data/requirements.txt,sha256=1yiy6f7m2XBGiXoYhSVTxI8SEsfimGGxBJU9708bYFE,20
367
+ web3_wizzard_lib-1.5.0.dist-info/METADATA,sha256=xo7NhClFz-8A6Cu6S2sZ4KA6-yYOvcUxkzHdldggxcw,428
368
+ web3_wizzard_lib-1.5.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
369
+ web3_wizzard_lib-1.5.0.dist-info/top_level.txt,sha256=8dD8S5HQo4dKtxogttWY_sh4n3yCVy0MwiTelYp6kug,28
370
+ web3_wizzard_lib-1.5.0.dist-info/RECORD,,