Skip to content

Commit 608e906

Browse files
Reisenali-bahjati
authored andcommitted
fix: manual encode array params for hermes
1 parent 1218ac1 commit 608e906

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ignore_missing_imports = true
44

55
[tool.poetry]
66
name = "pyth-observer"
7-
version = "0.1.10"
7+
version = "0.1.12"
88
description = "Alerts and stuff"
99
authors = []
1010
readme = "README.md"

pyth_observer/crosschain.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ async def get_crosschain_prices(self) -> Dict[str, CrosschainPrice]:
4242
for ids in chunked(price_feed_ids, 25):
4343
price_feeds_url = f"{self.url}/api/latest_price_feeds"
4444

45+
# aiohttp does not support encoding array params using PHP-style `ids=[]`
46+
# naming, so we encode it manually and append to the URL.
47+
query_string = "?" + "&".join(f"ids[]={v}" for v in ids)
4548
async with session.get(
46-
price_feeds_url, params={"ids": ids}
49+
price_feeds_url + query_string,
4750
) as response:
4851
price_feeds += await response.json()
4952

sample.config.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ network:
33
http_endpoint: "https://pythnet.rpcpool.com"
44
ws_endpoint: "wss://pythnet.rpcpool.com"
55
first_mapping: "AHtgzX45WTKfkPG53L6WYhGEXwQkN1BVknET3sVsLL8J"
6-
crosschain_endpoint: "https://xc-mainnet.pyth.network"
6+
crosschain_endpoint: "https://hermes.pyth.network"
77
request_rate_limit: 10
88
request_rate_period: 1
99
events:
10-
- DatadogEvent
10+
# NOTE: Uncomment to enable Datadog metrics, see README.md for datadog credential docs.
11+
# - DatadogEvent
1112
- LogEvent
1213
checks:
1314
global:

0 commit comments

Comments
 (0)