Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/payment-detection/codegen-near.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion packages/payment-detection/codegen.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
24 changes: 17 additions & 7 deletions packages/payment-detection/src/thegraph/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
};
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion packages/toolbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down