Skip to content

Commit 7aad411

Browse files
authored
add Gaia-X testnet, BSC & Mumbai (#140)
1 parent 977381f commit 7aad411

5 files changed

+613
-1
lines changed

package.json

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"create:local-ropsten": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
1313
"create:local-polygon": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
1414
"create:local-moonbeamalpha": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
15+
"create:local-gaiaxtestnet": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
16+
"create:local-mumbai": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
17+
"create:local-bsc": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
1518
"codegen": "graph codegen --output-dir src/@types",
1619
"build": "graph build",
1720
"deploy": "graph deploy oceanprotocol/ocean-subgraph --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
@@ -22,6 +25,9 @@
2225
"deploy:local-ropsten": "graph deploy oceanprotocol/ocean-subgraph subgraph.ropsten.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
2326
"deploy:local-polygon": "graph deploy oceanprotocol/ocean-subgraph subgraph.polygon.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
2427
"deploy:local-moonbeamalpha": "graph deploy oceanprotocol/ocean-subgraph subgraph.moonbeamalpha.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
28+
"deploy:local-gaiaxtestnet": "graph deploy oceanprotocol/ocean-subgraph subgraph.gaiaxtestnet.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
29+
"deploy:local-mumbai": "graph deploy oceanprotocol/ocean-subgraph subgraph.mumbai.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
30+
"deploy:local-bsc": "graph deploy oceanprotocol/ocean-subgraph subgraph.bsc.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
2531
"test": "npm run codegen && npm run lint && npm run type-check",
2632
"test-integration": "TS_NODE_PROJECT='test/integration/tsconfig.json' mocha --config=test/integration/.mocharc.json --node-env=test --exit 'test/integration/**/*.test.ts'",
2733
"lint": "eslint --ignore-path .gitignore --ext .js --ext .ts --ext .tsx .",

src/helpers.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ function getOceanAddress(): string {
4141
if (network == 'polygon') return '0x282d8efce846a88b159800bd4130ad77443fa1a1'
4242
if (network == 'moonbeamalpha')
4343
return '0x3c21a90599b5b7f37014ca5bf30d3f1b73d7e391'
44-
44+
if (network == 'gaiaxtestnet')
45+
return '0x80e63f73cac60c1662f27d2dfd2ea834acddbaa8'
46+
if (network == 'mumbai') return '0xd8992ed72c445c35cb4a2be468568ed1079357c8'
47+
if (network == 'bsc') return '0xdce07662ca8ebc241316a15b611c89711414dd1a'
4548
return '0x967da4048cd07ab37855c090aaf366e4ce1b9f48'
4649
}
4750

subgraph.bsc.yaml

+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
specVersion: 0.0.2
2+
description: Ocean provides data sharing through IDOs
3+
repository: https://github.com/oceanprotocol/ocean-subgraph
4+
schema:
5+
file: ./schema.graphql
6+
dataSources:
7+
- kind: ethereum/contract
8+
name: Factory
9+
network: bsc
10+
source:
11+
address: '0xc313e19146Fc9a04470689C9d41a4D3054693531'
12+
abi: Factory
13+
startBlock: 8114772
14+
mapping:
15+
kind: ethereum/events
16+
apiVersion: 0.0.4
17+
language: wasm/assemblyscript
18+
file: ./src/mappings/factory.ts
19+
entities:
20+
- PoolFactory
21+
abis:
22+
- name: Factory
23+
file: ./abis/BFactory.json
24+
eventHandlers:
25+
- event: BPoolRegistered(address,indexed address)
26+
handler: handleNewPool
27+
- kind: ethereum/contract
28+
name: DTFactory
29+
network: bsc
30+
source:
31+
address: '0xE9397625Df9B63f0C152f975234b7988b54710B8'
32+
abi: DTFactory
33+
startBlock: 8114772
34+
mapping:
35+
kind: ethereum/events
36+
apiVersion: 0.0.4
37+
language: wasm/assemblyscript
38+
file: ./src/mappings/dtfactory.ts
39+
entities:
40+
- DatatokenFactory
41+
abis:
42+
- name: DTFactory
43+
file: ./abis/DTFactory.json
44+
eventHandlers:
45+
- event: TokenRegistered(indexed address,string,string,uint256,indexed address,indexed string)
46+
handler: handleNewToken
47+
- kind: ethereum/contract
48+
name: Metadata
49+
network: bsc
50+
source:
51+
address: '0x1d535147a97bd87c8443125376E6671B60556E07'
52+
abi: Metadata
53+
startBlock: 8114772
54+
mapping:
55+
kind: ethereum/events
56+
apiVersion: 0.0.4
57+
language: wasm/assemblyscript
58+
file: ./src/mappings/metadata.ts
59+
entities:
60+
- Metadata
61+
abis:
62+
- name: Metadata
63+
file: ./abis/Metadata.json
64+
eventHandlers:
65+
- event: MetadataCreated(indexed address,indexed address,bytes,bytes)
66+
handler: handleMetadataCreated
67+
- event: MetadataUpdated(indexed address,indexed address,bytes,bytes)
68+
handler: handleMetadataUpdated
69+
- kind: ethereum/contract
70+
name: FixedRateExchange
71+
network: bsc
72+
source:
73+
address: '0x98679D582AB3398C03D3308dEB9c7AeC50B52ded'
74+
abi: FixedRateExchange
75+
startBlock: 8114772
76+
mapping:
77+
kind: ethereum/events
78+
apiVersion: 0.0.4
79+
language: wasm/assemblyscript
80+
file: ./src/mappings/fixedrateexchange.ts
81+
entities:
82+
- FixedRateExchange
83+
abis:
84+
- name: FixedRateExchange
85+
file: ./abis/FixedRateExchange.json
86+
eventHandlers:
87+
- event: ExchangeCreated(indexed bytes32,indexed address,indexed address,address,uint256)
88+
handler: handleExchangeCreated
89+
- event: ExchangeActivated(indexed bytes32,indexed address)
90+
handler: handleExchangeActivated
91+
- event: ExchangeDeactivated(indexed bytes32,indexed address)
92+
handler: handleExchangeDeactivated
93+
- event: ExchangeRateChanged(indexed bytes32,indexed address,uint256)
94+
handler: handleExchangeRateChanged
95+
- event: Swapped(indexed bytes32,indexed address,uint256,uint256)
96+
handler: handleSwapped
97+
- kind: ethereum/contract
98+
name: Dispenser
99+
network: bsc
100+
source:
101+
address: '0xFe7967A5176fDAFa8DE109b3507016B885a82D6e'
102+
abi: Dispenser
103+
startBlock: 8114772
104+
mapping:
105+
kind: ethereum/events
106+
apiVersion: 0.0.4
107+
language: wasm/assemblyscript
108+
file: ./src/mappings/dispenser.ts
109+
entities:
110+
- Dispenser
111+
abis:
112+
- name: Dispenser
113+
file: ./abis/Dispenser.json
114+
eventHandlers:
115+
- event: Activated(indexed address)
116+
handler: handleDispenserActivated
117+
- event: Deactivated(indexed address)
118+
handler: handleDispenserDeactivated
119+
- event: AcceptedMinter(indexed address)
120+
handler: handleDispenserAcceptedMinter
121+
- event: RemovedMinter(indexed address)
122+
handler: handleDispenserRemovedMinter
123+
- event: TokensDispensed(indexed address,indexed address,uint256)
124+
handler: handleDispenserTokensDispensed
125+
- event: OwnerWithdrawed(indexed address,indexed address,uint256)
126+
handler: handleDispenserOwnerWithdrawed
127+
templates:
128+
- kind: ethereum/contract
129+
name: Pool
130+
network: bsc
131+
source:
132+
abi: Pool
133+
mapping:
134+
kind: ethereum/events
135+
apiVersion: 0.0.4
136+
language: wasm/assemblyscript
137+
file: ./src/mappings/pool.ts
138+
entities:
139+
- Pool
140+
- PoolFactory
141+
- Swap
142+
abis:
143+
- name: Pool
144+
file: ./abis/BPool.json
145+
- name: BToken
146+
file: ./abis/BToken.json
147+
eventHandlers:
148+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
149+
topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000'
150+
handler: handleSetSwapFee
151+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
152+
topic0: '0x92eefe9b00000000000000000000000000000000000000000000000000000000'
153+
handler: handleSetController
154+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
155+
topic0: '0x49b5955200000000000000000000000000000000000000000000000000000000'
156+
handler: handleSetPublicSwap
157+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
158+
topic0: '0x4bb278f300000000000000000000000000000000000000000000000000000000'
159+
handler: handleFinalize
160+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
161+
topic0: '0xd1d7bc9100000000000000000000000000000000000000000000000000000000'
162+
handler: handleSetup
163+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
164+
topic0: '0x3fdddaa200000000000000000000000000000000000000000000000000000000'
165+
handler: handleRebind
166+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
167+
topic0: '0xe4e1e53800000000000000000000000000000000000000000000000000000000'
168+
handler: handleRebind
169+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
170+
topic0: '0x8c28cbe800000000000000000000000000000000000000000000000000000000'
171+
handler: handleGulp
172+
- event: LOG_JOIN(indexed address,indexed address,uint256)
173+
handler: handleJoinPool
174+
- event: LOG_EXIT(indexed address,indexed address,uint256)
175+
handler: handleExitPool
176+
- event: LOG_SWAP(indexed address,indexed address,indexed address,uint256,uint256)
177+
handler: handleSwap
178+
- event: Transfer(indexed address,indexed address,uint256)
179+
handler: handleTransfer
180+
181+
- kind: ethereum/contract
182+
name: DataToken
183+
network: bsc
184+
source:
185+
abi: DataToken
186+
mapping:
187+
kind: ethereum/events
188+
apiVersion: 0.0.4
189+
language: wasm/assemblyscript
190+
file: ./src/mappings/datatoken.ts
191+
entities:
192+
- DataToken
193+
- DatatokenFactory
194+
abis:
195+
- name: DataToken
196+
file: ./abis/DataTokenTemplate.json
197+
eventHandlers:
198+
- event: Transfer(indexed address,indexed address,uint256)
199+
handler: handleTransfer
200+
- event: OrderStarted(indexed address,indexed address,uint256,uint256,uint256,indexed address,uint256)
201+
handler: handleOrderStarted

0 commit comments

Comments
 (0)