From bf49f1fed8b95f77f9dab824c1a997c44c536852 Mon Sep 17 00:00:00 2001 From: hatem Date: Thu, 22 Feb 2024 11:05:18 +0100 Subject: [PATCH] subgraph --- package.json | 8 ++- subgraph/OKX_X1_testnet-subgraph.yaml | 77 +++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 subgraph/OKX_X1_testnet-subgraph.yaml diff --git a/package.json b/package.json index ab72802a..b1ac63e2 100644 --- a/package.json +++ b/package.json @@ -28,11 +28,15 @@ "graph:linea-deploy": "graph deploy --node https://graph-deploy.linea.build/ --ipfs https://graph-ipfs.linea.build LedgityLabs/LedgityYield ./subgraph/linea-subgraph.yaml", "graph:linea-remove": "graph remove --node https://graph-deploy.linea.build/ LedgityLabs/LedgityYield", "graph:arbitrum-gen": "cd subgraph && graph codegen ./arbitrum-subgraph.yaml && graph build ./arbitrum-subgraph.yaml", - "graph:arbitrum-deploy": "graph deploy --studio ledgity-yield-arbitrum ./subgraph/arbitrum-subgraph.yaml" + "graph:arbitrum-deploy": "graph deploy --studio ledgity-yield-arbitrum ./subgraph/arbitrum-subgraph.yaml", + "graph:OKX_X1_testnet-gen": "cd subgraph && graph codegen ./OKX_X1_testnet-subgraph.yaml && graph build ./OKX_X1_testnet-subgraph.yaml", + "graph:OKX_X1_testnet-create": "graph create --node https://www.okx.com/api/v1/x1-testnet/index/subgraphs/name/LedgityLabs/LedgityYield LedgityLabs/LedgityYield", + "graph:OKX_X1_testnet-deploy": "graph deploy --node https://www.okx.com/api/v1/x1-testnet/subgraph/ LedgityLabs/LedgityYield ./subgraph/OKX_X1_testnet-subgraph.yaml" }, "dependencies": { "@auth/prisma-adapter": "^1.0.11", "@graphprotocol/client-add-source-name": "2.0.0", + "@graphprotocol/graph-cli": "^0.68.0", "@graphql-mesh/transform-prefix": "0.96.5", "@graphql-tools/utils": "9.2.1", "@prisma/client": "^5.7.0", @@ -74,7 +78,7 @@ }, "devDependencies": { "@graphprotocol/client-cli": "3.0.0", - "@graphprotocol/graph-ts": "0.31.0", + "@graphprotocol/graph-ts": "^0.33.0", "@next/bundle-analyzer": "^14.0.0", "@nomicfoundation/hardhat-verify": "^2", "@openzeppelin/contracts": "4.9.0", diff --git a/subgraph/OKX_X1_testnet-subgraph.yaml b/subgraph/OKX_X1_testnet-subgraph.yaml new file mode 100644 index 00000000..05992cea --- /dev/null +++ b/subgraph/OKX_X1_testnet-subgraph.yaml @@ -0,0 +1,77 @@ +specVersion: 0.0.6 +description: A subgraph of Ledgity Yield data +repository: https://github.com/LedgityLabs/LedgityYield +schema: + file: ./schema.graphql +dataSources: + - kind: ethereum/contract + name: LTokenSignaler + network: arbitrum-one + source: + address: "0x1e1B0bB6C182eFD7d64cdAbbF3A3E315dE26E259" + abi: LTokenSignaler + startBlock: 10172276 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + file: ./mapping.ts + entities: + - LToken + abis: + - name: LTokenSignaler + file: ../contracts/abis/LTokenSignaler.json + - name: LToken + file: ../contracts/abis/LToken.json + eventHandlers: + - event: LTokenSignalEvent(indexed address) + handler: handleSignaledLToken + - kind: ethereum/contract + name: PreMining + network: arbitrum-one + source: + address: "0x2Bb79F621518BbA45dA5Ec57BC885C4686A60De9" + abi: PreMining + startBlock: 10172300 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + file: ./mapping.ts + entities: + - PreMining + abis: + - name: PreMining + file: ../contracts/abis/PreMining.json + eventHandlers: + - event: Lock(indexed address,uint256,uint8) + handler: handlePreMiningLock +templates: + - kind: ethereum/contract + name: LToken + network: arbitrum-one + source: + abi: LToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + file: ./mapping.ts + entities: + - LToken + - TVLChange + - APRChange + - Activity + - RewardsMint + abis: + - name: LToken + file: ../contracts/abis/LToken.json + eventHandlers: + - event: TVLChangeEvent(uint256) + handler: handleTVLChangeEvent + - event: APRChangeEvent(uint16) + handler: handleAPRChangeEvent + - event: ActivityEvent(indexed int256,indexed address,indexed uint8,uint256,uint256,uint8,int256) + handler: handleActivityEvent + - event: MintedRewardsEvent(indexed address,uint256,uint256) + handler: handleMintedRewardsEvent