diff --git a/packages/payment-detection/codegen-near.yml b/packages/payment-detection/codegen-near.yml index 0af2c183c..4170f8d79 100644 --- a/packages/payment-detection/codegen-near.yml +++ b/packages/payment-detection/codegen-near.yml @@ -1,5 +1,5 @@ overwrite: true -schema: 'https://api.thegraph.com/subgraphs/name/requestnetwork/request-payments-near-testnet' +schema: 'https://api.studio.thegraph.com/query/67444/request-payments-near-testnet/version/latest' documents: src/thegraph/queries/near/*.graphql generates: src/thegraph/generated/graphql-near.ts: diff --git a/packages/payment-detection/codegen.yml b/packages/payment-detection/codegen.yml index f44358af2..f67dfd436 100644 --- a/packages/payment-detection/codegen.yml +++ b/packages/payment-detection/codegen.yml @@ -1,5 +1,5 @@ overwrite: true -schema: 'https://api.thegraph.com/subgraphs/name/requestnetwork/request-payments-goerli' +schema: 'https://api.studio.thegraph.com/query/67444/request-payments-sepolia/version/latest' documents: src/thegraph/queries/*.graphql generates: src/thegraph/generated/graphql.ts: diff --git a/packages/payment-detection/src/thegraph/client.ts b/packages/payment-detection/src/thegraph/client.ts index 2ddb94fae..ff80f09ae 100644 --- a/packages/payment-detection/src/thegraph/client.ts +++ b/packages/payment-detection/src/thegraph/client.ts @@ -6,10 +6,11 @@ import { Block_Height, Maybe, getSdk } from './generated/graphql'; import { getSdk as getNearSdk } from './generated/graphql-near'; import { RequestConfig } from 'graphql-request/src/types'; -const HOSTED_THE_GRAPH_URL = - 'https://api.thegraph.com/subgraphs/name/requestnetwork/request-payments-'; +const THE_GRAPH_STUDIO_URL = + 'https://api.studio.thegraph.com/query/67444/request-payments-$NETWORK/version/latest'; -const STUDIO_THE_GRAPH_URL = 'https://api.studio.thegraph.com/query/35843/request-payments-'; +const THE_GRAPH_STUDIO_URL_RF = + 'https://api.studio.thegraph.com/query/35843/request-payments-$NETWORK/version/latest'; const THE_GRAPH_URL_MANTLE_TESTNET = 'https://graph.testnet.mantle.xyz/subgraphs/name/requestnetwork/request-payments-mantle-testnet'; @@ -96,14 +97,23 @@ export const defaultGetTheGraphClient = ( return network === 'private' ? undefined : NearChains.isChainSupported(network) - ? getTheGraphNearClient(`${HOSTED_THE_GRAPH_URL}${network.replace('aurora', 'near')}`, options) + ? getTheGraphNearClient( + `${THE_GRAPH_STUDIO_URL.replace('$NETWORK', network.replace('aurora', 'near'))}`, + options, + ) : network === 'mantle' ? getTheGraphEvmClient(THE_GRAPH_URL_MANTLE, options) : network === 'mantle-testnet' ? getTheGraphEvmClient(THE_GRAPH_URL_MANTLE_TESTNET, options) : network === 'core' ? getTheGraphEvmClient(THE_GRAPH_URL_CORE, options) - : network === 'zksyncera' || network === 'base' - ? getTheGraphEvmClient(`${STUDIO_THE_GRAPH_URL}${network}/version/latest`, options) - : getTheGraphEvmClient(`${HOSTED_THE_GRAPH_URL}${network}`, options); + : /** + * These two subgraphs could not be transferred from the RF Studio account to the RN Studio account, + * because of an issue with TheGraph Studio and the fact that they were created before the + * migration to TheGraph decentralized network based on Arbitrum. + * FIXME: transfer these two subgraphs to the RN Studio account + */ + ['mainnet', 'xdai'].includes(network) + ? getTheGraphEvmClient(`${THE_GRAPH_STUDIO_URL_RF.replace('$NETWORK', network)}`, options) + : getTheGraphEvmClient(`${THE_GRAPH_STUDIO_URL.replace('$NETWORK', network)}`, options); }; diff --git a/packages/payment-detection/src/thegraph/queries/graphql.config.yml b/packages/payment-detection/src/thegraph/queries/graphql.config.yml index 4a8ed588f..6d35f9a0a 100644 --- a/packages/payment-detection/src/thegraph/queries/graphql.config.yml +++ b/packages/payment-detection/src/thegraph/queries/graphql.config.yml @@ -1 +1 @@ -schema: https://api.thegraph.com/subgraphs/name/requestnetwork/request-payments-goerli +schema: https://api.studio.thegraph.com/query/67444/request-payments-sepolia/version/latest diff --git a/packages/payment-detection/src/thegraph/queries/near/graphql.config.yml b/packages/payment-detection/src/thegraph/queries/near/graphql.config.yml index 1489fd245..397dbf77c 100644 --- a/packages/payment-detection/src/thegraph/queries/near/graphql.config.yml +++ b/packages/payment-detection/src/thegraph/queries/near/graphql.config.yml @@ -1 +1 @@ -schema: https://api.thegraph.com/subgraphs/name/requestnetwork/request-payments-near-testnet +schema: https://api.studio.thegraph.com/query/67444/request-payments-near-testnet/version/latest diff --git a/packages/toolbox/README.md b/packages/toolbox/README.md index 0ea1ce0dd..77211da63 100644 --- a/packages/toolbox/README.md +++ b/packages/toolbox/README.md @@ -67,7 +67,7 @@ It will suggest pairs of currencies: - With a Chainlink price feed oracle (according to [a cached JSON](https://cl-docs-addresses.web.app/addresses.json])) - If they exist in Currency Manager (cf. [../currency/src/erc20/networks]()) -- If they are not already added to the Chainlink Aggregation Path contract, as reported by the Price Aggregators subgraph ([Example for BSC](https://thegraph.com/hosted-service/subgraph/requestnetwork/price-aggregators-bsc)) +- If they are not already added to the Chainlink Aggregation Path contract, as reported by the Price Aggregators subgraph ([Example for Ethereum](https://thegraph.com/explorer/subgraphs/H4knum5YFFtgpWjYDV6xqjkPZprtm7S9jv4UsdnTS1hD?view=Overview&chain=arbitrum-one)) The following commands are also available: