diff --git a/packages/sdk-core/src/subgraph/SubgraphClient.ts b/packages/sdk-core/src/subgraph/SubgraphClient.ts index ee3ed1a43b..9cc8505483 100644 --- a/packages/sdk-core/src/subgraph/SubgraphClient.ts +++ b/packages/sdk-core/src/subgraph/SubgraphClient.ts @@ -22,7 +22,7 @@ export class SubgraphClient { variables: variables ? cleanVariables(variables) : undefined, // TODO: explicit casting is semi-dirty and not recommended // but I am not sure how to fix this right now - } as RequestExtendedOptions); + } as unknown as RequestExtendedOptions); } } diff --git a/packages/sdk-core/src/subgraph/subgraphQueryHandler.ts b/packages/sdk-core/src/subgraph/subgraphQueryHandler.ts index 452b264cb1..2ca63dd88b 100644 --- a/packages/sdk-core/src/subgraph/subgraphQueryHandler.ts +++ b/packages/sdk-core/src/subgraph/subgraphQueryHandler.ts @@ -1,4 +1,5 @@ import { TypedDocumentNode } from "@graphql-typed-document-node/core"; +import { ethers } from "ethers"; import _ from "lodash"; import { listAllResults } from "../Query"; @@ -224,7 +225,9 @@ export abstract class SubgraphQueryHandler< const response = await this.querySubgraph(subgraphClient, { where: { - id: query.id, + id: ethers.utils.isAddress(query.id) + ? query.id.toLowerCase() + : query.id, }, skip: 0, take: 1,