Skip to content

Commit d5c3fca

Browse files
committed
feat: add dataprotector subgraph integration and update poco queries
1 parent 23901de commit d5c3fca

File tree

67 files changed

+162
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+162
-97
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
VITE_POCO_SUBGRAPH_URL="https://thegraph.iex.ec/subgraphs/name/bellecour/poco-v5"
2+
VITE_DATAPROTECTOR_SUBGRAPH_URL="https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2"
23
VITE_REOWN_PROJECT_ID=b89f75687c01fa0df9e68c903283012d

codegenDataprotector.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { CodegenConfig } from '@graphql-codegen/cli'
2+
import * as dotenv from 'dotenv';
3+
4+
dotenv.config();
5+
6+
const config: CodegenConfig = {
7+
schema: process.env.VITE_DATAPROTECTOR_SUBGRAPH_URL,
8+
// documents: ['src/**/*.tsx', "src/**/*.ts"],
9+
ignoreNoDocuments: true,
10+
generates: {
11+
'./src/graphql/dataprotector/': {
12+
preset: 'client',
13+
config: {
14+
documentMode: 'string'
15+
}
16+
},
17+
'./src/graphql/schemaDataProtector.graphql': {
18+
plugins: ['schema-ast'],
19+
config: {
20+
includeDirectives: true
21+
}
22+
}
23+
}
24+
}
25+
26+
export default config

codegenPoco.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ const config: CodegenConfig = {
88
documents: ['src/**/*.tsx', "src/**/*.ts"],
99
ignoreNoDocuments: true,
1010
generates: {
11-
'./src/graphql/': {
11+
'./src/graphql/poco/': {
1212
preset: 'client',
1313
config: {
1414
documentMode: 'string'
1515
}
1616
},
17-
'./schema.graphql': {
17+
'./src/graphql/schemaPoco.graphql': {
1818
plugins: ['schema-ast'],
1919
config: {
2020
includeDirectives: true

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"format": "prettier --write src",
1212
"check-format": "prettier --check src",
1313
"preview": "vite preview",
14-
"codegen": "npm run codegen:poco",
14+
"codegen": "npm run codegen:poco && npm run codegen:dataprotector",
1515
"watch:codegen": "npm run watch:codegen:poco",
1616
"codegen:poco": "graphql-codegen --config codegenPoco.ts",
17+
"codegen:dataprotector": "graphql-codegen --config codegenDataProtector.ts",
1718
"watch:codegen:poco": "graphql-codegen --config codegenPoco.ts --watch"
1819
},
1920
"dependencies": {

src/config.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ export const SUPPORTED_CHAINS = [
2121
color: '#F4942566',
2222
icon: iexecLogo,
2323
blockExplorerUrl: 'https://blockscout-bellecour.iex.ec',
24-
subgraphUrl: 'https://thegraph.iex.ec/subgraphs/name/bellecour/poco-v5',
24+
subgraphUrl: {
25+
poco: 'https://thegraph.iex.ec/subgraphs/name/bellecour/poco-v5',
26+
dataprotector: 'https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector',
27+
},
2528
bridge: 'https://bridge-bellecour.iex.ec/',
2629
bridgeInformation:
2730
'Move your xRLC in your wallet between bellecour and Ethereum Mainnet with our bridge.',
@@ -35,8 +38,10 @@ export const SUPPORTED_CHAINS = [
3538
color: '#28A0F080',
3639
icon: arbitrumSepoliaIcon,
3740
blockExplorerUrl: 'https://arbiscan.io/',
38-
subgraphUrl:
39-
'https://thegraph.arbitrum.iex.ec/api/subgraphs/id/B1comLe9SANBLrjdnoNTJSubbeC7cY7EoNu6zD82HeKy',
41+
subgraphUrl: {
42+
poco: 'https://thegraph.arbitrum.iex.ec/api/subgraphs/id/B1comLe9SANBLrjdnoNTJSubbeC7cY7EoNu6zD82HeKy',
43+
dataprotector: 'TODO',
44+
},
4045
wagmiNetwork: arbitrum,
4146
tokenSymbol: 'RLC',
4247
},
@@ -47,8 +52,10 @@ export const SUPPORTED_CHAINS = [
4752
color: '#28A0F080',
4853
icon: arbitrumSepoliaIcon,
4954
blockExplorerUrl: 'https://sepolia.arbiscan.io/',
50-
subgraphUrl:
51-
'https://thegraph.arbitrum-sepolia-testnet.iex.ec/api/subgraphs/id/2GCj8gzLCihsiEDq8cYvC5nUgK6VfwZ6hm3Wj8A3kcxz',
55+
subgraphUrl: {
56+
poco: 'https://thegraph.arbitrum-sepolia-testnet.iex.ec/api/subgraphs/id/2GCj8gzLCihsiEDq8cYvC5nUgK6VfwZ6hm3Wj8A3kcxz',
57+
dataprotector: 'TODO',
58+
},
5259
wagmiNetwork: arbitrumSepolia,
5360
tokenSymbol: 'RLC',
5461
isExperimental: true,

src/graphql/execute.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/modules/addresses/address/addressQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { graphql } from '@/graphql/gql';
1+
import { graphql } from '@/graphql/poco/gql';
22

33
export const addressQuery = graphql(`
44
query Address($address: ID!) {

src/modules/addresses/address/apps/AddressAppsTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PREVIEW_TABLE_LENGTH, TABLE_REFETCH_INTERVAL } from '@/config';
2-
import { execute } from '@/graphql/execute';
2+
import { execute } from '@/graphql/poco/execute';
33
import { useQuery } from '@tanstack/react-query';
44
import { LoaderCircle } from 'lucide-react';
55
import { DataTable } from '@/components/DataTable';

src/modules/addresses/address/apps/addressAppsQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { graphql } from '@/graphql/gql';
1+
import { graphql } from '@/graphql/poco/gql';
22

33
export const addressAppsQuery = graphql(`
44
query AddressApps(

src/modules/addresses/address/datasets/AddressDatasetsTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PREVIEW_TABLE_LENGTH, TABLE_REFETCH_INTERVAL } from '@/config';
2-
import { execute } from '@/graphql/execute';
2+
import { execute } from '@/graphql/poco/execute';
33
import { useQuery } from '@tanstack/react-query';
44
import { LoaderCircle } from 'lucide-react';
55
import { DataTable } from '@/components/DataTable';

0 commit comments

Comments
 (0)