Skip to content

Commit

Permalink
Fix BCD get_token method (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout authored Jul 12, 2021
1 parent e397af5 commit 2b62d40
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/dipdup/datasources/bcd/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ async def get_tokens(self, address: str) -> List[Dict[str, Any]]:
break
return tokens

async def get_token(self, address: str, token_id: int) -> Dict[str, Any]:
return await self._http.request(
async def get_token(self, address: str, token_id: int) -> Optional[Dict[str, Any]]:
response = await self._http.request(
'get',
url=f'v1/contract/{self._network}/{address}/tokens?token_id={token_id}',
)
if response:
return response[0]
return None

def _default_http_config(self) -> HTTPConfig:
return HTTPConfig(
Expand Down

0 comments on commit 2b62d40

Please sign in to comment.