wayfinder-paths 0.1.17__py3-none-any.whl → 0.1.19__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.

Potentially problematic release.


This version of wayfinder-paths might be problematic. Click here for more details.

@@ -458,19 +458,8 @@ class BRAPAdapter(BaseAdapter):
458
458
  return v
459
459
  return None
460
460
 
461
- spender = (
462
- _as_address(transaction.get("allowanceTarget"))
463
- or _as_address(transaction.get("allowance_target"))
464
- or _as_address(transaction.get("approvalAddress"))
465
- or _as_address(transaction.get("approval_address"))
466
- or _as_address(transaction.get("spender"))
467
- or _as_address(quote.get("allowanceTarget"))
468
- or _as_address(quote.get("allowance_target"))
469
- or _as_address(quote.get("approvalAddress"))
470
- or _as_address(quote.get("approval_address"))
471
- or _as_address(quote.get("spender"))
472
- or _as_address(transaction.get("to"))
473
- )
461
+ spender = transaction.get("to")
462
+
474
463
  approve_amount = (
475
464
  quote.get("input_amount")
476
465
  or quote.get("inputAmount")
@@ -191,8 +191,7 @@ class HyperlendAdapter(BaseAdapter):
191
191
  target=self.gateway_address,
192
192
  abi=WRAPPED_TOKEN_GATEWAY_ABI,
193
193
  fn_name="withdrawETH",
194
- args=[self._gateway_first_arg(
195
- underlying_token), qty, strategy],
194
+ args=[self._gateway_first_arg(underlying_token), qty, strategy],
196
195
  from_address=strategy,
197
196
  chain_id=chain_id,
198
197
  )
@@ -235,7 +234,7 @@ class HyperlendAdapter(BaseAdapter):
235
234
  from_address=owner,
236
235
  chain_id=chain_id,
237
236
  token_address=token_address,
238
- spender=spender,
237
+ spender_address=spender,
239
238
  amount=amount,
240
239
  )
241
240
  return await self._send_tx(approve_tx)
@@ -256,9 +255,11 @@ class HyperlendAdapter(BaseAdapter):
256
255
  async with web3_from_chain_id(chain_id) as web3:
257
256
  contract = web3.eth.contract(address=target, abi=abi)
258
257
  try:
259
- data = await getattr(contract.functions, fn_name)(
260
- *args
261
- ).build_transaction({"from": from_address})["data"]
258
+ data = (
259
+ await getattr(contract.functions, fn_name)(*args).build_transaction(
260
+ {"from": from_address}
261
+ )
262
+ )["data"]
262
263
  except ValueError as exc:
263
264
  raise ValueError(f"Failed to encode {fn_name}: {exc}") from exc
264
265
 
@@ -292,6 +293,5 @@ class HyperlendAdapter(BaseAdapter):
292
293
 
293
294
  def _checksum(self, address: str | None) -> str:
294
295
  if not address:
295
- raise ValueError(
296
- "Missing required contract address in HyperLend config")
296
+ raise ValueError("Missing required contract address in HyperLend config")
297
297
  return to_checksum_address(address)
@@ -195,6 +195,18 @@ class StrategyJobConfig:
195
195
  )
196
196
 
197
197
 
198
+ def set_rpc_urls(rpc_urls):
199
+ if "strategy" not in CONFIG:
200
+ CONFIG["strategy"] = {}
201
+ if "rpc_urls" not in CONFIG["strategy"]:
202
+ CONFIG["strategy"]["rpc_urls"] = {}
203
+ CONFIG["strategy"]["rpc_urls"] = rpc_urls
204
+
205
+
206
+ def get_rpc_urls() -> dict[str, Any]:
207
+ return CONFIG.get("strategy", {}).get("rpc_urls", {})
208
+
209
+
198
210
  def get_api_base_url() -> str:
199
211
  system = CONFIG.get("system", {}) if isinstance(CONFIG, dict) else {}
200
212
  api_url = system.get("api_base_url")
@@ -4,7 +4,7 @@ from web3 import AsyncHTTPProvider, AsyncWeb3
4
4
  from web3.middleware import ExtraDataToPOAMiddleware
5
5
  from web3.module import Module
6
6
 
7
- from wayfinder_paths.core.config import CONFIG
7
+ from wayfinder_paths.core.config import get_rpc_urls
8
8
 
9
9
  POA_MIDDLEWARE_CHAIN_IDS: set = {56, 137, 43114}
10
10
 
@@ -21,7 +21,7 @@ class HyperModule(Module):
21
21
 
22
22
 
23
23
  def _get_rpcs_for_chain_id(chain_id: int) -> list:
24
- rpcs = CONFIG.get("strategy", {}).get("rpc_urls", {}).get(str(chain_id))
24
+ rpcs = get_rpc_urls().get(str(chain_id))
25
25
  if rpcs is None:
26
26
  raise ValueError(f"No RPCs configured for chain ID {chain_id}")
27
27
  return rpcs
@@ -2165,7 +2165,7 @@ class HyperlendStableYieldStrategy(Strategy):
2165
2165
  self, snapshot: dict[str, Any]
