From 1ff6f42b748b72fbf443fe7bc365d17db1a8a85e Mon Sep 17 00:00:00 2001 From: "marek.galvanek" Date: Wed, 11 Mar 2026 18:02:48 +0100 Subject: [PATCH] fix: add API key header support in Subscan requests --- blockapi/v2/api/subscan.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blockapi/v2/api/subscan.py b/blockapi/v2/api/subscan.py index 25bd339..d2fa8f8 100644 --- a/blockapi/v2/api/subscan.py +++ b/blockapi/v2/api/subscan.py @@ -127,6 +127,9 @@ def _yield_staking_rewards(self, address: str) -> Iterable[Decimal]: def _post(self, request_method: str, body): headers = {'Content-Type': 'application/json'} + if self.api_key: + headers['X-API-Key'] = self.api_key + return self.post(request_method, body=body, headers=headers) def _opt_raise_on_other_error(self, response: Response) -> None: