@graphprotocol/graph-cli 0.36.1 → 0.37.1-alpha-20221207192322-dd39b34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +6 -3
- package/src/command-helpers/abi.js +2 -0
- package/src/command-helpers/compiler.js +1 -1
- package/src/command-helpers/network.test.js +13 -10
- package/src/commands/build.js +7 -3
- package/src/commands/codegen.js +5 -0
- package/src/commands/init.js +12 -3
- package/src/compiler/index.js +128 -73
- package/src/debug.js +15 -0
- package/src/protocols/index.js +140 -128
- package/src/protocols/substreams/manifest.graphql +45 -0
- package/src/protocols/substreams/scaffold/manifest.js +13 -0
- package/src/protocols/substreams/subgraph.js +17 -0
- package/src/scaffold/index.js +7 -2
- package/src/subgraph.js +14 -3
- package/tests/cli/validation/call-handler-with-tuple/generated/schema.ts +44 -0
- package/tests/cli/validation/example-values-found/generated/ExampleSubgraph/ExampleContract.ts +35 -0
- package/tests/cli/validation/example-values-found/generated/schema.ts +44 -0
- package/tests/cli/validation/source-without-address-is-valid/generated/ExampleSubgraph/ExampleContract.ts +35 -0
- package/.eslintrc +0 -10
- package/.prettierrc.json +0 -6
- package/.travis.yml +0 -37
- package/CONTRIBUTING.md +0 -16
- package/LICENSE-APACHE +0 -190
- package/LICENSE-MIT +0 -21
- package/NEWS.md +0 -80
- package/README.md +0 -146
- package/examples/basic-event-handlers/LICENSE +0 -21
- package/examples/basic-event-handlers/README.md +0 -3
- package/examples/basic-event-handlers/abis/Gravity.json +0 -1
- package/examples/basic-event-handlers/bin/Counter.bin +0 -1
- package/examples/basic-event-handlers/build/Gravity/Gravity.wasm +0 -0
- package/examples/basic-event-handlers/build/Gravity/abis/Gravity.json +0 -199
- package/examples/basic-event-handlers/build/schema.graphql +0 -13
- package/examples/basic-event-handlers/build/subgraph.yaml +0 -27
- package/examples/basic-event-handlers/contracts/Gravity.sol +0 -62
- package/examples/basic-event-handlers/contracts/Migrations.sol +0 -23
- package/examples/basic-event-handlers/generated/Gravity/Gravity.ts +0 -343
- package/examples/basic-event-handlers/generated/schema.ts +0 -133
- package/examples/basic-event-handlers/migrations/1_initial_migration.js +0 -5
- package/examples/basic-event-handlers/migrations/2_deploy_contract.js +0 -5
- package/examples/basic-event-handlers/migrations/3_create_gravatars.js +0 -14
- package/examples/basic-event-handlers/migrations/4_update_gravatars.js +0 -9
- package/examples/basic-event-handlers/package.json +0 -24
- package/examples/basic-event-handlers/schema.graphql +0 -13
- package/examples/basic-event-handlers/src/mapping.ts +0 -21
- package/examples/basic-event-handlers/subgraph.yaml +0 -27
- package/examples/basic-event-handlers/test/handlers.js +0 -110
- package/examples/basic-event-handlers/truffle.js +0 -34
- package/examples/basic-event-handlers/yarn.lock +0 -1027
- package/examples/example-subgraph/abis/ExampleContract.json +0 -2388
- package/examples/example-subgraph/dist/ExampleSubgraph/ExampleSubgraph.wasm +0 -0
- package/examples/example-subgraph/dist/ExampleSubgraph/abis/ExampleContract.json +0 -2394
- package/examples/example-subgraph/dist/abis/ExampleContract.json +0 -2388
- package/examples/example-subgraph/dist/schema.graphql +0 -37
- package/examples/example-subgraph/dist/subgraph.yaml +0 -26
- package/examples/example-subgraph/package.json +0 -15
- package/examples/example-subgraph/schema.graphql +0 -37
- package/examples/example-subgraph/src/mapping.ts +0 -286
- package/examples/example-subgraph/subgraph.yaml +0 -26
- package/examples/example-subgraph/yarn.lock +0 -28
- package/resources/test/docker-compose-standalone-node.yml +0 -20
- package/resources/test/docker-compose.yml +0 -43
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
type ExampleEntity @entity {
|
|
2
|
-
id: ID!
|
|
3
|
-
|
|
4
|
-
optionalBoolean: Boolean
|
|
5
|
-
requiredBoolean: Boolean!
|
|
6
|
-
optionalBooleanList: [Boolean!]
|
|
7
|
-
requiredBooleanList: [Boolean!]!
|
|
8
|
-
|
|
9
|
-
optionalString: String
|
|
10
|
-
requiredString: String!
|
|
11
|
-
optionalStringList: [String!]
|
|
12
|
-
requiredStringList: [String!]!
|
|
13
|
-
|
|
14
|
-
optionalBytes: Bytes
|
|
15
|
-
requiredBytes: Bytes!
|
|
16
|
-
optionalBytesList: [Bytes!]
|
|
17
|
-
requiredBytesList: [Bytes!]!
|
|
18
|
-
|
|
19
|
-
optionalInt: Int
|
|
20
|
-
requiredInt: Int!
|
|
21
|
-
optionalIntList: [Int!]
|
|
22
|
-
requiredIntList: [Int!]!
|
|
23
|
-
|
|
24
|
-
optionalBigInt: BigInt
|
|
25
|
-
requiredBigInt: BigInt!
|
|
26
|
-
optionalBigIntList: [BigInt!]
|
|
27
|
-
requiredBigIntList: [BigInt!]!
|
|
28
|
-
|
|
29
|
-
optionalReference: OtherEntity
|
|
30
|
-
requiredReference: OtherEntity!
|
|
31
|
-
optionalReferenceList: [OtherEntity!]
|
|
32
|
-
requiredReferenceList: [OtherEntity!]!
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
type OtherEntity @entity {
|
|
36
|
-
id: ID!
|
|
37
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
specVersion: 0.0.5
|
|
2
|
-
description: example of a subgraph
|
|
3
|
-
repository: 'https://github.com/graphprotocol/graph-cli.git'
|
|
4
|
-
schema:
|
|
5
|
-
file: schema.graphql
|
|
6
|
-
dataSources:
|
|
7
|
-
- kind: ethereum/contract
|
|
8
|
-
name: ExampleSubgraph
|
|
9
|
-
network: mainnet
|
|
10
|
-
source:
|
|
11
|
-
address: '0x22843e74c59580b3eaf6c233fa67d8b7c561a835'
|
|
12
|
-
abi: ExampleContract
|
|
13
|
-
mapping:
|
|
14
|
-
kind: ethereum/events
|
|
15
|
-
apiVersion: 0.0.7
|
|
16
|
-
language: wasm/assemblyscript
|
|
17
|
-
file: ExampleSubgraph/ExampleSubgraph.wasm
|
|
18
|
-
entities:
|
|
19
|
-
- ExampleEntity
|
|
20
|
-
- OtherEntity
|
|
21
|
-
abis:
|
|
22
|
-
- name: ExampleContract
|
|
23
|
-
file: ExampleSubgraph/abis/ExampleContract.json
|
|
24
|
-
eventHandlers:
|
|
25
|
-
- event: ExampleEvent(indexed string)
|
|
26
|
-
handler: handleExampleEvent
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "example-event-handler",
|
|
3
|
-
"scripts": {
|
|
4
|
-
"codegen": "../../bin/graph codegen --output-dir src/types/ subgraph.yaml",
|
|
5
|
-
"build": "../../bin/graph build subgraph.yaml",
|
|
6
|
-
"build-ipfs": "../../bin/graph build --ipfs /ip4/127.0.0.1/tcp/5001 subgraph.yaml",
|
|
7
|
-
"build-wast": "../../bin/graph build -t wast subgraph.yaml"
|
|
8
|
-
},
|
|
9
|
-
"devDependencies": {
|
|
10
|
-
"@graphprotocol/graph-ts": "0.28.1"
|
|
11
|
-
},
|
|
12
|
-
"resolutions": {
|
|
13
|
-
"assemblyscript": "0.19.10"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
type ExampleEntity @entity {
|
|
2
|
-
id: ID!
|
|
3
|
-
|
|
4
|
-
optionalBoolean: Boolean
|
|
5
|
-
requiredBoolean: Boolean!
|
|
6
|
-
optionalBooleanList: [Boolean!]
|
|
7
|
-
requiredBooleanList: [Boolean!]!
|
|
8
|
-
|
|
9
|
-
optionalString: String
|
|
10
|
-
requiredString: String!
|
|
11
|
-
optionalStringList: [String!]
|
|
12
|
-
requiredStringList: [String!]!
|
|
13
|
-
|
|
14
|
-
optionalBytes: Bytes
|
|
15
|
-
requiredBytes: Bytes!
|
|
16
|
-
optionalBytesList: [Bytes!]
|
|
17
|
-
requiredBytesList: [Bytes!]!
|
|
18
|
-
|
|
19
|
-
optionalInt: Int
|
|
20
|
-
requiredInt: Int!
|
|
21
|
-
optionalIntList: [Int!]
|
|
22
|
-
requiredIntList: [Int!]!
|
|
23
|
-
|
|
24
|
-
optionalBigInt: BigInt
|
|
25
|
-
requiredBigInt: BigInt!
|
|
26
|
-
optionalBigIntList: [BigInt!]
|
|
27
|
-
requiredBigIntList: [BigInt!]!
|
|
28
|
-
|
|
29
|
-
optionalReference: OtherEntity
|
|
30
|
-
requiredReference: OtherEntity!
|
|
31
|
-
optionalReferenceList: [OtherEntity!]
|
|
32
|
-
requiredReferenceList: [OtherEntity!]!
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
type OtherEntity @entity {
|
|
36
|
-
id: ID!
|
|
37
|
-
}
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Address,
|
|
3
|
-
BigInt,
|
|
4
|
-
Bytes,
|
|
5
|
-
crypto,
|
|
6
|
-
Entity,
|
|
7
|
-
log,
|
|
8
|
-
store,
|
|
9
|
-
} from '@graphprotocol/graph-ts'
|
|
10
|
-
import {
|
|
11
|
-
ExampleContract,
|
|
12
|
-
ExampleEvent,
|
|
13
|
-
} from './../generated/ExampleSubgraph/ExampleContract'
|
|
14
|
-
import { ExampleEntity } from './../generated/schema'
|
|
15
|
-
|
|
16
|
-
export function handleExampleEvent(event: ExampleEvent): void {
|
|
17
|
-
let entity = new ExampleEntity('example id')
|
|
18
|
-
|
|
19
|
-
// Entity field access
|
|
20
|
-
|
|
21
|
-
entity.optionalBoolean = true
|
|
22
|
-
entity.optionalBoolean = false
|
|
23
|
-
entity.optionalBooleanList = [true, false]
|
|
24
|
-
entity.optionalBooleanList = null
|
|
25
|
-
|
|
26
|
-
let optionalBoolean: boolean = entity.optionalBoolean
|
|
27
|
-
let optionalBooleanList: Array<boolean> | null = entity.optionalBooleanList
|
|
28
|
-
|
|
29
|
-
entity.requiredBoolean = true
|
|
30
|
-
entity.requiredBoolean = false
|
|
31
|
-
entity.requiredBooleanList = [true, false]
|
|
32
|
-
|
|
33
|
-
let requiredBoolean: boolean = entity.requiredBoolean
|
|
34
|
-
let requiredBooleanList: Array<boolean> = entity.requiredBooleanList
|
|
35
|
-
|
|
36
|
-
entity.optionalString = 'hello'
|
|
37
|
-
entity.optionalString = null
|
|
38
|
-
entity.optionalStringList = ['hello', 'world']
|
|
39
|
-
entity.optionalStringList = null
|
|
40
|
-
|
|
41
|
-
let optionalString: string | null = entity.optionalString
|
|
42
|
-
let optionalStringList: Array<string> | null = entity.optionalStringList
|
|
43
|
-
|
|
44
|
-
entity.requiredString = 'hello'
|
|
45
|
-
entity.requiredStringList = ['hello', 'world']
|
|
46
|
-
|
|
47
|
-
let requiredString: string = entity.requiredString
|
|
48
|
-
let requiredStringList: Array<string> = entity.requiredStringList
|
|
49
|
-
|
|
50
|
-
entity.optionalInt = 128
|
|
51
|
-
entity.optionalInt = -500
|
|
52
|
-
entity.optionalInt = null
|
|
53
|
-
entity.optionalIntList = [128, -500]
|
|
54
|
-
entity.optionalIntList = null
|
|
55
|
-
|
|
56
|
-
let optionalInt: i32 = entity.optionalInt
|
|
57
|
-
let optionalIntList: Array<i32> | null = entity.optionalIntList
|
|
58
|
-
|
|
59
|
-
entity.requiredInt = 128
|
|
60
|
-
entity.requiredInt = -500
|
|
61
|
-
entity.requiredIntList = [128, -500]
|
|
62
|
-
|
|
63
|
-
let requiredInt: i32 = entity.requiredInt
|
|
64
|
-
let requiredIntList: Array<i32> = entity.requiredIntList
|
|
65
|
-
|
|
66
|
-
entity.optionalBigInt = new BigInt(0)
|
|
67
|
-
entity.optionalBigInt = null
|
|
68
|
-
entity.optionalBigIntList = [new BigInt(0), new BigInt(0)]
|
|
69
|
-
entity.optionalBigIntList = null
|
|
70
|
-
|
|
71
|
-
let optionalBigInt: BigInt | null = entity.optionalBigInt
|
|
72
|
-
let optionalBigIntList: Array<BigInt> | null = entity.optionalBigIntList
|
|
73
|
-
|
|
74
|
-
entity.requiredBigInt = new BigInt(0)
|
|
75
|
-
entity.requiredBigIntList = [new BigInt(0), new BigInt(0)]
|
|
76
|
-
|
|
77
|
-
let requiredBigInt: BigInt = entity.requiredBigInt
|
|
78
|
-
let requiredBigIntList: Array<BigInt> = entity.requiredBigIntList
|
|
79
|
-
|
|
80
|
-
entity.optionalBytes = new Bytes(0)
|
|
81
|
-
entity.optionalBytes = null
|
|
82
|
-
entity.optionalBytesList = [new Bytes(0), new Bytes(0)]
|
|
83
|
-
entity.optionalBytesList = null
|
|
84
|
-
|
|
85
|
-
let optionalBytes: Bytes | null = entity.optionalBytes
|
|
86
|
-
let optionalBytesList: Array<Bytes> | null = entity.optionalBytesList
|
|
87
|
-
|
|
88
|
-
entity.requiredBytes = new Bytes(0)
|
|
89
|
-
entity.requiredBytesList = [new Bytes(0), new Bytes(0)]
|
|
90
|
-
|
|
91
|
-
let requiredBytes: Bytes = entity.requiredBytes
|
|
92
|
-
let requiredBytesList: Array<Bytes> = entity.requiredBytesList
|
|
93
|
-
|
|
94
|
-
entity.optionalReference = 'some-id'
|
|
95
|
-
entity.optionalReference = null
|
|
96
|
-
entity.optionalReferenceList = ['some-id', 'other-id']
|
|
97
|
-
entity.optionalReferenceList = null
|
|
98
|
-
|
|
99
|
-
let optionalReference: string | null = entity.optionalReference
|
|
100
|
-
let optionalReferenceList: Array<string> | null = entity.optionalReferenceList
|
|
101
|
-
|
|
102
|
-
entity.requiredReference = 'some-id'
|
|
103
|
-
entity.requiredReferenceList = ['some-id', 'other-id']
|
|
104
|
-
|
|
105
|
-
let requiredReference: string = entity.requiredReference
|
|
106
|
-
let requiredReferenceList: Array<string> = entity.requiredReferenceList
|
|
107
|
-
|
|
108
|
-
// Smart contract calls
|
|
109
|
-
|
|
110
|
-
let contract = ExampleContract.bind(event.address)
|
|
111
|
-
entity.requiredBytes = contract.getAndReturnAddress(entity.requiredBytes as Address)
|
|
112
|
-
entity.requiredString = contract.getAndReturnString(entity.requiredString)
|
|
113
|
-
entity.requiredBoolean = contract.getAndReturnBool(entity.requiredBoolean)
|
|
114
|
-
entity.requiredBytes = contract.getAndReturnByte(entity.requiredBytes)
|
|
115
|
-
entity.requiredBytes = contract.getAndReturnBytes1(entity.requiredBytes)
|
|
116
|
-
entity.requiredBytes = contract.getAndReturnBytes32(entity.requiredBytes)
|
|
117
|
-
entity.requiredInt = contract.getAndReturnInt8(entity.requiredInt)
|
|
118
|
-
entity.requiredInt = contract.getAndReturnInt16(entity.requiredInt)
|
|
119
|
-
entity.requiredInt = contract.getAndReturnInt24(entity.requiredInt)
|
|
120
|
-
entity.requiredInt = contract.getAndReturnInt32(entity.requiredInt)
|
|
121
|
-
entity.requiredBigInt = contract.getAndReturnInt40(entity.requiredBigInt)
|
|
122
|
-
entity.requiredBigInt = contract.getAndReturnInt56(entity.requiredBigInt)
|
|
123
|
-
entity.requiredBigInt = contract.getAndReturnInt64(entity.requiredBigInt)
|
|
124
|
-
entity.requiredBigInt = contract.getAndReturnInt72(entity.requiredBigInt)
|
|
125
|
-
entity.requiredBigInt = contract.getAndReturnInt80(entity.requiredBigInt)
|
|
126
|
-
entity.requiredBigInt = contract.getAndReturnInt88(entity.requiredBigInt)
|
|
127
|
-
entity.requiredBigInt = contract.getAndReturnInt96(entity.requiredBigInt)
|
|
128
|
-
entity.requiredBigInt = contract.getAndReturnInt104(entity.requiredBigInt)
|
|
129
|
-
entity.requiredBigInt = contract.getAndReturnInt112(entity.requiredBigInt)
|
|
130
|
-
entity.requiredBigInt = contract.getAndReturnInt120(entity.requiredBigInt)
|
|
131
|
-
entity.requiredBigInt = contract.getAndReturnInt128(entity.requiredBigInt)
|
|
132
|
-
entity.requiredBigInt = contract.getAndReturnInt136(entity.requiredBigInt)
|
|
133
|
-
entity.requiredBigInt = contract.getAndReturnInt144(entity.requiredBigInt)
|
|
134
|
-
entity.requiredBigInt = contract.getAndReturnInt152(entity.requiredBigInt)
|
|
135
|
-
entity.requiredBigInt = contract.getAndReturnInt160(entity.requiredBigInt)
|
|
136
|
-
entity.requiredBigInt = contract.getAndReturnInt168(entity.requiredBigInt)
|
|
137
|
-
entity.requiredBigInt = contract.getAndReturnInt176(entity.requiredBigInt)
|
|
138
|
-
entity.requiredBigInt = contract.getAndReturnInt184(entity.requiredBigInt)
|
|
139
|
-
entity.requiredBigInt = contract.getAndReturnInt192(entity.requiredBigInt)
|
|
140
|
-
entity.requiredBigInt = contract.getAndReturnInt200(entity.requiredBigInt)
|
|
141
|
-
entity.requiredBigInt = contract.getAndReturnInt200(entity.requiredBigInt)
|
|
142
|
-
entity.requiredBigInt = contract.getAndReturnInt208(entity.requiredBigInt)
|
|
143
|
-
entity.requiredBigInt = contract.getAndReturnInt216(entity.requiredBigInt)
|
|
144
|
-
entity.requiredBigInt = contract.getAndReturnInt224(entity.requiredBigInt)
|
|
145
|
-
entity.requiredBigInt = contract.getAndReturnInt232(entity.requiredBigInt)
|
|
146
|
-
entity.requiredBigInt = contract.getAndReturnInt240(entity.requiredBigInt)
|
|
147
|
-
entity.requiredBigInt = contract.getAndReturnInt248(entity.requiredBigInt)
|
|
148
|
-
entity.requiredBigInt = contract.getAndReturnInt256(entity.requiredBigInt)
|
|
149
|
-
entity.requiredInt = contract.getAndReturnUint8(entity.requiredInt)
|
|
150
|
-
entity.requiredInt = contract.getAndReturnUint16(entity.requiredInt)
|
|
151
|
-
entity.requiredInt = contract.getAndReturnUint24(entity.requiredInt)
|
|
152
|
-
entity.requiredBigInt = contract.getAndReturnUint32(entity.requiredBigInt)
|
|
153
|
-
entity.requiredBigInt = contract.getAndReturnUint40(entity.requiredBigInt)
|
|
154
|
-
entity.requiredBigInt = contract.getAndReturnUint56(entity.requiredBigInt)
|
|
155
|
-
entity.requiredBigInt = contract.getAndReturnUint64(entity.requiredBigInt)
|
|
156
|
-
entity.requiredBigInt = contract.getAndReturnUint72(entity.requiredBigInt)
|
|
157
|
-
entity.requiredBigInt = contract.getAndReturnUint80(entity.requiredBigInt)
|
|
158
|
-
entity.requiredBigInt = contract.getAndReturnUint88(entity.requiredBigInt)
|
|
159
|
-
entity.requiredBigInt = contract.getAndReturnUint96(entity.requiredBigInt)
|
|
160
|
-
entity.requiredBigInt = contract.getAndReturnUint104(entity.requiredBigInt)
|
|
161
|
-
entity.requiredBigInt = contract.getAndReturnUint112(entity.requiredBigInt)
|
|
162
|
-
entity.requiredBigInt = contract.getAndReturnUint120(entity.requiredBigInt)
|
|
163
|
-
entity.requiredBigInt = contract.getAndReturnUint128(entity.requiredBigInt)
|
|
164
|
-
entity.requiredBigInt = contract.getAndReturnUint136(entity.requiredBigInt)
|
|
165
|
-
entity.requiredBigInt = contract.getAndReturnUint144(entity.requiredBigInt)
|
|
166
|
-
entity.requiredBigInt = contract.getAndReturnUint152(entity.requiredBigInt)
|
|
167
|
-
entity.requiredBigInt = contract.getAndReturnUint160(entity.requiredBigInt)
|
|
168
|
-
entity.requiredBigInt = contract.getAndReturnUint168(entity.requiredBigInt)
|
|
169
|
-
entity.requiredBigInt = contract.getAndReturnUint176(entity.requiredBigInt)
|
|
170
|
-
entity.requiredBigInt = contract.getAndReturnUint184(entity.requiredBigInt)
|
|
171
|
-
entity.requiredBigInt = contract.getAndReturnUint192(entity.requiredBigInt)
|
|
172
|
-
entity.requiredBigInt = contract.getAndReturnUint200(entity.requiredBigInt)
|
|
173
|
-
entity.requiredBigInt = contract.getAndReturnUint200(entity.requiredBigInt)
|
|
174
|
-
entity.requiredBigInt = contract.getAndReturnUint208(entity.requiredBigInt)
|
|
175
|
-
entity.requiredBigInt = contract.getAndReturnUint216(entity.requiredBigInt)
|
|
176
|
-
entity.requiredBigInt = contract.getAndReturnUint224(entity.requiredBigInt)
|
|
177
|
-
entity.requiredBigInt = contract.getAndReturnUint232(entity.requiredBigInt)
|
|
178
|
-
entity.requiredBigInt = contract.getAndReturnUint240(entity.requiredBigInt)
|
|
179
|
-
entity.requiredBigInt = contract.getAndReturnUint248(entity.requiredBigInt)
|
|
180
|
-
entity.requiredBigInt = contract.getAndReturnUint256(entity.requiredBigInt)
|
|
181
|
-
|
|
182
|
-
let addrArray: Array<Address> = contract.getAndReturnAddressArray([
|
|
183
|
-
new Address(0),
|
|
184
|
-
new Address(0),
|
|
185
|
-
])
|
|
186
|
-
entity.requiredStringList = contract.getAndReturnStringArray(entity.requiredStringList)
|
|
187
|
-
entity.requiredBooleanList = contract.getAndReturnBoolArray(entity.requiredBooleanList)
|
|
188
|
-
entity.requiredBytesList = contract.getAndReturnByteArray(entity.requiredBytesList)
|
|
189
|
-
entity.requiredBytesList = contract.getAndReturnBytes1Array(entity.requiredBytesList)
|
|
190
|
-
entity.requiredBytesList = contract.getAndReturnBytes32Array(entity.requiredBytesList)
|
|
191
|
-
entity.requiredIntList = contract.getAndReturnInt8Array(entity.requiredIntList)
|
|
192
|
-
entity.requiredIntList = contract.getAndReturnInt16Array(entity.requiredIntList)
|
|
193
|
-
entity.requiredIntList = contract.getAndReturnInt24Array(entity.requiredIntList)
|
|
194
|
-
contract.getAndReturnInt32Array(entity.requiredIntList)
|
|
195
|
-
entity.requiredBigIntList = contract.getAndReturnInt40Array(entity.requiredBigIntList)
|
|
196
|
-
entity.requiredBigIntList = contract.getAndReturnInt56Array(entity.requiredBigIntList)
|
|
197
|
-
entity.requiredBigIntList = contract.getAndReturnInt64Array(entity.requiredBigIntList)
|
|
198
|
-
entity.requiredBigIntList = contract.getAndReturnInt72Array(entity.requiredBigIntList)
|
|
199
|
-
entity.requiredBigIntList = contract.getAndReturnInt80Array(entity.requiredBigIntList)
|
|
200
|
-
entity.requiredBigIntList = contract.getAndReturnInt88Array(entity.requiredBigIntList)
|
|
201
|
-
entity.requiredBigIntList = contract.getAndReturnInt96Array(entity.requiredBigIntList)
|
|
202
|
-
entity.requiredBigIntList = contract.getAndReturnInt104Array(entity.requiredBigIntList)
|
|
203
|
-
entity.requiredBigIntList = contract.getAndReturnInt112Array(entity.requiredBigIntList)
|
|
204
|
-
entity.requiredBigIntList = contract.getAndReturnInt120Array(entity.requiredBigIntList)
|
|
205
|
-
entity.requiredBigIntList = contract.getAndReturnInt128Array(entity.requiredBigIntList)
|
|
206
|
-
entity.requiredBigIntList = contract.getAndReturnInt136Array(entity.requiredBigIntList)
|
|
207
|
-
entity.requiredBigIntList = contract.getAndReturnInt144Array(entity.requiredBigIntList)
|
|
208
|
-
entity.requiredBigIntList = contract.getAndReturnInt152Array(entity.requiredBigIntList)
|
|
209
|
-
entity.requiredBigIntList = contract.getAndReturnInt160Array(entity.requiredBigIntList)
|
|
210
|
-
entity.requiredBigIntList = contract.getAndReturnInt168Array(entity.requiredBigIntList)
|
|
211
|
-
entity.requiredBigIntList = contract.getAndReturnInt176Array(entity.requiredBigIntList)
|
|
212
|
-
entity.requiredBigIntList = contract.getAndReturnInt184Array(entity.requiredBigIntList)
|
|
213
|
-
entity.requiredBigIntList = contract.getAndReturnInt192Array(entity.requiredBigIntList)
|
|
214
|
-
entity.requiredBigIntList = contract.getAndReturnInt200Array(entity.requiredBigIntList)
|
|
215
|
-
entity.requiredBigIntList = contract.getAndReturnInt200Array(entity.requiredBigIntList)
|
|
216
|
-
entity.requiredBigIntList = contract.getAndReturnInt208Array(entity.requiredBigIntList)
|
|
217
|
-
entity.requiredBigIntList = contract.getAndReturnInt216Array(entity.requiredBigIntList)
|
|
218
|
-
entity.requiredBigIntList = contract.getAndReturnInt224Array(entity.requiredBigIntList)
|
|
219
|
-
entity.requiredBigIntList = contract.getAndReturnInt232Array(entity.requiredBigIntList)
|
|
220
|
-
entity.requiredBigIntList = contract.getAndReturnInt240Array(entity.requiredBigIntList)
|
|
221
|
-
entity.requiredBigIntList = contract.getAndReturnInt248Array(entity.requiredBigIntList)
|
|
222
|
-
entity.requiredBigIntList = contract.getAndReturnInt256Array(entity.requiredBigIntList)
|
|
223
|
-
let u8Array: Array<i32> = contract.getAndReturnUint8Array([1 as i32, 100 as i32])
|
|
224
|
-
let u16Array: Array<i32> = contract.getAndReturnUint16Array([1 as i32, 100 as i32])
|
|
225
|
-
let u24Array: Array<i32> = contract.getAndReturnUint24Array([1 as i32, 100 as i32])
|
|
226
|
-
let u32Array: Array<BigInt> = contract.getAndReturnUint32Array([
|
|
227
|
-
new BigInt(0),
|
|
228
|
-
new BigInt(0),
|
|
229
|
-
])
|
|
230
|
-
entity.requiredBigIntList = contract.getAndReturnUint40Array(entity.requiredBigIntList)
|
|
231
|
-
entity.requiredBigIntList = contract.getAndReturnUint56Array(entity.requiredBigIntList)
|
|
232
|
-
entity.requiredBigIntList = contract.getAndReturnUint64Array(entity.requiredBigIntList)
|
|
233
|
-
entity.requiredBigIntList = contract.getAndReturnUint72Array(entity.requiredBigIntList)
|
|
234
|
-
entity.requiredBigIntList = contract.getAndReturnUint80Array(entity.requiredBigIntList)
|
|
235
|
-
entity.requiredBigIntList = contract.getAndReturnUint88Array(entity.requiredBigIntList)
|
|
236
|
-
entity.requiredBigIntList = contract.getAndReturnUint96Array(entity.requiredBigIntList)
|
|
237
|
-
entity.requiredBigIntList = contract.getAndReturnUint104Array(entity.requiredBigIntList)
|
|
238
|
-
entity.requiredBigIntList = contract.getAndReturnUint112Array(entity.requiredBigIntList)
|
|
239
|
-
entity.requiredBigIntList = contract.getAndReturnUint120Array(entity.requiredBigIntList)
|
|
240
|
-
entity.requiredBigIntList = contract.getAndReturnUint128Array(entity.requiredBigIntList)
|
|
241
|
-
entity.requiredBigIntList = contract.getAndReturnUint136Array(entity.requiredBigIntList)
|
|
242
|
-
entity.requiredBigIntList = contract.getAndReturnUint144Array(entity.requiredBigIntList)
|
|
243
|
-
entity.requiredBigIntList = contract.getAndReturnUint152Array(entity.requiredBigIntList)
|
|
244
|
-
entity.requiredBigIntList = contract.getAndReturnUint160Array(entity.requiredBigIntList)
|
|
245
|
-
entity.requiredBigIntList = contract.getAndReturnUint168Array(entity.requiredBigIntList)
|
|
246
|
-
entity.requiredBigIntList = contract.getAndReturnUint176Array(entity.requiredBigIntList)
|
|
247
|
-
entity.requiredBigIntList = contract.getAndReturnUint184Array(entity.requiredBigIntList)
|
|
248
|
-
entity.requiredBigIntList = contract.getAndReturnUint192Array(entity.requiredBigIntList)
|
|
249
|
-
entity.requiredBigIntList = contract.getAndReturnUint200Array(entity.requiredBigIntList)
|
|
250
|
-
entity.requiredBigIntList = contract.getAndReturnUint200Array(entity.requiredBigIntList)
|
|
251
|
-
entity.requiredBigIntList = contract.getAndReturnUint208Array(entity.requiredBigIntList)
|
|
252
|
-
entity.requiredBigIntList = contract.getAndReturnUint216Array(entity.requiredBigIntList)
|
|
253
|
-
entity.requiredBigIntList = contract.getAndReturnUint224Array(entity.requiredBigIntList)
|
|
254
|
-
entity.requiredBigIntList = contract.getAndReturnUint232Array(entity.requiredBigIntList)
|
|
255
|
-
entity.requiredBigIntList = contract.getAndReturnUint240Array(entity.requiredBigIntList)
|
|
256
|
-
entity.requiredBigIntList = contract.getAndReturnUint248Array(entity.requiredBigIntList)
|
|
257
|
-
entity.requiredBigIntList = contract.getAndReturnUint256Array(entity.requiredBigIntList)
|
|
258
|
-
|
|
259
|
-
// Store access
|
|
260
|
-
|
|
261
|
-
store.set('ExampleEntity', 'example id', entity)
|
|
262
|
-
store.get('ExampleEntity', 'example id')
|
|
263
|
-
store.remove('ExampleEntity', 'example id')
|
|
264
|
-
|
|
265
|
-
// Entity load and save (using the store behind the scenes)
|
|
266
|
-
entity.save()
|
|
267
|
-
let other = ExampleEntity.load('other example id')
|
|
268
|
-
if (other == null) {
|
|
269
|
-
other = new ExampleEntity('other example id')
|
|
270
|
-
}
|
|
271
|
-
other.save()
|
|
272
|
-
|
|
273
|
-
// BigInt math
|
|
274
|
-
let bigIntPlus = entity.requiredBigInt + entity.requiredBigInt
|
|
275
|
-
let bigIntMinus = entity.requiredBigInt - entity.requiredBigInt
|
|
276
|
-
let bigIntTimes = entity.requiredBigInt * entity.requiredBigInt
|
|
277
|
-
let bigIntDividedBy = entity.requiredBigInt / entity.requiredBigInt
|
|
278
|
-
let bigIntMod = entity.requiredBigInt % entity.requiredBigInt
|
|
279
|
-
|
|
280
|
-
// Logging
|
|
281
|
-
log.debug('Hello {}', ['World'])
|
|
282
|
-
log.info('Hello {}', ['World'])
|
|
283
|
-
log.warning('Hello {}', ['World'])
|
|
284
|
-
log.error('Hello {}', ['World'])
|
|
285
|
-
log.critical('Hello {}', ['World'])
|
|
286
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
specVersion: 0.0.5
|
|
2
|
-
description: 'example of a subgraph'
|
|
3
|
-
repository: https://github.com/graphprotocol/graph-cli.git
|
|
4
|
-
schema:
|
|
5
|
-
file: ./schema.graphql
|
|
6
|
-
dataSources:
|
|
7
|
-
- kind: ethereum/contract
|
|
8
|
-
name: ExampleSubgraph
|
|
9
|
-
network: mainnet
|
|
10
|
-
source:
|
|
11
|
-
address: '0x22843e74c59580b3eaf6c233fa67d8b7c561a835'
|
|
12
|
-
abi: ExampleContract
|
|
13
|
-
mapping:
|
|
14
|
-
kind: ethereum/events
|
|
15
|
-
apiVersion: 0.0.7
|
|
16
|
-
language: wasm/assemblyscript
|
|
17
|
-
file: ./src/mapping.ts
|
|
18
|
-
entities:
|
|
19
|
-
- ExampleEntity
|
|
20
|
-
- OtherEntity
|
|
21
|
-
abis:
|
|
22
|
-
- name: ExampleContract
|
|
23
|
-
file: ./abis/ExampleContract.json
|
|
24
|
-
eventHandlers:
|
|
25
|
-
- event: ExampleEvent(indexed string)
|
|
26
|
-
handler: handleExampleEvent
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
-
# yarn lockfile v1
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"@graphprotocol/graph-ts@0.28.1":
|
|
6
|
-
version "0.28.1"
|
|
7
|
-
resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.28.1.tgz#271affc77deb5a4a7c3f95d4b3b1daaa9818e51c"
|
|
8
|
-
integrity sha512-1wMLQ0cu84/6Ml3zcz9ya1zFzrDAzCj0dIGZ7Rz9upnRSXg5jjqU4DefO/OYrl2K2/OPso9hSAr6I4aue2pL1Q==
|
|
9
|
-
dependencies:
|
|
10
|
-
assemblyscript "0.19.10"
|
|
11
|
-
|
|
12
|
-
assemblyscript@0.19.10:
|
|
13
|
-
version "0.19.10"
|
|
14
|
-
resolved "https://registry.yarnpkg.com/assemblyscript/-/assemblyscript-0.19.10.tgz#7ede6d99c797a219beb4fa4614c3eab9e6343c8e"
|
|
15
|
-
integrity sha512-HavcUBXB3mBTRGJcpvaQjmnmaqKHBGREjSPNsIvnAk2f9dj78y4BkMaSSdvBQYWcDDzsHQjyUC8stICFkD1Odg==
|
|
16
|
-
dependencies:
|
|
17
|
-
binaryen "101.0.0-nightly.20210723"
|
|
18
|
-
long "^4.0.0"
|
|
19
|
-
|
|
20
|
-
binaryen@101.0.0-nightly.20210723:
|
|
21
|
-
version "101.0.0-nightly.20210723"
|
|
22
|
-
resolved "https://registry.yarnpkg.com/binaryen/-/binaryen-101.0.0-nightly.20210723.tgz#b6bb7f3501341727681a03866c0856500eec3740"
|
|
23
|
-
integrity sha512-eioJNqhHlkguVSbblHOtLqlhtC882SOEPKmNFZaDuz1hzQjolxZ+eu3/kaS10n3sGPONsIZsO7R9fR00UyhEUA==
|
|
24
|
-
|
|
25
|
-
long@^4.0.0:
|
|
26
|
-
version "4.0.0"
|
|
27
|
-
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
|
|
28
|
-
integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
version: '3'
|
|
2
|
-
services:
|
|
3
|
-
ethereum:
|
|
4
|
-
image: trufflesuite/ganache-cli:latest
|
|
5
|
-
ports:
|
|
6
|
-
- '18545:8545'
|
|
7
|
-
- '18546:8546'
|
|
8
|
-
command: -d -l 100000000000 -g 1 --noVMErrorsOnRPCResponse
|
|
9
|
-
ipfs:
|
|
10
|
-
image: ipfs/go-ipfs:v0.4.23
|
|
11
|
-
ports:
|
|
12
|
-
- '15001:5001'
|
|
13
|
-
postgres:
|
|
14
|
-
image: postgres
|
|
15
|
-
ports:
|
|
16
|
-
- '15432:5432'
|
|
17
|
-
environment:
|
|
18
|
-
POSTGRES_USER: graph
|
|
19
|
-
POSTGRES_PASSWORD: let-me-in
|
|
20
|
-
POSTGRES_DB: graph
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
version: '3'
|
|
2
|
-
services:
|
|
3
|
-
graph-node:
|
|
4
|
-
# TODO: change to "latest" once it supports apiVersion 0.0.5 and specVersion 0.0.7
|
|
5
|
-
image: graphprotocol/graph-node:4a8e819
|
|
6
|
-
ports:
|
|
7
|
-
- '18000:8000'
|
|
8
|
-
- '18001:8001'
|
|
9
|
-
- '18020:8020'
|
|
10
|
-
- '18030:8030'
|
|
11
|
-
- '18040:8040'
|
|
12
|
-
depends_on:
|
|
13
|
-
- ipfs
|
|
14
|
-
- ethereum
|
|
15
|
-
- postgres
|
|
16
|
-
environment:
|
|
17
|
-
postgres_host: postgres
|
|
18
|
-
postgres_user: graph
|
|
19
|
-
postgres_pass: let-me-in
|
|
20
|
-
postgres_db: graph
|
|
21
|
-
ipfs: 'ipfs:5001'
|
|
22
|
-
ethereum: 'test:http://ethereum:8545'
|
|
23
|
-
GRAPH_LOG: trace
|
|
24
|
-
GRAPH_MAX_API_VERSION: '0.0.7' # TODO: remove once "latest" supports apiVersion 0.0.7 by default
|
|
25
|
-
GRAPH_MAX_SPEC_VERSION: '0.0.5' # TODO: remove once "latest" supports specVersion 0.0.5 by default
|
|
26
|
-
ethereum:
|
|
27
|
-
image: trufflesuite/ganache-cli:latest
|
|
28
|
-
ports:
|
|
29
|
-
- '18545:8545'
|
|
30
|
-
- '18546:8546'
|
|
31
|
-
command: -d -l 100000000000 -g 1 --noVMErrorsOnRPCResponse
|
|
32
|
-
ipfs:
|
|
33
|
-
image: ipfs/go-ipfs:v0.4.23
|
|
34
|
-
ports:
|
|
35
|
-
- '15001:5001'
|
|
36
|
-
postgres:
|
|
37
|
-
image: postgres
|
|
38
|
-
ports:
|
|
39
|
-
- '15432:5432'
|
|
40
|
-
environment:
|
|
41
|
-
POSTGRES_USER: graph
|
|
42
|
-
POSTGRES_PASSWORD: let-me-in
|
|
43
|
-
POSTGRES_DB: graph
|