-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoonbeam.ts
99 lines (97 loc) · 2.76 KB
/
moonbeam.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import {
EthereumProject,
EthereumDatasourceKind,
EthereumHandlerKind,
} from "@subql/types-ethereum";
const project: EthereumProject = {
specVersion: "1.0.0",
version: "0.0.1",
name: "synthmos-subquery",
description: "Subquery for the Synthmos protocol Moonbeam router",
runner: {
node: {
name: "@subql/node-ethereum",
version: ">=3.0.0",
},
query: {
name: "@subql/query",
version: "*",
},
},
schema: {
file: "./schema.graphql",
},
network: {
chainId: "1287",
endpoint: [
"https://rpc.testnet.moonbeam.network",
"https://rpc.api.moonbase.moonbeam.network",
"https://moonbase.unitedbloc.com:1000",
],
dictionary: "https://dict-tyk.subquery.network/query/moonbeam"
},
dataSources: [
{
kind: EthereumDatasourceKind.Runtime,
startBlock: 5575642,
options: {
abi: "router",
address: "0x1bc16Bf9615cFd3733F10222b287194CC4953e47",
},
assets: new Map([["router", { file: "./abis/router.abi.json" }]]),
mapping: {
file: "./dist/index.js",
handlers: [
{
kind: EthereumHandlerKind.Event,
handler: "handleDeposit",
filter: {
topics: [
"Deposit(address indexed currency, bytes32 indexed account, uint256 amount)",
],
},
},
{
kind: EthereumHandlerKind.Event,
handler: "handleLowMoonbeam",
filter: {
topics: [
"Low(MarketId indexed id, uint256 indexed roundId, bytes32 indexed account, bytes32 positionId, int256 price, uint256 stake)",
],
},
},
{
kind: EthereumHandlerKind.Event,
handler: "handleHighMoonbeam",
filter: {
topics: [
"High(MarketId indexed id, uint256 indexed roundId, bytes32 indexed account, bytes32 positionId, int256 price, uint256 stake)",
],
},
},
{
kind: EthereumHandlerKind.Event,
handler: "handleWithdrawal",
filter: {
topics: [
"Withdrawal(address indexed currency, bytes32 indexed account, uint256 amount)",
],
},
},
{
kind: EthereumHandlerKind.Event,
handler: "handlePositionSettled",
filter: {
topics: [
"SettlePosition(bytes32 indexed positionId, bytes32 indexed account, uint256 amount)",
],
},
},
],
},
},
],
repository: "https://github.com/cassavalabs/synthmos-subquery",
};
// Must set default to the project instance
export default project;