Skip to content

Commit dde5df1

Browse files
committed
fix(nft): add missing async keyword to context manager
1 parent cbd326d commit dde5df1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/api/common/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Chain(Enum):
9393
coin=Coin.SOL,
9494
chain_id="0x65",
9595
simplehash_id="solana",
96-
alchemy_id="sol-mainnet",
96+
alchemy_id="solana-mainnet",
9797
has_nft_support=True,
9898
)
9999
FILECOIN = _c(

app/api/nft/routes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async def _transform_solana_asset_to_simplehash(asset: SolanaAsset) -> SimpleHas
140140
)
141141

142142
if not any([name, symbol, description, image_url]):
143-
with httpx.AsyncClient() as client:
143+
async with httpx.AsyncClient() as client:
144144
raw_content_response = await client.get(asset.content.json_uri)
145145
raw_content_response.raise_for_status()
146146
raw_content_data = SolanaAssetRawContent.model_validate(
@@ -210,7 +210,7 @@ async def get_nfts_by_owner(
210210

211211
if chain == Chain.SOLANA:
212212
# Handle Solana NFTs differently
213-
url = f"https://solana-mainnet.g.alchemy.com/v2/{settings.ALCHEMY_API_KEY}"
213+
url = f"https://{Chain.SOLANA.alchemy_id}.g.alchemy.com/v2/{settings.ALCHEMY_API_KEY}"
214214
params = {
215215
"jsonrpc": "2.0",
216216
"id": 1,
@@ -323,7 +323,7 @@ async def get_nfts_by_ids(
323323
async with httpx.AsyncClient() as client:
324324
# Handle Solana NFTs
325325
if solana_nfts:
326-
url = f"https://solana-mainnet.g.alchemy.com/v2/{settings.ALCHEMY_API_KEY}"
326+
url = f"https://{Chain.SOLANA.alchemy_id}.g.alchemy.com/v2/{settings.ALCHEMY_API_KEY}"
327327
params = {
328328
"jsonrpc": "2.0",
329329
"id": 1,
@@ -402,7 +402,7 @@ async def get_solana_asset_proof(
402402
),
403403
) -> SolanaAssetMerkleProof:
404404
async with httpx.AsyncClient() as client:
405-
url = f"https://solana-mainnet.g.alchemy.com/v2/{settings.ALCHEMY_API_KEY}"
405+
url = f"https://{Chain.SOLANA.alchemy_id}.g.alchemy.com/v2/{settings.ALCHEMY_API_KEY}"
406406
params = {
407407
"jsonrpc": "2.0",
408408
"method": "getAssetProof",

0 commit comments

Comments
 (0)