web3-wizzard-lib 0.0.2__py3-none-any.whl → 0.0.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.
Files changed (295) hide show
  1. web3_wizzard_lib/core/modules/linea_appeal.py +12 -45
  2. web3_wizzard_lib/core/modules/stargate/farming.py +1 -1
  3. web3_wizzard_lib/core/utils/ai_utils.py +27 -0
  4. {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/METADATA +8 -3
  5. {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/RECORD +8 -294
  6. {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/WHEEL +1 -1
  7. core/__init__.py +0 -1
  8. core/contract/__init__.py +0 -0
  9. core/contract/aavecontract.py +0 -36
  10. core/contract/alienswap_contract.py +0 -21
  11. core/contract/arena_games_contract.py +0 -16
  12. core/contract/basiliskcontract.py +0 -58
  13. core/contract/bilinear_contract.py +0 -22
  14. core/contract/bungee.py +0 -33
  15. core/contract/coredao_contract.py +0 -35
  16. core/contract/coredao_from_contract.py +0 -40
  17. core/contract/dmail_send_mail.py +0 -18
  18. core/contract/empty_nft.py +0 -18
  19. core/contract/era_name.py +0 -23
  20. core/contract/eralendcontract.py +0 -34
  21. core/contract/eth_scroll_bridge_contract.py +0 -25
  22. core/contract/frog_war_contract.py +0 -48
  23. core/contract/horizondex_quoter.py +0 -14
  24. core/contract/horizondex_router.py +0 -91
  25. core/contract/imagine_contract.py +0 -18
  26. core/contract/izumi.py +0 -63
  27. core/contract/kreatorland_contract.py +0 -21
  28. core/contract/l0_claim.py +0 -254
  29. core/contract/l2_telegraph.py +0 -21
  30. core/contract/layerbank_price.py +0 -18
  31. core/contract/layerbank_token.py +0 -29
  32. core/contract/layerbankcontract.py +0 -59
  33. core/contract/linea_day_2_contract.py +0 -19
  34. core/contract/linea_day_3_contract.py +0 -55
  35. core/contract/linea_ens_names_contract.py +0 -55
  36. core/contract/lineaswaprouter.py +0 -52
  37. core/contract/maverick_multicall.py +0 -52
  38. core/contract/mendi_finance_contract.py +0 -11
  39. core/contract/mendi_token.py +0 -25
  40. core/contract/merkly_minter.py +0 -47
  41. core/contract/micro3_contract.py +0 -18
  42. core/contract/mute_router.py +0 -93
  43. core/contract/nidum_contract.py +0 -44
  44. core/contract/nile_contract.py +0 -60
  45. core/contract/nomis_attest_contract.py +0 -40
  46. core/contract/nomis_contract.py +0 -40
  47. core/contract/octomos.py +0 -31
  48. core/contract/odos.py +0 -104
  49. core/contract/omnisea.py +0 -29
  50. core/contract/orbiter_starknet.py +0 -30
  51. core/contract/pancake_pool.py +0 -19
  52. core/contract/pancake_quoter.py +0 -20
  53. core/contract/pancake_router.py +0 -72
  54. core/contract/rage_claim.py +0 -24
  55. core/contract/reactor_fusion_contract.py +0 -78
  56. core/contract/readon_contract.py +0 -19
  57. core/contract/rubyscore_contract.py +0 -31
  58. core/contract/satoshi_universe_contract.py +0 -29
  59. core/contract/scroll_bridge_contract.py +0 -24
  60. core/contract/scroll_canvas_mint_contract.py +0 -26
  61. core/contract/scroll_oracle.py +0 -11
  62. core/contract/snap_contract.py +0 -16
  63. core/contract/social_scan_contract.py +0 -20
  64. core/contract/stargate_farming.py +0 -37
  65. core/contract/stargate_router.py +0 -84
  66. core/contract/stargate_router_eth.py +0 -41
  67. core/contract/stargate_token_pool.py +0 -46
  68. core/contract/stargate_v2_contract.py +0 -36
  69. core/contract/syncswap_classic_pool.py +0 -15
  70. core/contract/syncswap_classic_pool_factory.py +0 -15
  71. core/contract/syncswap_pool.py +0 -25
  72. core/contract/syncswap_router.py +0 -123
  73. core/contract/tavaera_id.py +0 -18
  74. core/contract/tavaera_mint.py +0 -17
  75. core/contract/townstory_bonus_contract.py +0 -19
  76. core/contract/townstory_contract.py +0 -21
  77. core/contract/velocore_lens.py +0 -44
  78. core/contract/velocore_pool.py +0 -198
  79. core/contract/velocore_router.py +0 -80
  80. core/contract/woofi_swap.py +0 -29
  81. core/contract/xy_finance_contract.py +0 -87
  82. core/contract/yoddlo_contract.py +0 -19
  83. core/contract/yuliverse_contract.py +0 -36
  84. core/contract/zebra_contract.py +0 -68
  85. core/contract/zerolend_contract.py +0 -34
  86. core/contract/zerolend_liq_contract.py +0 -20
  87. core/contract/zkdx_contract.py +0 -40
  88. core/contract/zkdx_data.py +0 -14
  89. core/contract/zks.py +0 -24
  90. core/modules/__init__.py +0 -0
  91. core/modules/ads_import_proxy.py +0 -52
  92. core/modules/airdrop_printer.py +0 -80
  93. core/modules/bank/__init__.py +0 -0
  94. core/modules/bank/aave.py +0 -25
  95. core/modules/bank/bank.py +0 -15
  96. core/modules/bank/bank_module.py +0 -99
  97. core/modules/bank/basilisk.py +0 -25
  98. core/modules/bank/eralend.py +0 -25
  99. core/modules/bank/layerbank.py +0 -116
  100. core/modules/bank/mendi_finance.py +0 -57
  101. core/modules/bank/reactorfusion.py +0 -25
  102. core/modules/bank/zerolend.py +0 -36
  103. core/modules/bridge/__init__.py +0 -0
  104. core/modules/bridge/bridge.py +0 -8
  105. core/modules/bridge/coredao_bridge_sub.py +0 -47
  106. core/modules/bridge/orbiter_sub.py +0 -112
  107. core/modules/bridge/scroll_bridge_sub.py +0 -42
  108. core/modules/bridge/stargate_v2_sub.py +0 -74
  109. core/modules/bridge_module.py +0 -47
  110. core/modules/bungee.py +0 -109
  111. core/modules/cex_sender.py +0 -60
  112. core/modules/cex_subaccount_transfer.py +0 -34
  113. core/modules/cex_withdraw.py +0 -91
  114. core/modules/claimer.py +0 -45
  115. core/modules/claims/__init__.py +0 -0
  116. core/modules/claims/layerzero_claimer.py +0 -64
  117. core/modules/claims/rabby_claimer.py +0 -81
  118. core/modules/concrete_swap.py +0 -97
  119. core/modules/coredao_bridge.py +0 -32
  120. core/modules/coredao_bridge_auto.py +0 -39
  121. core/modules/debank_checker.py +0 -90
  122. core/modules/dmail.py +0 -54
  123. core/modules/erc20_balance.py +0 -42
  124. core/modules/intract/__init__.py +0 -0
  125. core/modules/intract/intract_api.py +0 -212
  126. core/modules/intract/utils.py +0 -81
  127. core/modules/intract_claim.py +0 -104
  128. core/modules/layer_2_20.py +0 -65
  129. core/modules/lending_module.py +0 -134
  130. core/modules/linea_appeal.py +0 -70
  131. core/modules/linea_poh_lxp.py +0 -64
  132. core/modules/liquidity/__init__.py +0 -0
  133. core/modules/liquidity/nile_pool.py +0 -64
  134. core/modules/liquidity/pool.py +0 -16
  135. core/modules/liquidity/syncswap_pool.py +0 -61
  136. core/modules/liquidity/velocore_pool.py +0 -55
  137. core/modules/liquidity/zerolend_liquidity.py +0 -26
  138. core/modules/liquidity_pool.py +0 -60
  139. core/modules/merkly_refuel.py +0 -87
  140. core/modules/modules.py +0 -4
  141. core/modules/nft/__init__.py +0 -0
  142. core/modules/nft/abbys_world.py +0 -22
  143. core/modules/nft/acg_worlds.py +0 -25
  144. core/modules/nft/alienswap_linea.py +0 -22
  145. core/modules/nft/arena_games.py +0 -22
  146. core/modules/nft/asmatch.py +0 -22
  147. core/modules/nft/battlemon.py +0 -25
  148. core/modules/nft/bilinear.py +0 -22
  149. core/modules/nft/bitavatar.py +0 -25
  150. core/modules/nft/culture_satoshi_universe.py +0 -24
  151. core/modules/nft/efrogs.py +0 -26
  152. core/modules/nft/empty_nft.py +0 -22
  153. core/modules/nft/era_domain.py +0 -42
  154. core/modules/nft/frog_war.py +0 -22
  155. core/modules/nft/frog_war_bonus.py +0 -22
  156. core/modules/nft/gamerboom.py +0 -25
  157. core/modules/nft/gamerboom_bonus.py +0 -26
  158. core/modules/nft/imagine.py +0 -32
  159. core/modules/nft/kreatorland_module.py +0 -35
  160. core/modules/nft/l2_telegraph_module.py +0 -22
  161. core/modules/nft/layer3_meta.py +0 -25
  162. core/modules/nft/linea_culture_2_2_linus.py +0 -24
  163. core/modules/nft/linea_culture_2_3_yooldo.py +0 -24
  164. core/modules/nft/linea_culture_2_4_frogwar.py +0 -24
  165. core/modules/nft/linea_culture_2_5_acg.py +0 -25
  166. core/modules/nft/linea_culture_2_6_ascend_the_end.py +0 -25
  167. core/modules/nft/linea_culture_3_1_ascend_the_end.py +0 -25
  168. core/modules/nft/linea_culture_3_2_sending_me.py +0 -25
  169. core/modules/nft/linea_culture_3_3_townstory.py +0 -25
  170. core/modules/nft/linea_culture_3_4_daniele.py +0 -25
  171. core/modules/nft/linea_culture_3_5_demmortal.py +0 -25
  172. core/modules/nft/linea_culture_3_6_foxy.py +0 -25
  173. core/modules/nft/linea_culture_4_1_coop_records.py +0 -60
  174. core/modules/nft/linea_culture_4_2_borja_moskv.py +0 -65
  175. core/modules/nft/linea_culture_4_2_borja_moskv_approve.py +0 -27
  176. core/modules/nft/linea_culture_4_3_fruit.py +0 -66
  177. core/modules/nft/linea_culture_4_4_fruit_crux.py +0 -67
  178. core/modules/nft/linea_culture_4_5_forbidden_fruit.py +0 -67
  179. core/modules/nft/linea_culture_4_6_laurent.py +0 -67
  180. core/modules/nft/linea_culture_day2.py +0 -20
  181. core/modules/nft/linea_culture_day3.py +0 -20
  182. core/modules/nft/linea_ens_names.py +0 -107
  183. core/modules/nft/lucky_cat.py +0 -25
  184. core/modules/nft/merkly_minter_module.py +0 -22
  185. core/modules/nft/micro3.py +0 -23
  186. core/modules/nft/mint_2048.py +0 -28
  187. core/modules/nft/nft_submodule.py +0 -16
  188. core/modules/nft/nidum.py +0 -87
  189. core/modules/nft/nidum_bonus.py +0 -23
  190. core/modules/nft/nomis.py +0 -64
  191. core/modules/nft/nomis_attest.py +0 -66
  192. core/modules/nft/nouns.py +0 -27
  193. core/modules/nft/octomos.py +0 -32
  194. core/modules/nft/omnisea.py +0 -33
  195. core/modules/nft/omnizone.py +0 -25
  196. core/modules/nft/orbiter_claim.py +0 -87
  197. core/modules/nft/readon.py +0 -30
  198. core/modules/nft/rubyscore.py +0 -45
  199. core/modules/nft/sarubol.py +0 -22
  200. core/modules/nft/satoshi_universe.py +0 -22
  201. core/modules/nft/scroll_canvas_attest_year_badge.py +0 -35
  202. core/modules/nft/scroll_canvas_mint.py +0 -51
  203. core/modules/nft/sign.py +0 -32
  204. core/modules/nft/snap.py +0 -25
  205. core/modules/nft/snap_bonus.py +0 -31
  206. core/modules/nft/social_scan.py +0 -22
  207. core/modules/nft/sub_module.py +0 -8
  208. core/modules/nft/tavaera.py +0 -30
  209. core/modules/nft/townstory.py +0 -75
  210. core/modules/nft/townstory_bonus.py +0 -45
  211. core/modules/nft/trusta_reputation.py +0 -48
  212. core/modules/nft/trustaa_poh.py +0 -49
  213. core/modules/nft/uber_poh.py +0 -24
  214. core/modules/nft/wizards_of_linea.py +0 -26
  215. core/modules/nft/yoddlo.py +0 -22
  216. core/modules/nft/yuliverse.py +0 -22
  217. core/modules/nft/zace.py +0 -25
  218. core/modules/nft/zks_domain.py +0 -41
  219. core/modules/nft_minter.py +0 -107
  220. core/modules/orbiter.py +0 -39
  221. core/modules/orbiter_checker.py +0 -26
  222. core/modules/rage.py +0 -54
  223. core/modules/scroll_bridge.py +0 -45
  224. core/modules/sell_all.py +0 -51
  225. core/modules/sleep_module.py +0 -25
  226. core/modules/smart_contract_deployment.py +0 -37
  227. core/modules/stargate/__init__.py +0 -0
  228. core/modules/stargate/auto_bridge.py +0 -91
  229. core/modules/stargate/bridge.py +0 -38
  230. core/modules/stargate/bridge_eth.py +0 -59
  231. core/modules/stargate/bridge_tokens.py +0 -48
  232. core/modules/stargate/classic_bridge.py +0 -34
  233. core/modules/stargate/farming.py +0 -163
  234. core/modules/stargate/l0_data.py +0 -10
  235. core/modules/stargate/pool.py +0 -74
  236. core/modules/stargate/stargate_balance_utils.py +0 -25
  237. core/modules/stargate/stargate_gas_checker.py +0 -68
  238. core/modules/swap/__init__.py +0 -1
  239. core/modules/swap/horizondex.py +0 -38
  240. core/modules/swap/izumi.py +0 -41
  241. core/modules/swap/lineaswap.py +0 -34
  242. core/modules/swap/maverick.py +0 -66
  243. core/modules/swap/mute.py +0 -39
  244. core/modules/swap/odos.py +0 -58
  245. core/modules/swap/one_inch.py +0 -58
  246. core/modules/swap/pancake.py +0 -41
  247. core/modules/swap/swap_facade.py +0 -10
  248. core/modules/swap/syncswap.py +0 -62
  249. core/modules/swap/velocore.py +0 -40
  250. core/modules/swap/woofi.py +0 -38
  251. core/modules/swap/xy_finance.py +0 -43
  252. core/modules/swap/zebra.py +0 -32
  253. core/modules/warm_up.py +0 -98
  254. core/modules/wrapping.py +0 -74
  255. core/modules/zkdx.py +0 -63
  256. tests/core/__init__.py +0 -0
  257. tests/core/contracts/__init__.py +0 -0
  258. tests/core/contracts/test_horizondex_quoter.py +0 -37
  259. tests/core/contracts/test_uniswap_quoter.py +0 -35
  260. tests/core/contracts/test_velocore_lens.py +0 -67
  261. tests/core/contracts/test_velocore_pool.py +0 -57
  262. tests/core/modules/__init__.py +0 -67
  263. tests/core/modules/swap/__init__.py +0 -0
  264. tests/core/modules/swap/test_horizondex.py +0 -37
  265. tests/core/modules/swap/test_lineaswap.py +0 -28
  266. tests/core/modules/swap/test_maverick.py +0 -31
  267. tests/core/modules/swap/test_mute.py +0 -29
  268. tests/core/modules/swap/test_odos.py +0 -36
  269. tests/core/modules/swap/test_pancake.py +0 -54
  270. tests/core/modules/swap/test_syncswap.py +0 -59
  271. tests/core/modules/swap/test_velocore.py +0 -33
  272. tests/core/modules/swap/test_woofi.py +0 -22
  273. tests/core/modules/test_bungee.py +0 -27
  274. tests/core/modules/test_concrete_swap.py +0 -62
  275. tests/core/modules/test_dmail.py +0 -41
  276. tests/core/modules/test_lending.py +0 -122
  277. tests/core/modules/test_nft.py +0 -32
  278. tests/core/modules/test_nft_minter.py +0 -30
  279. tests/core/modules/test_orbiter.py +0 -28
  280. tests/core/modules/test_sellall.py +0 -27
  281. tests/core/modules/test_send_to_cex.py +0 -27
  282. tests/core/modules/test_stargate_auto_bridge.py +0 -32
  283. tests/core/modules/test_stargate_bridge.py +0 -25
  284. tests/core/modules/test_stargate_farming.py +0 -108
  285. tests/core/modules/test_warmup.py +0 -78
  286. tests/core/modules/test_wrapping.py +0 -68
  287. tests/core/scenario/__init__.py +0 -0
  288. tests/core/scenario/module_0_test_config.py +0 -91
  289. tests/core/test_app.py +0 -19
  290. tests/core/test_config.py +0 -34
  291. web3_wizzard_lib/core/modules/modules.py +0 -27
  292. web3_wizzard_lib/core/modules/nft/sub_module.py +0 -8
  293. web3_wizzard_lib/core/modules/swap/swap_facade.py +0 -10
  294. {web3_wizzard_lib-0.0.2.data → web3_wizzard_lib-0.0.3.data}/data/requirements.txt +0 -0
  295. {web3_wizzard_lib-0.0.2.dist-info → web3_wizzard_lib-0.0.3.dist-info}/top_level.txt +0 -0
@@ -1,90 +0,0 @@
1
- import requests
2
- from sybil_engine.module.module import Module
3
- from sybil_engine.utils.accumulator import add_accumulator, get_value
4
- from sybil_engine.utils.statistic_utils import statistic_date_string, get_statistic_writer
5
-
6
- TOTAL_USD = "TotalUSD"
7
- DEBANK_ACC_NUM = "DEBANK_ACC_NUM"
8
-
9
-
10
- class DebankChecker(Module):
11
- module_name = "DEBANK_CHECKER"
12
- module_config = None
13
-
14
- cumulative_chain_sums = {}
15
-
16
- supported_chains = [
17
- 'ethereum',
18
- 'arbitrum',
19
- 'op',
20
- 'zksync era',
21
- 'base',
22
- 'bnb Chain',
23
- 'linea',
24
- 'polygon',
25
- 'avalanche',
26
- 'scroll',
27
- 'core',
28
- 'fantom',
29
- 'zora',
30
- 'arbitrum nova',
31
- 'celo',
32
- 'klaytn'
33
- ]
34
-
35
- def execute(self, account, statistic_write='GOOGLE'):
36
- data = self.debank_request(account)
37
-
38
- job_name = f"debank_{statistic_date_string}"
39
- statistics_writer = get_statistic_writer()
40
-
41
- add_accumulator(DEBANK_ACC_NUM, 1)
42
-
43
- total_usd_value = data.get('total_usd_value', 0)
44
- chain_list = data.get('chain_list', [])
45
- chain_list = [item for item in chain_list if item['name'].lower() in self.supported_chains]
46
- chain_list = sorted(chain_list, key=lambda x: x['community_id'])
47
-
48
- chain_names = [chain.get('name') for chain in chain_list]
49
-
50
- statistics_writer.init_if_required(
51
- job_name,
52
- ['ADS ID', 'Wallet ID', 'Total USD Value'] + chain_names
53
- )
54
-
55
- row = [account.app_id, account.address, total_usd_value]
56
- for chain in chain_list:
57
- usd_value = chain.get('usd_value', 0)
58
- row.append(usd_value)
59
-
60
- if chain['name'] in self.cumulative_chain_sums:
61
- self.cumulative_chain_sums[chain['name']] += usd_value
62
- else:
63
- self.cumulative_chain_sums[chain['name']] = usd_value
64
-
65
- statistics_writer.write_row(job_name, row)
66
-
67
- add_accumulator(TOTAL_USD, total_usd_value)
68
-
69
- if get_value(DEBANK_ACC_NUM) == get_value("Acc Amount"):
70
- cumulative_row = ['SUM', '', get_value(TOTAL_USD)]
71
- for chain_name in chain_names:
72
- cumulative_row.append(self.cumulative_chain_sums.get(chain_name, 0))
73
-
74
- statistics_writer.write_row(job_name, cumulative_row)
75
-
76
- def debank_request(self, account):
77
- url = "https://pro-openapi.debank.com/v1/user/total_balance"
78
- params = {
79
- 'id': account.address
80
- }
81
- headers = {
82
- 'accept': 'application/json',
83
- 'AccessKey': '6cd56a970242386fa2a57e380c39f00f10b31778'
84
- }
85
- response = requests.get(url, headers=headers, params=params)
86
- data = response.json()
87
- return data
88
-
89
- def log(self):
90
- return "Debank Checker"
core/modules/dmail.py DELETED
@@ -1,54 +0,0 @@
1
- import random
2
- from hashlib import sha256
3
-
4
- from sybil_engine.data.contracts import get_contracts_for_chain
5
- from sybil_engine.data.networks import get_chain_instance
6
- from sybil_engine.module.module import Order, RepeatableModule
7
- from sybil_engine.utils.utils import interval_to_int
8
- from sybil_engine.utils.web3_utils import init_web3
9
-
10
- from web3_wizzard_lib.core.contract.dmail_send_mail import DmailSend
11
-
12
-
13
- class Dmail(RepeatableModule):
14
- module_name = 'DMAIL'
15
- module_config = 'send_dmail_config'
16
- allowed_chains = ['ZKSYNC', 'LINEA', 'SCROLL', 'MANTA', 'BASE']
17
- random_order = Order.RANDOM
18
- repeat_conf = 'email_amount'
19
-
20
- @RepeatableModule.repeatable_log
21
- def execute(self, chain, account):
22
- chain_instance = get_chain_instance(chain)
23
- web3 = init_web3(chain_instance, account.proxy)
24
-
25
- dmail_contract_address = get_contracts_for_chain(chain)["DMAIL"]
26
-
27
- email = sha256(str(1e11 * random.random()).encode()).hexdigest()
28
- theme = sha256(str(1e11 * random.random()).encode()).hexdigest()
29
-
30
- args = [account, email, theme]
31
-
32
- dmail_sender = self.get_contract_class()(dmail_contract_address, web3)
33
-
34
- dmail_sender.send_mail(*args)
35
-
36
- def log(self):
37
- return "SEND EMAIL"
38
-
39
- def get_contract_class(self):
40
- return DmailSend
41
-
42
- def parse_params(self, module_params):
43
- self.validate_supported_chain(module_params['chain'])
44
-
45
- return (module_params['chain'],)
46
-
47
- def order(self):
48
- return Order.RANDOM
49
-
50
- def repeats(self, module_params):
51
- if self.repeat_conf not in module_params:
52
- return 1
53
- else:
54
- return range(interval_to_int(module_params[self.repeat_conf]))
@@ -1,42 +0,0 @@
1
- from loguru import logger
2
- from sybil_engine.data.networks import get_chain_instance
3
- from sybil_engine.domain.balance.tokens import Erc20Token
4
- from sybil_engine.module.module import Order, Module
5
- from sybil_engine.utils.accumulator import add_accumulator_balance
6
- from sybil_engine.utils.web3_utils import init_web3
7
-
8
- from web3_wizzard_lib.core.contract.dmail_send_mail import DmailSend
9
-
10
-
11
- class Erc20BalanceModule(Module):
12
- module_name = 'ERC20_BALANCE_MODULE'
13
- module_config = 'erc20_balance'
14
- allowed_chains = ['ZKSYNC', 'LINEA', 'SCROLL', 'MANTA', 'BASE']
15
- cumulative_sum = 0
16
-
17
- def execute(self, token_address, chain, account):
18
- chain_instance = get_chain_instance(chain)
19
- web3 = init_web3(chain_instance, account.proxy)
20
-
21
- erc20_token = Erc20Token('LINEA', token_address, web3)
22
-
23
- balance = erc20_token.balance(account)
24
-
25
- self.cumulative_sum = self.cumulative_sum + balance.wei
26
-
27
- logger.info(f"{account.address} balance is {balance}")
28
- add_accumulator_balance("Total balance is", balance.wei)
29
-
30
- def log(self):
31
- return "ERC20 BALANCE"
32
-
33
- def get_contract_class(self):
34
- return DmailSend
35
-
36
- def parse_params(self, module_params):
37
- self.validate_supported_chain(module_params['chain'])
38
-
39
- return module_params['token_address'], module_params['chain']
40
-
41
- def order(self):
42
- return Order.RANDOM
File without changes
@@ -1,212 +0,0 @@
1
- from loguru import logger
2
- from pyuseragents import random as random_ua
3
- from requests import Session
4
- from sybil_engine.utils.retry import retry
5
-
6
-
7
- class IntractAPI:
8
- def __init__(self, account):
9
- self.account = account
10
- self.session = Session()
11
- self.session.headers['user-agent'] = random_ua()
12
- if account.proxy is not None and account.proxy != '':
13
- self.session.proxies.update({'http': account.proxy, 'https': account.proxy})
14
- else:
15
- logger.warning('You are not using proxy')
16
-
17
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
18
- def intract_get_nonce(self, address: str):
19
- payload = {'walletAddress': address}
20
- url = 'https://api.intract.io/api/qv1/auth/generate-nonce'
21
-
22
- self.session.headers.clear()
23
- r = self.session.post(url, json=payload)
24
-
25
- if r.json().get('success') == True:
26
- return r.json()['data']['nonce']
27
- else:
28
- logger.debug(f'nonce intract response: {r.status_code} {r.reason} | {r.text}')
29
- raise Exception(f'Couldnt generate nonce for Intract')
30
-
31
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
32
- def intract_login(self, address: str, signature: str):
33
- payload = {
34
- "signature": signature,
35
- "userAddress": address,
36
- "chain": {"id": 59144, "name": "Linea", "network": "Linea",
37
- "nativeCurrency": {"decimals": 18, "name": "Ether", "symbol": "ETH"},
38
- "rpcUrls": {"public": {"http": ["https://linea.drpc.org"]}, "default": {
39
- "http": ["https://linea-mainnet.infura.io/v3/bfc263a4f3cf49998641d16c24fd0b46"]}},
40
- "blockExplorers": {"etherscan": {"name": "Lineascan", "url": "https://lineascan.build/"},
41
- "default": {"name": "Lineascan", "url": "https://lineascan.build/"}},
42
- "unsupported": False},
43
- "isTaskLogin": False,
44
- "width": "590px",
45
- "reAuth": False,
46
- "connector": "metamask",
47
- "referralCode": None,
48
- "referralLink": None,
49
- "referralSource": None
50
- }
51
- url = 'https://api.intract.io/api/qv1/auth/wallet'
52
-
53
- r = self.session.post(url, json=payload)
54
-
55
- if r.json().get('isEVMLoggedIn') == True:
56
- self.user_id = self.get_user()['_id']
57
-
58
- self.session.headers.update({
59
- 'Cookies': r.headers["Set-Cookie"].split(';')[0],
60
- 'Questuserid': self.user_id,
61
- })
62
- return True
63
- else:
64
- logger.debug(f'login intract response: {r.status_code} {r.reason} | {r.text}')
65
- raise Exception(f'Couldnt login Intract')
66
-
67
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
68
- def intract_get_tasks(self, compaignID):
69
- self.active_tasks = []
70
-
71
- url = f'https://api.intract.io/api/qv1/campaign/{compaignID}'
72
- r = self.session.get(url)
73
-
74
- wave = r.json()
75
- # for wave in r.json():
76
- if wave["status"] == 'ACTIVE' and wave.get('locked') != True: self.active_tasks.append(wave["name"])
77
-
78
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
79
- def set_wallet(self, address: str):
80
- try:
81
- if self.get_user().get('lineaWalletAddress'):
82
- return True
83
-
84
- payload = {
85
- "userId": self.user_id,
86
- "lineaWalletAddress": address
87
- }
88
- url = 'https://api.intract.io/api/qv1/linea/user/set-wallet'
89
- r = self.session.post(url, json=payload)
90
-
91
- if r.json().get('message') == "Linea wallet address updated successfully":
92
- logger.info(f'Wallet successfully linked')
93
- return True
94
- except Exception as err:
95
- raise Exception(f'Couldnt set wallet: {err} | {r.text}')
96
-
97
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
98
- def intract_streak(self):
99
- try:
100
- url = 'https://api.intract.io/api/qv1/linea/user/streak'
101
- r = self.session.post(url, json={})
102
-
103
- streakCount = r.json().get('streakCount')
104
- isFirstTimeMarked = r.json().get('isFirstTimeMarked')
105
-
106
- if streakCount:
107
- logger.info(f'New GM streak: {streakCount + 1}')
108
- elif isFirstTimeMarked:
109
- logger.info(f'New GM streak: 1')
110
- elif 'Linea streak already done for today' in r.text:
111
- logger.info(f'New GM streak: already did streak today')
112
- else:
113
- raise Exception(f'bad response {r.status_code} {r.reason}')
114
- except Exception as err:
115
- if 'Internal server error' in r.text:
116
- logger.error(f'Couldnt use GM streak')
117
- else:
118
- logger.error(f'Couldnt post streak: {err} | {r.text}')
119
-
120
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
121
- def get_user(self):
122
- try:
123
- url = 'https://api.intract.io/api/qv1/auth/get-user?projectId=660c1fa77851c55d93a1c0e0'
124
- r = self.session.get(url)
125
- return r.json()
126
-
127
- except Exception as err:
128
- raise Exception(f'Couldnt get user: {err} | {r.text}')
129
-
130
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
131
- def get_super_user(self):
132
- try:
133
- # self.intract_streak()
134
-
135
- url = 'https://api.intract.io/api/qv1/auth/get-super-user'
136
- r = self.session.get(url)
137
-
138
- return {
139
- 'achieves': len(r.json().get('badges')),
140
- 'streak': r.json().get('gmStreak')['streakCount'],
141
- 'gems': r.json().get('totalGems'),
142
- 'xp': r.json().get('totalXp'),
143
- 'super_user_id': r.json().get('_id'),
144
- }
145
-
146
- except Exception as err:
147
- raise Exception(f'Couldnt get super user: {err} | {r.text}')
148
-
149
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
150
- def claim_achievements(self):
151
- try:
152
- url = 'https://api.intract.io/api/qv1/achievement/init'
153
- r = self.session.post(url)
154
-
155
- for achieve in r.json():
156
- if achieve["isClaimed"] == False and achieve["isCompleted"] == True:
157
- try:
158
- payload = {
159
- "achievementIds": [achieve["achievementId"]]
160
- }
161
- url = 'https://api.intract.io/api/qv1/achievement/claim'
162
- r = self.session.post(url, json=payload)
163
-
164
- if 'User achievement reward already claimed' in r.text or 'User achievement not found' in r.text:
165
- pass
166
- else:
167
- logger.info(f'Claimed achievement: {r.json()[0]["name"]}')
168
- except Exception as err:
169
- logger.error(
170
- f'Claim achievement {achieve["achievementId"]} {achieve["name"]} error: {err} | {r.text}')
171
-
172
- except Exception as err:
173
- logger.error(f'Couldnt fetch achievements: {err} | {r.text}')
174
-
175
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
176
- def activate_journey(self, campaign_id: str):
177
- url = f'https://api.intract.io/api/qv1/journey/fetch?campaignId={campaign_id}&channelCode=DEFAULT&referralCode=null'
178
-
179
- r = self.session.get(url)
180
- if r.json().get('isActive') != True:
181
- logger.error(f'Activate journey error: {r.text}')
182
-
183
- return r.json()
184
-
185
- @retry(max_attempts=10, retry_interval={'from': 10, 'to': 20})
186
- def verify_quest(self, task):
187
- data = {
188
- "campaignId": task['campaignId'],
189
- "userInputs": {},
190
- "userVerificationData": {},
191
- "taskId": task['_id']
192
- }
193
-
194
- headers = {
195
- 'questuserid': self.session.headers['Questuserid'],
196
- 'authorization': f'Bearer {self.session.headers["Cookies"].split('=')[1]}'
197
- }
198
-
199
- url = 'https://api.intract.io/api/qv1/task/verify-v2'
200
- r = self.session.post(url, json=data, headers=headers)
201
-
202
- logger.info(r.json())
203
-
204
- if r.json()['verified'] == 'False':
205
- raise Exception("Quest wasn't verified")
206
-
207
- return r.status_code
208
-
209
- def set_primary_task_identity(self, account):
210
- url = 'https://api.intract.io/api/qv1/auth/set-primary-task-identity'
211
- payload = {"identity": account.address, "namespaceTag": "EVM"}
212
- r = self.session.post(url, json=payload)
@@ -1,81 +0,0 @@
1
- from inspect import getsourcefile
2
- from random import randint
3
- from requests import post
4
- from loguru import logger
5
- from time import sleep
6
- from tqdm import tqdm
7
- import sys
8
- import ctypes
9
- import os
10
- sys.__stdout__ = sys.stdout
11
-
12
- TG_BOT_TOKEN = '' # токен от тг бота (`12345:Abcde`) для уведомлений. если не нужно - оставляй пустым
13
- TG_USER_ID = [] # тг айди куда должны приходить уведомления. [21957123] - для отправления уведомления только себе, [21957123, 103514123] - отправлять нескольким людями
14
-
15
- windll = ctypes.windll if os.name == 'nt' else None # for Mac users
16
-
17
-
18
- class WindowName:
19
- def __init__(self):
20
- try: self.path = os.path.abspath(getsourcefile(lambda: 0)).split("\\")[-2]
21
- except: self.path = os.path.abspath(getsourcefile(lambda: 0)).split("/")[-2]
22
-
23
- self.accs_done = 0
24
- self.modules_amount = 0
25
- self.modules_done = 0
26
-
27
- def update_accs(self):
28
- self.accs_done += 1
29
- self.modules_amount = 0
30
- self.modules_done = 0
31
-
32
- def update_modules(self):
33
- self.modules_done += 1
34
-
35
- def set_modules(self, modules_amount: int):
36
- self.modules_amount = modules_amount
37
-
38
-
39
- class TgReport:
40
- def __init__(self):
41
- self.logs = ''
42
-
43
-
44
- def update_logs(self, text: str):
45
- self.logs += f'{text}\n'
46
-
47
-
48
- def send_log(self, wallet, window_name, mode: str):
49
- notification_text = f'[{window_name.accs_done}/{window_name.accs_amount}] <i>{wallet.address}</i>\n\n' \
50
- f'{self.logs}\n'
51
- if mode == 'Claim quests': notification_text += f'{wallet.stats.get("status")}'
52
-
53
- texts = []
54
- while len(notification_text) > 0:
55
- texts.append(notification_text[:1900])
56
- notification_text = notification_text[1900:]
57
-
58
- if TG_BOT_TOKEN:
59
- for tg_id in TG_USER_ID:
60
- for text in texts:
61
- try: post(f'https://api.telegram.org/bot{TG_BOT_TOKEN}/sendMessage?parse_mode=html&chat_id={tg_id}&text={text}')
62
- except Exception as err: logger.error(f'[-] TG | Send Telegram message error to {tg_id}: {err}')
63
-
64
-
65
- def sleeping(*timing):
66
- if type(timing[0]) == list: timing = timing[0]
67
- if len(timing) == 2: x = randint(timing[0], timing[1])
68
- else: x = timing[0]
69
- for _ in tqdm(range(x), desc='sleep ', bar_format='{desc}: {n_fmt}/{total_fmt}'):
70
- sleep(1)
71
-
72
-
73
- def make_text_border(text: str):
74
- new_text = ''
75
- max_len = max([len(string) for string in text.split('\n')])
76
-
77
- new_text += '+' + '-' * (max_len + 8) + '+\n'
78
- for string in text.split('\n'): new_text += f'\t{string}\n'
79
- new_text += '+' + '-' * (max_len + 8) + '+\n'
80
-
81
- return new_text
@@ -1,104 +0,0 @@
1
- from json import load
2
-
3
- from eth_account.messages import encode_defunct
4
- from loguru import logger
5
- from sybil_engine.data.networks import get_chain_instance
6
- from sybil_engine.module.module import Module
7
- from sybil_engine.utils.utils import AccountException
8
- from sybil_engine.utils.web3_utils import init_web3
9
-
10
- from web3_wizzard_lib.core.modules.intract.intract_api import IntractAPI
11
- from web3_wizzard_lib.core.modules import TgReport, WindowName, make_text_border
12
-
13
- with open('resources/verify_data.json') as f:
14
- VERIFY_DATA = load(f)
15
-
16
-
17
- class IntractClaim(Module):
18
- module_name = 'INTRACT_CLAIM'
19
- module_config = None
20
-
21
- def execute(self, task_id, account, compaign_id='66bb5618c8ff56cba848ea8f', from_chain='LINEA'):
22
- windowname = WindowName()
23
-
24
- intract_api = IntractAPI(account)
25
- tg_report = TgReport()
26
- windowname.update_accs()
27
-
28
- stats = {}
29
-
30
- web3 = init_web3(get_chain_instance(from_chain), None)
31
-
32
- self.authorize(intract_api, compaign_id, account, web3)
33
-
34
- campaign_funcs = {
35
- "Linea LXP Latest Rush": self.linea_lxp,
36
- }
37
- intract_api.set_primary_task_identity(account)
38
- intract_api.activate_journey(compaign_id)
39
- linea_xp = intract_api.get_user().get("totalXp") or "0"
40
-
41
- if task_id == 'SKIP_CHECK':
42
- if int(linea_xp) == 100:
43
- raise AccountException("Skip account tasks where already claimed")
44
- else:
45
- return
46
-
47
- for task in intract_api.active_tasks:
48
- if task in list(campaign_funcs.keys()):
49
- campaign_funcs[task](task, task_id, intract_api)
50
- else:
51
- logger.info(f' > Task "{task}" will appear soon...')
52
-
53
- account_data = intract_api.get_super_user()
54
- linea_xp = intract_api.get_user().get("totalXp") or "0"
55
-
56
- logger.info('') # for clearly logs
57
- tg_report.update_logs('<i>Statistics</i>')
58
- logger.info('')
59
- text = f'Achievements: {account_data["achieves"]}\n' \
60
- f'GM Streak: {account_data["streak"]}\n' \
61
- f'Gems: {account_data["gems"]}\n' \
62
- f'XP: {account_data["xp"]}\n' \
63
- f'Linea XP: {linea_xp}'
64
- new_text = make_text_border(text=text)
65
- for string in new_text.split('\n'): logger.success(string)
66
-
67
- stats.update({
68
- 'linea_xp': linea_xp,
69
- 'xp': account_data["xp"],
70
- 'gm_streak': account_data["streak"],
71
- 'achievements': account_data["achieves"],
72
- 'gems': account_data["gems"],
73
- })
74
-
75
- def authorize(self, browser, compaign_id, account, web3):
76
- nonce = browser.intract_get_nonce(address=account.address)
77
- text = f'Nonce: {nonce}'
78
- signature = f'0x{web3.eth.account.sign_message(encode_defunct(text=text), private_key=account.key).signature.hex()}'
79
- browser.intract_login(address=account.address, signature=signature)
80
- browser.intract_get_tasks(compaign_id)
81
-
82
- browser.set_wallet(address=account.address)
83
- #browser.claim_achievements()
84
-
85
- def linea_lxp(self, task_name: str, task_id, intract_api, week=0):
86
- logger.info(f' > Completing "{task_name}"...')
87
-
88
- for task in VERIFY_DATA['campaigns'][str(week)]['quest']['tasks']:
89
- if task_id is not None:
90
- if task['_id'] == task_id:
91
- intract_api.verify_quest(task)
92
- else:
93
- intract_api.verify_quest(task)
94
-
95
- def log(self):
96
- return "INTRACT CLAIM"
97
-
98
- def parse_params(self, module_params):
99
- if 'taskID' not in module_params:
100
- module_params['taskID'] = None
101
-
102
- return [
103
- module_params['taskID']
104
- ]
@@ -1,65 +0,0 @@
1
- import random
2
-
3
- from loguru import logger
4
- from sybil_engine.contract.send import Send
5
- from sybil_engine.data.contracts import get_contracts_for_chain
6
- from sybil_engine.data.networks import get_chain_instance
7
- from sybil_engine.domain.balance.balance import NativeBalance
8
- from sybil_engine.domain.balance.balance_utils import get_native_balance
9
- from sybil_engine.module.module import Order, RepeatableModule
10
- from sybil_engine.utils.utils import interval_to_int, ConfigurationException
11
- from sybil_engine.utils.web3_utils import init_web3
12
-
13
- from web3_wizzard_lib.core.modules.bridge.orbiter_sub import bridge_codes
14
-
15
-
16
- class Layer2_20(RepeatableModule):
17
- module_name = 'Layer2_20'
18
- allowed_chains = ['ZKSYNC', 'OPTIMISM', 'BASE', 'LINEA', 'ARBITRUM', 'SCROLL']
19
- random_order = Order.RANDOM
20
- repeat_conf = 'repeats'
21
- module_config = 'layer_2_20_config'
22
-
23
- @RepeatableModule.repeatable_log
24
- def execute(self, chains, to_chains, account):
25
- chain = random.choice(chains)
26
- chain_instance = get_chain_instance(chain)
27
- web3 = init_web3(chain_instance, account.proxy)
28
-
29
- temp_to_chains = [item for item in to_chains if item != chain]
30
- if not temp_to_chains:
31
- raise ConfigurationException("No chains to send to")
32
- to_chain = random.choice(temp_to_chains)
33
-
34
- layer2_20_contract_address = get_contracts_for_chain(chain)["LAYER2_20"]
35
-
36
- send = Send(layer2_20_contract_address, web3)
37
-
38
- amount_to_send = NativeBalance(
39
- 230000000000000 + bridge_codes[to_chain],
40
- chain,
41
- chain_instance['gas_token']
42
- )
43
- data = '0x646174613a2c7b2270223a226c61796572322d3230222c226f70223a22636c61696d222c227469636b223a22244c32222c22616d74223a2231303030227d'
44
-
45
- native_balance = get_native_balance(account, web3, chain_instance)
46
-
47
- logger.info(f"Native {chain} balance: " + str(native_balance))
48
- logger.info(f"Inscription {chain} -> {to_chain} | {amount_to_send}")
49
-
50
- send.send_to_wallet(account, layer2_20_contract_address, amount_to_send, data)
51
-
52
- def log(self):
53
- return "LAYER2_20"
54
-
55
- def parse_params(self, module_params):
56
- return module_params['chains'], module_params['to_chains']
57
-
58
- def order(self):
59
- return Order.RANDOM
60
-
61
- def repeats(self, module_params):
62
- if self.repeat_conf not in module_params:
63
- return 1
64
- else:
65
- return range(interval_to_int(module_params[self.repeat_conf]))