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: