Skip to content

Commit 62b10a9

Browse files
committed
fix: add API key header support in Subscan requests
1 parent 4f6374a commit 62b10a9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

blockapi/v2/api/subscan.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ def _yield_staking_rewards(self, address: str) -> Iterable[Decimal]:
127127

128128
def _post(self, request_method: str, body):
129129
headers = {'Content-Type': 'application/json'}
130+
if self.api_key:
131+
headers['X-API-Key'] = self.api_key
132+
130133
return self.post(request_method, body=body, headers=headers)
131134

132135
def _opt_raise_on_other_error(self, response: Response) -> None:

0 commit comments

Comments
 (0)