diff --git a/thegraph/ormpipe/networks.json b/thegraph/ormpipe/networks.json index fd32c06..724fc4c 100644 --- a/thegraph/ormpipe/networks.json +++ b/thegraph/ormpipe/networks.json @@ -9,6 +9,9 @@ }, "OrmpChannel": { "address": "0x12346a7b6aA35A2FD38941485c36A7c84B2936dB" + }, + "AirnodeDapi": { + "address": "0xa681492DBAd5a3999cFCE2d72196d5784dd08D0c" } } -} +} \ No newline at end of file diff --git a/thegraph/ormpipe/schema.graphql b/thegraph/ormpipe/schema.graphql index 85790cf..14b14b8 100644 --- a/thegraph/ormpipe/schema.graphql +++ b/thegraph/ormpipe/schema.graphql @@ -62,3 +62,49 @@ type MessageDispatched @entity(immutable: true) { } ## --- +type AddBeacon @entity(immutable: true) { + id: Bytes! + beaconId: Bytes! # bytes32 + beacon_airnode: Bytes! # address + beacon_endpointId: Bytes! # bytes32 + beacon_sponsor: Bytes! # address + beacon_sponsorWallet: Bytes! # address + blockNumber: BigInt! + blockTimestamp: BigInt! + transactionHash: Bytes! +} + +type AggregatedMessageRoot @entity(immutable: true) { + id: Bytes! + msgRoot: Bytes! # bytes32 + blockNumber: BigInt! + blockTimestamp: BigInt! + transactionHash: Bytes! +} + +type AirnodeRrpCompleted @entity(immutable: true) { + id: Bytes! + beaconId: Bytes! # bytes32 + requestId: Bytes! # bytes32 + data: Bytes! # bytes + blockNumber: BigInt! + blockTimestamp: BigInt! + transactionHash: Bytes! +} + +type AirnodeRrpRequested @entity(immutable: true) { + id: Bytes! + beaconId: Bytes! # bytes32 + requestId: Bytes! # bytes32 + blockNumber: BigInt! + blockTimestamp: BigInt! + transactionHash: Bytes! +} + +type RemoveBeacon @entity(immutable: true) { + id: Bytes! + beaconId: Bytes! # bytes32 + blockNumber: BigInt! + blockTimestamp: BigInt! + transactionHash: Bytes! +} diff --git a/thegraph/ormpipe/subgraph.yaml b/thegraph/ormpipe/subgraph.yaml index 3e31c42..e585dfa 100644 --- a/thegraph/ormpipe/subgraph.yaml +++ b/thegraph/ormpipe/subgraph.yaml @@ -72,3 +72,35 @@ dataSources: - event: MessageDispatched(indexed bytes32,bool) handler: handleMessageDispatched file: ./src/ormp-channel.ts + - kind: ethereum + name: AirnodeDapi + network: arbitrum-goerli + source: + address: "0xa681492DBAd5a3999cFCE2d72196d5784dd08D0c" + abi: AirnodeDapi + startBlock: 34570517 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - AddBeacon + - AggregatedMessageRoot + - AirnodeRrpCompleted + - AirnodeRrpRequested + - RemoveBeacon + abis: + - name: AirnodeDapi + file: ./abis/AirnodeDapi.json + eventHandlers: + - event: AddBeacon(indexed bytes32,(address,bytes32,address,address)) + handler: handleAddBeacon + - event: AggregatedMessageRoot(bytes32) + handler: handleAggregatedMessageRoot + - event: AirnodeRrpCompleted(indexed bytes32,indexed bytes32,bytes) + handler: handleAirnodeRrpCompleted + - event: AirnodeRrpRequested(indexed bytes32,indexed bytes32) + handler: handleAirnodeRrpRequested + - event: RemoveBeacon(indexed bytes32) + handler: handleRemoveBeacon + file: ./src/airnode-dapi.ts diff --git a/thegraph/ormpipe/tests/airnode-dapi.test.ts b/thegraph/ormpipe/tests/airnode-dapi.test.ts index 4d2a52e..c8de2fc 100644 --- a/thegraph/ormpipe/tests/airnode-dapi.test.ts +++ b/thegraph/ormpipe/tests/airnode-dapi.test.ts @@ -6,12 +6,21 @@ import { beforeAll, afterAll } from "matchstick-as/assembly/index" +import { Bytes, Address } from "@graphprotocol/graph-ts" +import { AddBeacon } from "../generated/schema" +import { AddBeacon as AddBeaconEvent } from "../generated/AirnodeDapi/AirnodeDapi" +import { handleAddBeacon } from "../src/airnode-dapi" +import { createAddBeaconEvent } from "./airnode-dapi-utils" // Tests structure (matchstick-as >=0.5.0) // https://thegraph.com/docs/en/developer/matchstick/#tests-structure-0-5-0 describe("Describe entity assertions", () => { beforeAll(() => { + let beaconId = Bytes.fromI32(1234567890) + let beacon = "ethereum.Tuple Not implemented" + let newAddBeaconEvent = createAddBeaconEvent(beaconId, beacon) + handleAddBeacon(newAddBeaconEvent) }) afterAll(() => {