2166
2166
  ) -> dict[str, Any]:
2167
2167
  balances = {}
2168
- assets = snapshot.get("assets_view", {}).get("assets", [])
2168
+ assets = snapshot.get("assets", [])
2169
2169
  if assets:
2170
2170
  for asset in assets:
2171
2171
  checksum = asset.get("underlying_checksum") or asset.get("underlying")
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: wayfinder-paths
3
- Version: 0.1.17
3
+ Version: 0.1.19
4
4
  Summary: Wayfinder Path: strategies and adapters
5
5
  Author: Wayfinder
6
6
  Author-email: dev@wayfinder.ai
@@ -6,11 +6,11 @@ wayfinder_paths/adapters/balance_adapter/examples.json,sha256=3R1M4B_VsIy29viAuF
6
6
  wayfinder_paths/adapters/balance_adapter/test_adapter.py,sha256=UQArZUMLWC_F9vsXt_cKhwX_4_4SWwOIwEGSFTwlvkQ,6078
7
7
  wayfinder_paths/adapters/brap_adapter/README.md,sha256=Yihq35seDSvypW9c6u7IJViDGPTTWs_X3-mfjjc6uRA,7477
8
8
  wayfinder_paths/adapters/brap_adapter/__init__.py,sha256=jpqxZ-Bv_8kBo-lhgO_QCWaVZNq_WwlkNBHD4RsqOJg,90
9
- wayfinder_paths/adapters/brap_adapter/adapter.py,sha256=1qdE9jfnxkwuIKxeVnn6z50hGtzFeLab_DL8whni4g4,32539
9
+ wayfinder_paths/adapters/brap_adapter/adapter.py,sha256=U93vj9ELUBA7PdxNBPUKqJSGm4btZNB-mA39mnWyGM4,31915
10
10
  wayfinder_paths/adapters/brap_adapter/examples.json,sha256=FGZhNaMCAQ56KhovEGSsV1BHOcMd_QqQBNmCU6m8zfQ,5389
11
11
  wayfinder_paths/adapters/brap_adapter/test_adapter.py,sha256=ohaiMPyGxW5faOXjjAHuW5yAdcqx_lRWa3-Tm6Px0U0,12110
12
12
  wayfinder_paths/adapters/hyperlend_adapter/__init__.py,sha256=DsWOnEn-Tlu9ZoIoGaFeSqOYI3b4lXGVK3_FTntWpLw,139
13
- wayfinder_paths/adapters/hyperlend_adapter/adapter.py,sha256=oW-RUBgKbMEN9gNhJXyog5PRN1mg2nL1KqF-qOFJnO0,9958
13
+ wayfinder_paths/adapters/hyperlend_adapter/adapter.py,sha256=wd3aU9s7H6oH_eRwQ2HsgSwvCcW0L1H7fXuhJ50b4I4,9976
14
14
  wayfinder_paths/adapters/hyperlend_adapter/test_adapter.py,sha256=UEKGh-cRMhuc7k1tClLu8wuh6oQ4KV8ViczUa62qibk,11811
15
15
  wayfinder_paths/adapters/hyperliquid_adapter/__init__.py,sha256=QpA258RzVbxzsha86HQduAuNVG0g0qvsI5OcZunQ8DQ,467
16
16
  wayfinder_paths/adapters/hyperliquid_adapter/adapter.py,sha256=Z5Gl9M9wk7PVUIyP_i2oAMegmCTbVFd48Zp57DURh6M,34510
@@ -60,7 +60,7 @@ wayfinder_paths/core/clients/WalletClient.py,sha256=efvdJlS1fZfvNBU_hXn63mOKoETB
60
60
  wayfinder_paths/core/clients/WayfinderClient.py,sha256=gl-YHTYDa5GStg5O2xETiL4dAaCLphRos-btB1rQzVE,4319
61
61
  wayfinder_paths/core/clients/__init__.py,sha256=2xpZ4tBYkK0QjpBI88ZB4t4esfIc-enm0LqHdRo479M,1173
62
62
  wayfinder_paths/core/clients/protocols.py,sha256=Z0vvce55wfXrSXfuO0Y-s9EfT9zvwUier4-XhwPZSTs,7984
63
- wayfinder_paths/core/config.py,sha256=hcmK0o_FPuAqQvPCOS_OHwRsC8o6i8ftW13dvAN1Hck,7538
63
+ wayfinder_paths/core/config.py,sha256=_puUFYBnXBvmMmUx50Urc4H62KIOrodlrYQd7tuIhlU,7866
64
64
  wayfinder_paths/core/constants/__init__.py,sha256=upAVwHDgMXJ3DWaAuXo52UZktS8NZ17s5XwVH0qxgzg,591
65
65
  wayfinder_paths/core/constants/base.py,sha256=mJHZWZ9g9loIV0RVVJNRAM0wUid4vW2ql1bn-qAco48,1481
66
66
  wayfinder_paths/core/constants/erc20_abi.py,sha256=SQD4aNiw_xhb-8NxsnAfUAx1LeG9cIaBbCVrtU_5Z68,2885
