From ddfaa991f43c3ab4e5d2e6164e87ca816267371e Mon Sep 17 00:00:00 2001 From: Alex Coseru Date: Fri, 16 Apr 2021 14:47:03 +0300 Subject: [PATCH] add moonbeamalpha (#85) * add moonbeamalpha * Update helpers.ts --- package.json | 2 + src/helpers.ts | 2 + subgraph.moonbeamalpha.yaml | 168 ++++++++++++++++++++++++++++++++++++ 3 files changed, 172 insertions(+) create mode 100644 subgraph.moonbeamalpha.yaml diff --git a/package.json b/package.json index 9333c963..6e810a26 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "create:local-rinkeby": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020", "create:local-ropsten": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020", "create:local-polygon": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020", + "create:local-moonbeamalpha": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020", "codegen": "graph codegen --output-dir src/@types", "build": "graph build", "deploy": "graph deploy oceanprotocol/ocean-subgraph --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/", @@ -19,6 +20,7 @@ "deploy:local-rinkeby": "graph deploy oceanprotocol/ocean-subgraph subgraph.rinkeby.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020", "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", "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", + "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", "test": "npm run codegen && npm run lint && npm run type-check", "test-integration": "TS_NODE_PROJECT='test/integration/tsconfig.json' mocha --config=test/integration/.mocharc.json --node-env=test --exit 'test/integration/**/*.test.ts'", "lint": "eslint --ignore-path .gitignore --ext .js --ext .ts --ext .tsx .", diff --git a/src/helpers.ts b/src/helpers.ts index f52b4082..981f20ab 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -39,6 +39,8 @@ function getOceanAddress(): string { if (network == 'ropsten') return '0x5e8dcb2afa23844bcc311b00ad1a0c30025aade9' if (network == 'rinkeby') return '0x8967bcf84170c91b0d24d4302c2376283b0b3a07' if (network == 'polygon') return '0x282d8efce846a88b159800bd4130ad77443fa1a1' + if (network == 'moonbeamalpha') + return '0x3c21a90599b5b7f37014ca5bf30d3f1b73d7e391' return '0x967da4048cd07ab37855c090aaf366e4ce1b9f48' } diff --git a/subgraph.moonbeamalpha.yaml b/subgraph.moonbeamalpha.yaml new file mode 100644 index 00000000..c204ea4b --- /dev/null +++ b/subgraph.moonbeamalpha.yaml @@ -0,0 +1,168 @@ +specVersion: 0.0.2 +description: Ocean provides data sharing through IDOs +repository: https://github.com/oceanprotocol/ocean-subgraph +schema: + file: ./schema.graphql +dataSources: + - kind: ethereum/contract + name: Factory + network: moonbeamalpha + source: + address: '0x30E4CC2C7A9c6aA2b2Ce93586E3Df24a3A00bcDD' + abi: Factory + startBlock: 90715 + mapping: + kind: ethereum/events + apiVersion: 0.0.4 + language: wasm/assemblyscript + file: ./src/mappings/factory.ts + entities: + - PoolFactory + abis: + - name: Factory + file: ./abis/BFactory.json + eventHandlers: + - event: BPoolRegistered(address,indexed address) + handler: handleNewPool + - kind: ethereum/contract + name: DTFactory + network: moonbeamalpha + source: + address: '0x80E63f73cAc60c1662f27D2DFd2EA834acddBaa8' + abi: DTFactory + startBlock: 90711 + mapping: + kind: ethereum/events + apiVersion: 0.0.4 + language: wasm/assemblyscript + file: ./src/mappings/dtfactory.ts + entities: + - DatatokenFactory + abis: + - name: DTFactory + file: ./abis/DTFactory.json + eventHandlers: + - event: TokenRegistered(indexed address,string,string,uint256,indexed address,indexed string) + handler: handleNewToken + - kind: ethereum/contract + name: Metadata + network: moonbeamalpha + source: + address: '0x9C9eE07b8Ce907D2f9244F8317C1Ed29A3193bAe' + abi: Metadata + startBlock: 90719 + mapping: + kind: ethereum/events + apiVersion: 0.0.4 + language: wasm/assemblyscript + file: ./src/mappings/metadata.ts + entities: + - Metadata + abis: + - name: Metadata + file: ./abis/Metadata.json + eventHandlers: + - event: MetadataCreated(indexed address,indexed address,bytes,bytes) + handler: handleMetadataCreated + - event: MetadataUpdated(indexed address,indexed address,bytes,bytes) + handler: handleMetadataUpdated + - kind: ethereum/contract + name: FixedRateExchange + network: moonbeamalpha + source: + address: '0xDEfD0018969cd2d4E648209F876ADe184815f038' + abi: FixedRateExchange + startBlock: 90717 + mapping: + kind: ethereum/events + apiVersion: 0.0.4 + language: wasm/assemblyscript + file: ./src/mappings/fixedrateexchange.ts + entities: + - FixedRateExchange + abis: + - name: FixedRateExchange + file: ./abis/FixedRateExchange.json + eventHandlers: + - event: ExchangeCreated(indexed bytes32,indexed address,indexed address,address,uint256) + handler: handleExchangeCreated + - event: ExchangeActivated(indexed bytes32,indexed address) + handler: handleExchangeActivated + - event: ExchangeDeactivated(indexed bytes32,indexed address) + handler: handleExchangeDeactivated + - event: ExchangeRateChanged(indexed bytes32,indexed address,uint256) + handler: handleExchangeRateChanged + - event: Swapped(indexed bytes32,indexed address,uint256,uint256) + handler: handleSwapped +templates: + - kind: ethereum/contract + name: Pool + network: moonbeamalpha + source: + abi: Pool + mapping: + kind: ethereum/events + apiVersion: 0.0.4 + language: wasm/assemblyscript + file: ./src/mappings/pool.ts + entities: + - Pool + - PoolFactory + - Swap + abis: + - name: Pool + file: ./abis/BPool.json + - name: BToken + file: ./abis/BToken.json + eventHandlers: + - event: LOG_CALL(indexed bytes4,indexed address,bytes) + topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000' + handler: handleSetSwapFee + - event: LOG_CALL(indexed bytes4,indexed address,bytes) + topic0: '0x92eefe9b00000000000000000000000000000000000000000000000000000000' + handler: handleSetController + - event: LOG_CALL(indexed bytes4,indexed address,bytes) + topic0: '0x49b5955200000000000000000000000000000000000000000000000000000000' + handler: handleSetPublicSwap + - event: LOG_CALL(indexed bytes4,indexed address,bytes) + topic0: '0x4bb278f300000000000000000000000000000000000000000000000000000000' + handler: handleFinalize + - event: LOG_CALL(indexed bytes4,indexed address,bytes) + topic0: '0xd1d7bc9100000000000000000000000000000000000000000000000000000000' + handler: handleSetup + - event: LOG_CALL(indexed bytes4,indexed address,bytes) + topic0: '0x3fdddaa200000000000000000000000000000000000000000000000000000000' + handler: handleRebind + - event: LOG_CALL(indexed bytes4,indexed address,bytes) + topic0: '0xe4e1e53800000000000000000000000000000000000000000000000000000000' + handler: handleRebind + - event: LOG_JOIN(indexed address,indexed address,uint256) + handler: handleJoinPool + - event: LOG_EXIT(indexed address,indexed address,uint256) + handler: handleExitPool + - event: LOG_SWAP(indexed address,indexed address,indexed address,uint256,uint256) + handler: handleSwap + - event: Transfer(indexed address,indexed address,uint256) + handler: handleTransfer + + - kind: ethereum/contract + name: DataToken + network: moonbeamalpha + source: + abi: DataToken + mapping: + kind: ethereum/events + apiVersion: 0.0.4 + language: wasm/assemblyscript + file: ./src/mappings/datatoken.ts + entities: + - DataToken + - DatatokenFactory + abis: + - name: DataToken + file: ./abis/DataTokenTemplate.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleTransfer + - event: OrderStarted(indexed address,indexed address,uint256,uint256,uint256,indexed address,uint256) + handler: handleOrderStarted