@@ -77,7 +77,7 @@ wayfinder_paths/core/utils/erc20_service.py,sha256=MM2nE1iirPdqpohzvmbv50tFsu03L
77
77
  wayfinder_paths/core/utils/evm_helpers.py,sha256=ml6f2oMRv_YWFoiPxsoZYUSqM-IOkp4IbTrpfFHn-fU,5400
78
78
  wayfinder_paths/core/utils/transaction.py,sha256=JDeSOHw7YxTMsYmMmCXk28nIdmH9FQ99b8F0fw0fYl4,6914
79
79
  wayfinder_paths/core/utils/wallets.py,sha256=ccCQ128lDShO265AFMOCdijzPLucWe-Neg5wjLrOsnk,1948
80
- wayfinder_paths/core/utils/web3.py,sha256=UuTZ102CW9KNYgupwN1rm7WrqEgi8xOirUi1OOix7kI,1903
80
+ wayfinder_paths/core/utils/web3.py,sha256=r0vHvKvFC167MygHhmxr2nfYtLYN0ttSUEI--hPetO0,1877
81
81
  wayfinder_paths/policies/enso.py,sha256=oytco04eeGjiRbZPGFE1YpH4NxvV0tfVM14QmlyzjkY,428
82
82
  wayfinder_paths/policies/erc20.py,sha256=K5PQCUivBrU2nYmIdsIARzRiFy36Rijver-RJnaxNT8,960
83
83
  wayfinder_paths/policies/evm.py,sha256=8fJpjAl6XVxr51sVMw_VkWmIaI_lj2T7qrLcR8_sWgs,713
@@ -102,7 +102,7 @@ wayfinder_paths/strategies/basis_trading_strategy/test_strategy.py,sha256=NDqJIA
102
102
  wayfinder_paths/strategies/basis_trading_strategy/types.py,sha256=rlbouTUOVPLfGPzMbsf-fUmMcn0R_OsG-IdfiBJmmqI,845
103
103
  wayfinder_paths/strategies/hyperlend_stable_yield_strategy/README.md,sha256=20gA0Ae37tuILWdUoODcVLFTR73S7hTGUv4lAZhOvzA,4073
104
104
  wayfinder_paths/strategies/hyperlend_stable_yield_strategy/examples.json,sha256=GbVo2p6QiG6M7Ma5s671lw8G9JwnMl1h0n9mrtt-ZS8,164
105
- wayfinder_paths/strategies/hyperlend_stable_yield_strategy/strategy.py,sha256=rWwm_Zd9__XCF6Rl1qd2SMEXmxbDq9v2GeP475DQxf8,94074
105
+ wayfinder_paths/strategies/hyperlend_stable_yield_strategy/strategy.py,sha256=IfeBR6aGCj9BmNc02bOP7aUcPDqOIm9a4KK4ov6vyFc,94051
106
106
  wayfinder_paths/strategies/hyperlend_stable_yield_strategy/test_strategy.py,sha256=82VvObTwpmsnTlh_jMwLXHMQFDEH1qgbee4xQoDEzXo,16429
107
107
  wayfinder_paths/strategies/moonwell_wsteth_loop_strategy/README.md,sha256=Rfx6qeSYL9ttn7Wxi-_LiM7qqleoDByfhLaqLiGSKAw,4773
108
108
  wayfinder_paths/strategies/moonwell_wsteth_loop_strategy/examples.json,sha256=kgNRdZcqne8XTm-Y8Hv1a1pdajRQsey4Qhd5La-iWss,164
@@ -124,7 +124,7 @@ wayfinder_paths/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
124
124
  wayfinder_paths/tests/test_smoke_manifest.py,sha256=kTcIa4qikcspVh2ohQIk0aHUdIvBvcQBfNbm3PNiVvg,1636
125
125
  wayfinder_paths/tests/test_test_coverage.py,sha256=9NrZeVmP02D4W7Qc0XjciC05bhvdTCVibYjTGfa_GQk,7893
126
126
  wayfinder_paths/tests/test_utils.py,sha256=pxHT0QKFlyJeJo8bFnKXzWcOdi6t8rbJ0JFCBaFCBRQ,2112
127
- wayfinder_paths-0.1.17.dist-info/LICENSE,sha256=dYKnlkC_xosBAEQNUvB6cHMuhFgcUtN0oBR7E8_aR2Y,1066
128
- wayfinder_paths-0.1.17.dist-info/METADATA,sha256=b80LOnoc_Sd7vvLbWDn9YPDeGlyRiU1EhPM-ZsuALsQ,22924
129
- wayfinder_paths-0.1.17.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
130
- wayfinder_paths-0.1.17.dist-info/RECORD,,
127
+ wayfinder_paths-0.1.19.dist-info/LICENSE,sha256=dYKnlkC_xosBAEQNUvB6cHMuhFgcUtN0oBR7E8_aR2Y,1066
128
+ wayfinder_paths-0.1.19.dist-info/METADATA,sha256=ffyHnGWjp1p0C_VejPlWry2aQZM60yoj2jpdZiExtmI,22924
129
+ wayfinder_paths-0.1.19.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
130
+ wayfinder_paths-0.1.19.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: poetry-core 2.1.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any