@graphprotocol/graph-cli 0.30.0-alpha.0 → 0.30.1
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/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/chain/arweave.ts +76 -0
- package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/chain/cosmos.ts +341 -0
- package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/chain/ethereum.ts +39 -0
- package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/global/global.ts +286 -142
- package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/index.ts +4 -2
- package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/package.json +2 -1
- package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/test/test.js +4 -2
- package/examples/basic-event-handlers/node_modules/keccak/build/config.gypi +300 -125
- package/examples/basic-event-handlers/node_modules/websocket/build/config.gypi +292 -15
- package/examples/basic-event-handlers/package.json +1 -1
- package/examples/basic-event-handlers/yarn.lock +4 -4
- package/examples/example-subgraph/package.json +1 -1
- package/examples/example-subgraph/yarn.lock +4 -4
- package/package.json +1 -1
- package/resources/test/docker-compose.yml +4 -2
- package/src/codegen/schema.js +8 -45
- package/src/codegen/schema.test.js +102 -6
- package/src/codegen/types/conversions.js +19 -19
- package/src/codegen/types/index.js +0 -25
- package/src/codegen/types/index.test.js +0 -22
- package/src/command-helpers/abi.js +69 -0
- package/src/command-helpers/scaffold.js +67 -0
- package/src/commands/add.js +198 -0
- package/src/commands/init.js +25 -71
- package/src/migrations/spec_version_0_0_2.js +1 -1
- package/src/migrations/{spec_version_0_0_4.js → spec_version_0_0_3.js} +10 -6
- package/src/migrations.js +1 -1
- package/src/protocols/arweave/manifest.graphql +57 -0
- package/src/protocols/arweave/scaffold/manifest.js +19 -0
- package/src/protocols/arweave/scaffold/mapping.js +53 -0
- package/src/protocols/arweave/subgraph.js +20 -0
- package/src/protocols/{tendermint → cosmos}/manifest.graphql +6 -0
- package/src/protocols/cosmos/scaffold/manifest.js +16 -0
- package/src/protocols/cosmos/scaffold/mapping.js +39 -0
- package/src/protocols/{tendermint → cosmos}/subgraph.js +2 -1
- package/src/protocols/ethereum/codegen/abi.js +21 -4
- package/src/protocols/ethereum/scaffold/manifest.js +2 -1
- package/src/protocols/index.js +53 -20
- package/src/protocols/near/manifest.graphql +1 -0
- package/src/protocols/near/scaffold/manifest.js +4 -2
- package/src/scaffold/cosmos.test.js +86 -0
- package/src/scaffold/ethereum.test.js +2 -1
- package/src/scaffold/index.js +5 -3
- package/src/scaffold/near.test.js +2 -1
- package/src/validation/manifest.js +52 -12
- package/src/validation/schema.js +2 -0
- package/tests/cli/validation/conflicting-protocol-names/Abi.json +7 -0
- package/tests/cli/validation/conflicting-protocol-names/mapping.ts +0 -0
- package/tests/cli/validation/conflicting-protocol-names/schema.graphql +3 -0
- package/tests/cli/validation/conflicting-protocol-names/subgraph.yaml +41 -0
- package/tests/cli/validation/conflicting-protocol-names.stderr +10 -0
- package/tests/cli/validation.test.js +9 -0
- package/examples/basic-event-handlers/node_modules/@graphprotocol/graph-ts/chain/tendermint.ts +0 -554
- package/examples/basic-event-handlers/node_modules/keccak/build/Makefile +0 -342
- package/examples/basic-event-handlers/node_modules/keccak/build/Release/.deps/Release/obj.target/keccak/src/addon.o.d.raw +0 -27
- package/examples/basic-event-handlers/node_modules/keccak/build/binding.Makefile +0 -6
- package/examples/basic-event-handlers/node_modules/keccak/build/gyp-mac-tool +0 -615
- package/examples/basic-event-handlers/node_modules/keccak/build/keccak.target.mk +0 -209
- package/examples/basic-event-handlers/node_modules/websocket/build/Makefile +0 -347
- package/examples/basic-event-handlers/node_modules/websocket/build/Release/.deps/Release/obj.target/bufferutil/src/bufferutil.o.d.raw +0 -25
- package/examples/basic-event-handlers/node_modules/websocket/build/binding.Makefile +0 -6
- package/examples/basic-event-handlers/node_modules/websocket/build/bufferutil.target.mk +0 -192
- package/examples/basic-event-handlers/node_modules/websocket/build/gyp-mac-tool +0 -615
- package/examples/basic-event-handlers/node_modules/websocket/build/validation.target.mk +0 -192
- package/src/codegen/types/defaults.js +0 -34
- package/src/migrations/mapping_api_version_0_0_6.js +0 -74
|
@@ -8,10 +8,26 @@ import {
|
|
|
8
8
|
Wrapped,
|
|
9
9
|
} from '../common/collections'
|
|
10
10
|
import { JSONValue, Value } from '../common/value'
|
|
11
|
+
import { arweave } from '../chain/arweave'
|
|
11
12
|
import { ethereum } from '../chain/ethereum'
|
|
12
13
|
import { near } from '../chain/near'
|
|
13
|
-
import {
|
|
14
|
+
import { cosmos } from '../chain/cosmos'
|
|
14
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Contains type IDs and their discriminants for every blockchain supported by Graph-Node.
|
|
18
|
+
*
|
|
19
|
+
* Each variant corresponds to the unique ID of an AssemblyScript concrete class used by
|
|
20
|
+
* Graph-Node's runtime.
|
|
21
|
+
*
|
|
22
|
+
* # Rules for updating this enum
|
|
23
|
+
*
|
|
24
|
+
* 1. The discriminants must have the same value as their counterparts in `IndexForAscTypeId` enum
|
|
25
|
+
* from `graph-node`'s `graph::runtime` module. If not, the runtime will fail to determine the
|
|
26
|
+
* correct class during allocation.
|
|
27
|
+
* 2. Each supported blockchain has a reserved space of 1,000 * contiguous variants.
|
|
28
|
+
* 3. Once defined, items and their discriminants cannot be changed, as this would break running
|
|
29
|
+
* subgraphs compiled in previous versions of this representation.
|
|
30
|
+
*/
|
|
15
31
|
export enum TypeId {
|
|
16
32
|
String = 0,
|
|
17
33
|
ArrayBuffer = 1,
|
|
@@ -65,6 +81,8 @@ export enum TypeId {
|
|
|
65
81
|
ArrayF32 = 49,
|
|
66
82
|
ArrayF64 = 50,
|
|
67
83
|
ArrayBigDecimal = 51,
|
|
84
|
+
|
|
85
|
+
// Near types
|
|
68
86
|
NearArrayDataReceiver = 52,
|
|
69
87
|
NearArrayCryptoHash = 53,
|
|
70
88
|
NearArrayActionValue = 54,
|
|
@@ -75,7 +93,7 @@ export enum TypeId {
|
|
|
75
93
|
NearArrayChunkHeader = 59,
|
|
76
94
|
NearAccessKeyPermissionValue = 60,
|
|
77
95
|
NearActionValue = 61,
|
|
78
|
-
NearDirection = 62, // not used in graph-node
|
|
96
|
+
NearDirection = 62, // not used in graph-node anymore. Can be ignored.
|
|
79
97
|
NearPublicKey = 63,
|
|
80
98
|
NearSignature = 64,
|
|
81
99
|
NearFunctionCallPermission = 65,
|
|
@@ -100,53 +118,124 @@ export enum TypeId {
|
|
|
100
118
|
NearChunkHeader = 84,
|
|
101
119
|
NearBlock = 85,
|
|
102
120
|
NearReceiptWithOutcome = 86,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
121
|
+
/*
|
|
122
|
+
Reserved discriminant space for more Near type IDs: [87, 999]:
|
|
123
|
+
Continue to add more Near type IDs here. e.g.:
|
|
124
|
+
```
|
|
125
|
+
NextNearType = 87,
|
|
126
|
+
AnotherNearType = 88,
|
|
127
|
+
...
|
|
128
|
+
LastNearType = 999,
|
|
129
|
+
```
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
// Reserved discriminant space for more Ethereum type IDs: [1000, 1499]
|
|
133
|
+
TransactionReceipt = 1000,
|
|
134
|
+
Log = 1001,
|
|
135
|
+
ArrayH256 = 1002,
|
|
136
|
+
ArrayLog = 1003,
|
|
137
|
+
/*
|
|
138
|
+
Continue to add more Ethereum type IDs here. e.g.:
|
|
139
|
+
```
|
|
140
|
+
NextEthereumType = 1004,
|
|
141
|
+
AnotherEthereumType = 1005,
|
|
142
|
+
...
|
|
143
|
+
LastEthereumType = 1499,
|
|
144
|
+
```
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
// Reserved discriminant space for Cosmos type IDs: [1,500, 2,499]
|
|
148
|
+
CosmosAny = 1500,
|
|
149
|
+
CosmosArrayAny = 1501,
|
|
150
|
+
CosmosArrayBytes = 1502,
|
|
151
|
+
CosmosArrayCoin = 1503,
|
|
152
|
+
CosmosArrayCommitSig = 1504,
|
|
153
|
+
CosmosArrayEvent = 1505,
|
|
154
|
+
CosmosArrayEventAttribute = 1506,
|
|
155
|
+
CosmosArrayEvidence = 1507,
|
|
156
|
+
CosmosArrayModeInfo = 1508,
|
|
157
|
+
CosmosArraySignerInfo = 1509,
|
|
158
|
+
CosmosArrayTxResult = 1510,
|
|
159
|
+
CosmosArrayValidator = 1511,
|
|
160
|
+
CosmosArrayValidatorUpdate = 1512,
|
|
161
|
+
CosmosAuthInfo = 1513,
|
|
162
|
+
CosmosBlock = 1514,
|
|
163
|
+
CosmosBlockID = 1515,
|
|
164
|
+
CosmosBlockIDFlagEnum = 1516,
|
|
165
|
+
CosmosBlockParams = 1517,
|
|
166
|
+
CosmosCoin = 1518,
|
|
167
|
+
CosmosCommit = 1519,
|
|
168
|
+
CosmosCommitSig = 1520,
|
|
169
|
+
CosmosCompactBitArray = 1521,
|
|
170
|
+
CosmosConsensus = 1522,
|
|
171
|
+
CosmosConsensusParams = 1523,
|
|
172
|
+
CosmosDuplicateVoteEvidence = 1524,
|
|
173
|
+
CosmosDuration = 1525,
|
|
174
|
+
CosmosEvent = 1526,
|
|
175
|
+
CosmosEventAttribute = 1527,
|
|
176
|
+
CosmosEventData = 1528,
|
|
177
|
+
CosmosEventVote = 1529,
|
|
178
|
+
CosmosEvidence = 1530,
|
|
179
|
+
CosmosEvidenceList = 1531,
|
|
180
|
+
CosmosEvidenceParams = 1532,
|
|
181
|
+
CosmosFee = 1533,
|
|
182
|
+
CosmosHeader = 1534,
|
|
183
|
+
CosmosHeaderOnlyBlock = 1535,
|
|
184
|
+
CosmosLightBlock = 1536,
|
|
185
|
+
CosmosLightClientAttackEvidence = 1537,
|
|
186
|
+
CosmosModeInfo = 1538,
|
|
187
|
+
CosmosModeInfoMulti = 1539,
|
|
188
|
+
CosmosModeInfoSingle = 1540,
|
|
189
|
+
CosmosPartSetHeader = 1541,
|
|
190
|
+
CosmosPublicKey = 1542,
|
|
191
|
+
CosmosResponseBeginBlock = 1543,
|
|
192
|
+
CosmosResponseDeliverTx = 1544,
|
|
193
|
+
CosmosResponseEndBlock = 1545,
|
|
194
|
+
CosmosSignModeEnum = 1546,
|
|
195
|
+
CosmosSignedHeader = 1547,
|
|
196
|
+
CosmosSignedMsgTypeEnum = 1548,
|
|
197
|
+
CosmosSignerInfo = 1549,
|
|
198
|
+
CosmosTimestamp = 1550,
|
|
199
|
+
CosmosTip = 1551,
|
|
200
|
+
CosmosTransactionData = 1552,
|
|
201
|
+
CosmosTx = 1553,
|
|
202
|
+
CosmosTxBody = 1554,
|
|
203
|
+
CosmosTxResult = 1555,
|
|
204
|
+
CosmosValidator = 1556,
|
|
205
|
+
CosmosValidatorParams = 1557,
|
|
206
|
+
CosmosValidatorSet = 1558,
|
|
207
|
+
CosmosValidatorSetUpdates = 1559,
|
|
208
|
+
CosmosValidatorUpdate = 1560,
|
|
209
|
+
CosmosVersionParams = 1561,
|
|
210
|
+
/*
|
|
211
|
+
Continue to add more Cosmos type IDs here. e.g.:
|
|
212
|
+
```
|
|
213
|
+
NextCosmosType = 1562,
|
|
214
|
+
AnotherCosmosType = 1563,
|
|
215
|
+
...
|
|
216
|
+
LastCosmosType = 2499,
|
|
217
|
+
```
|
|
218
|
+
*/
|
|
219
|
+
|
|
220
|
+
// Reserved discriminant space for Tendermint type IDs: [2,500, 3,499]
|
|
221
|
+
ArweaveBlock = 2500,
|
|
222
|
+
ArweaveProofOfAccess = 2501,
|
|
223
|
+
ArweaveTag = 2502,
|
|
224
|
+
ArweaveTagArray = 2503,
|
|
225
|
+
ArweaveTransaction = 2504,
|
|
226
|
+
ArweaveTransactionArray = 2505,
|
|
227
|
+
ArweaveTransactionWithBlockPtr = 2506,
|
|
228
|
+
/*
|
|
229
|
+
Continue to add more Arweave type IDs here. e.g.:
|
|
230
|
+
```
|
|
231
|
+
NextArweaveType = 2507,
|
|
232
|
+
AnotherArweaveType = 2508,
|
|
233
|
+
...
|
|
234
|
+
LastArweaveType = 3499,
|
|
235
|
+
```
|
|
236
|
+
*/
|
|
237
|
+
|
|
238
|
+
// Reserved discriminant space for a future blockchain type IDs: [3,500, 4,499]
|
|
150
239
|
}
|
|
151
240
|
|
|
152
241
|
export function id_of_type(typeId: TypeId): usize {
|
|
@@ -326,100 +415,155 @@ export function id_of_type(typeId: TypeId): usize {
|
|
|
326
415
|
return idof<near.Block>()
|
|
327
416
|
case TypeId.NearReceiptWithOutcome:
|
|
328
417
|
return idof<near.ReceiptWithOutcome>()
|
|
329
|
-
case TypeId.
|
|
330
|
-
return idof<
|
|
331
|
-
case TypeId.
|
|
332
|
-
return idof<
|
|
333
|
-
case TypeId.
|
|
334
|
-
return idof<Array<
|
|
335
|
-
case TypeId.
|
|
418
|
+
case TypeId.TransactionReceipt:
|
|
419
|
+
return idof<ethereum.TransactionReceipt>()
|
|
420
|
+
case TypeId.Log:
|
|
421
|
+
return idof<ethereum.Log>()
|
|
422
|
+
case TypeId.ArrayH256:
|
|
423
|
+
return idof<Array<Uint8Array>>()
|
|
424
|
+
case TypeId.ArrayLog:
|
|
425
|
+
return idof<Array<ethereum.Log>>()
|
|
426
|
+
case TypeId.CosmosAny:
|
|
427
|
+
return idof<cosmos.Any>()
|
|
428
|
+
case TypeId.CosmosArrayAny:
|
|
429
|
+
return idof<Array<cosmos.Any>>()
|
|
430
|
+
case TypeId.CosmosArrayBytes:
|
|
336
431
|
return idof<Array<Bytes>>()
|
|
337
|
-
case TypeId.
|
|
338
|
-
return idof<Array<
|
|
339
|
-
case TypeId.
|
|
340
|
-
return idof<Array<
|
|
341
|
-
case TypeId.
|
|
342
|
-
return idof<Array<
|
|
343
|
-
case TypeId.
|
|
344
|
-
return idof<Array<
|
|
345
|
-
case TypeId.
|
|
346
|
-
return idof<
|
|
347
|
-
case TypeId.
|
|
348
|
-
return idof<
|
|
349
|
-
case TypeId.
|
|
350
|
-
return idof<
|
|
351
|
-
case TypeId.
|
|
352
|
-
return idof<
|
|
353
|
-
case TypeId.
|
|
354
|
-
return idof<
|
|
355
|
-
case TypeId.
|
|
356
|
-
return idof<Array<
|
|
357
|
-
case TypeId.
|
|
358
|
-
return idof<
|
|
359
|
-
case TypeId.
|
|
360
|
-
return idof<
|
|
361
|
-
case TypeId.
|
|
362
|
-
return idof<
|
|
363
|
-
case TypeId.
|
|
364
|
-
return idof<
|
|
365
|
-
case TypeId.
|
|
366
|
-
return idof<
|
|
367
|
-
case TypeId.
|
|
368
|
-
return idof<
|
|
369
|
-
case TypeId.
|
|
370
|
-
return idof<
|
|
371
|
-
case TypeId.
|
|
372
|
-
return idof<
|
|
373
|
-
case TypeId.
|
|
374
|
-
return idof<
|
|
375
|
-
case TypeId.
|
|
376
|
-
return idof<
|
|
377
|
-
case TypeId.
|
|
378
|
-
return idof<
|
|
379
|
-
case TypeId.
|
|
380
|
-
return idof<
|
|
381
|
-
case TypeId.
|
|
382
|
-
return idof<
|
|
383
|
-
case TypeId.
|
|
384
|
-
return idof<
|
|
385
|
-
case TypeId.
|
|
386
|
-
return idof<
|
|
387
|
-
case TypeId.
|
|
388
|
-
return idof<
|
|
389
|
-
case TypeId.
|
|
390
|
-
return idof<
|
|
391
|
-
case TypeId.
|
|
392
|
-
return idof<
|
|
393
|
-
case TypeId.
|
|
394
|
-
return idof<
|
|
395
|
-
case TypeId.
|
|
396
|
-
return idof<
|
|
397
|
-
case TypeId.
|
|
398
|
-
return idof<
|
|
399
|
-
case TypeId.
|
|
400
|
-
return idof<
|
|
401
|
-
case TypeId.
|
|
402
|
-
return idof<
|
|
403
|
-
case TypeId.
|
|
404
|
-
return idof<
|
|
405
|
-
case TypeId.
|
|
406
|
-
return idof<
|
|
407
|
-
case TypeId.
|
|
408
|
-
return idof<
|
|
409
|
-
case TypeId.
|
|
410
|
-
return idof<
|
|
411
|
-
case TypeId.
|
|
412
|
-
return idof<
|
|
413
|
-
case TypeId.
|
|
414
|
-
return idof<
|
|
415
|
-
case TypeId.
|
|
416
|
-
return idof<
|
|
417
|
-
case TypeId.
|
|
418
|
-
return idof<
|
|
419
|
-
case TypeId.
|
|
420
|
-
return idof<
|
|
421
|
-
case TypeId.
|
|
422
|
-
return idof<
|
|
432
|
+
case TypeId.CosmosArrayCoin:
|
|
433
|
+
return idof<Array<cosmos.Coin>>()
|
|
434
|
+
case TypeId.CosmosArrayCommitSig:
|
|
435
|
+
return idof<Array<cosmos.CommitSig>>()
|
|
436
|
+
case TypeId.CosmosArrayEvent:
|
|
437
|
+
return idof<Array<cosmos.Event>>()
|
|
438
|
+
case TypeId.CosmosArrayEventAttribute:
|
|
439
|
+
return idof<Array<cosmos.EventAttribute>>()
|
|
440
|
+
case TypeId.CosmosArrayEvidence:
|
|
441
|
+
return idof<Array<cosmos.Evidence>>()
|
|
442
|
+
case TypeId.CosmosArrayModeInfo:
|
|
443
|
+
return idof<Array<cosmos.ModeInfo>>()
|
|
444
|
+
case TypeId.CosmosArraySignerInfo:
|
|
445
|
+
return idof<Array<cosmos.SignerInfo>>()
|
|
446
|
+
case TypeId.CosmosArrayTxResult:
|
|
447
|
+
return idof<Array<cosmos.TxResult>>()
|
|
448
|
+
case TypeId.CosmosArrayValidator:
|
|
449
|
+
return idof<Array<cosmos.Validator>>()
|
|
450
|
+
case TypeId.CosmosArrayValidatorUpdate:
|
|
451
|
+
return idof<Array<cosmos.ValidatorUpdate>>()
|
|
452
|
+
case TypeId.CosmosAuthInfo:
|
|
453
|
+
return idof<cosmos.AuthInfo>()
|
|
454
|
+
case TypeId.CosmosBlock:
|
|
455
|
+
return idof<cosmos.Block>()
|
|
456
|
+
case TypeId.CosmosBlockID:
|
|
457
|
+
return idof<cosmos.BlockID>()
|
|
458
|
+
case TypeId.CosmosBlockIDFlagEnum:
|
|
459
|
+
return idof<Array<cosmos.BlockIDFlag>>()
|
|
460
|
+
case TypeId.CosmosBlockParams:
|
|
461
|
+
return idof<cosmos.BlockParams>()
|
|
462
|
+
case TypeId.CosmosCoin:
|
|
463
|
+
return idof<cosmos.Coin>()
|
|
464
|
+
case TypeId.CosmosCommit:
|
|
465
|
+
return idof<cosmos.Commit>()
|
|
466
|
+
case TypeId.CosmosCommitSig:
|
|
467
|
+
return idof<cosmos.CommitSig>()
|
|
468
|
+
case TypeId.CosmosCompactBitArray:
|
|
469
|
+
return idof<cosmos.CompactBitArray>()
|
|
470
|
+
case TypeId.CosmosConsensus:
|
|
471
|
+
return idof<cosmos.Consensus>()
|
|
472
|
+
case TypeId.CosmosConsensusParams:
|
|
473
|
+
return idof<cosmos.ConsensusParams>()
|
|
474
|
+
case TypeId.CosmosDuplicateVoteEvidence:
|
|
475
|
+
return idof<cosmos.DuplicateVoteEvidence>()
|
|
476
|
+
case TypeId.CosmosDuration:
|
|
477
|
+
return idof<cosmos.Duration>()
|
|
478
|
+
case TypeId.CosmosEvent:
|
|
479
|
+
return idof<cosmos.Event>()
|
|
480
|
+
case TypeId.CosmosEventAttribute:
|
|
481
|
+
return idof<cosmos.EventAttribute>()
|
|
482
|
+
case TypeId.CosmosEventData:
|
|
483
|
+
return idof<cosmos.EventData>()
|
|
484
|
+
case TypeId.CosmosEventVote:
|
|
485
|
+
return idof<cosmos.EventVote>()
|
|
486
|
+
case TypeId.CosmosEvidence:
|
|
487
|
+
return idof<cosmos.Evidence>()
|
|
488
|
+
case TypeId.CosmosEvidenceList:
|
|
489
|
+
return idof<cosmos.EvidenceList>()
|
|
490
|
+
case TypeId.CosmosEvidenceParams:
|
|
491
|
+
return idof<cosmos.EvidenceParams>()
|
|
492
|
+
case TypeId.CosmosFee:
|
|
493
|
+
return idof<cosmos.Fee>()
|
|
494
|
+
case TypeId.CosmosHeader:
|
|
495
|
+
return idof<cosmos.Header>()
|
|
496
|
+
case TypeId.CosmosHeaderOnlyBlock:
|
|
497
|
+
return idof<cosmos.HeaderOnlyBlock>()
|
|
498
|
+
case TypeId.CosmosLightBlock:
|
|
499
|
+
return idof<cosmos.LightBlock>()
|
|
500
|
+
case TypeId.CosmosLightClientAttackEvidence:
|
|
501
|
+
return idof<cosmos.LightClientAttackEvidence>()
|
|
502
|
+
case TypeId.CosmosModeInfo:
|
|
503
|
+
return idof<cosmos.ModeInfo>()
|
|
504
|
+
case TypeId.CosmosModeInfoMulti:
|
|
505
|
+
return idof<cosmos.ModeInfoMulti>()
|
|
506
|
+
case TypeId.CosmosModeInfoSingle:
|
|
507
|
+
return idof<cosmos.ModeInfoSingle>()
|
|
508
|
+
case TypeId.CosmosPartSetHeader:
|
|
509
|
+
return idof<cosmos.PartSetHeader>()
|
|
510
|
+
case TypeId.CosmosPublicKey:
|
|
511
|
+
return idof<cosmos.PublicKey>()
|
|
512
|
+
case TypeId.CosmosResponseBeginBlock:
|
|
513
|
+
return idof<cosmos.ResponseBeginBlock>()
|
|
514
|
+
case TypeId.CosmosResponseDeliverTx:
|
|
515
|
+
return idof<cosmos.ResponseDeliverTx>()
|
|
516
|
+
case TypeId.CosmosResponseEndBlock:
|
|
517
|
+
return idof<cosmos.ResponseEndBlock>()
|
|
518
|
+
case TypeId.CosmosSignModeEnum:
|
|
519
|
+
return idof<Array<cosmos.SignMode>>()
|
|
520
|
+
case TypeId.CosmosSignedHeader:
|
|
521
|
+
return idof<cosmos.SignedHeader>()
|
|
522
|
+
case TypeId.CosmosSignedMsgTypeEnum:
|
|
523
|
+
return idof<Array<cosmos.SignedMsgType>>()
|
|
524
|
+
case TypeId.CosmosSignerInfo:
|
|
525
|
+
return idof<cosmos.SignerInfo>()
|
|
526
|
+
case TypeId.CosmosTimestamp:
|
|
527
|
+
return idof<cosmos.Timestamp>()
|
|
528
|
+
case TypeId.CosmosTip:
|
|
529
|
+
return idof<cosmos.Tip>()
|
|
530
|
+
case TypeId.CosmosTransactionData:
|
|
531
|
+
return idof<cosmos.TransactionData>()
|
|
532
|
+
case TypeId.CosmosTx:
|
|
533
|
+
return idof<cosmos.Tx>()
|
|
534
|
+
case TypeId.CosmosTxBody:
|
|
535
|
+
return idof<cosmos.TxBody>()
|
|
536
|
+
case TypeId.CosmosTxResult:
|
|
537
|
+
return idof<cosmos.TxResult>()
|
|
538
|
+
case TypeId.CosmosValidator:
|
|
539
|
+
return idof<cosmos.Validator>()
|
|
540
|
+
case TypeId.CosmosValidatorParams:
|
|
541
|
+
return idof<cosmos.ValidatorParams>()
|
|
542
|
+
case TypeId.CosmosValidatorSet:
|
|
543
|
+
return idof<cosmos.ValidatorSet>()
|
|
544
|
+
case TypeId.CosmosValidatorSetUpdates:
|
|
545
|
+
return idof<cosmos.ValidatorSetUpdates>()
|
|
546
|
+
case TypeId.CosmosValidatorUpdate:
|
|
547
|
+
return idof<cosmos.ValidatorUpdate>()
|
|
548
|
+
case TypeId.CosmosVersionParams:
|
|
549
|
+
return idof<cosmos.VersionParams>()
|
|
550
|
+
/**
|
|
551
|
+
* Arweave type ids
|
|
552
|
+
*/
|
|
553
|
+
case TypeId.ArweaveBlock:
|
|
554
|
+
return idof<arweave.Block>()
|
|
555
|
+
case TypeId.ArweaveProofOfAccess:
|
|
556
|
+
return idof<arweave.ProofOfAccess>()
|
|
557
|
+
case TypeId.ArweaveTag:
|
|
558
|
+
return idof<arweave.Tag>()
|
|
559
|
+
case TypeId.ArweaveTagArray:
|
|
560
|
+
return idof<Array<arweave.Tag>>()
|
|
561
|
+
case TypeId.ArweaveTransaction:
|
|
562
|
+
return idof<arweave.Transaction>()
|
|
563
|
+
case TypeId.ArweaveTransactionArray:
|
|
564
|
+
return idof<Array<arweave.Transaction>>()
|
|
565
|
+
case TypeId.ArweaveTransactionWithBlockPtr:
|
|
566
|
+
return idof<arweave.TransactionWithBlockPtr>()
|
|
423
567
|
default:
|
|
424
568
|
return 0
|
|
425
569
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// Side-effect to evaluate eagerly the offset of stub AS runtime
|
|
2
2
|
import './common/eager_offset'
|
|
3
|
+
// Arweave support
|
|
4
|
+
export * from './chain/arweave'
|
|
3
5
|
// Ethereum support
|
|
4
6
|
export * from './chain/ethereum'
|
|
5
7
|
// NEAR support
|
|
6
8
|
export * from './chain/near'
|
|
7
|
-
//
|
|
8
|
-
export * from './chain/
|
|
9
|
+
// Cosmos support
|
|
10
|
+
export * from './chain/cosmos'
|
|
9
11
|
// Regular re-exports
|
|
10
12
|
export * from './common/numbers'
|
|
11
13
|
export * from './common/collections'
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphprotocol/graph-ts",
|
|
3
3
|
"description": "TypeScript/AssemblyScript library for writing subgraph mappings for The Graph",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.27.0",
|
|
5
5
|
"module": "index.ts",
|
|
6
6
|
"types": "index.ts",
|
|
7
7
|
"main": "index.ts",
|
|
8
|
+
"ascMain": "index.ts",
|
|
8
9
|
"dependencies": {
|
|
9
10
|
"assemblyscript": "0.19.10"
|
|
10
11
|
},
|
|
@@ -29,9 +29,10 @@ async function main() {
|
|
|
29
29
|
fs.copyFileSync('common/json.ts', 'test/temp_lib/common/json.ts')
|
|
30
30
|
fs.copyFileSync('common/numbers.ts', 'test/temp_lib/common/numbers.ts')
|
|
31
31
|
fs.copyFileSync('common/value.ts', 'test/temp_lib/common/value.ts')
|
|
32
|
+
fs.copyFileSync('chain/arweave.ts', 'test/temp_lib/chain/arweave.ts')
|
|
32
33
|
fs.copyFileSync('chain/ethereum.ts', 'test/temp_lib/chain/ethereum.ts')
|
|
33
34
|
fs.copyFileSync('chain/near.ts', 'test/temp_lib/chain/near.ts')
|
|
34
|
-
fs.copyFileSync('chain/
|
|
35
|
+
fs.copyFileSync('chain/cosmos.ts', 'test/temp_lib/chain/cosmos.ts')
|
|
35
36
|
fs.copyFileSync('index.ts', 'test/temp_lib/index.ts')
|
|
36
37
|
|
|
37
38
|
try {
|
|
@@ -62,9 +63,10 @@ async function main() {
|
|
|
62
63
|
fs.unlinkSync('test/temp_lib/common/numbers.ts')
|
|
63
64
|
fs.unlinkSync('test/temp_lib/common/value.ts')
|
|
64
65
|
fs.rmdirSync('test/temp_lib/common')
|
|
66
|
+
fs.unlinkSync('test/temp_lib/chain/arweave.ts')
|
|
65
67
|
fs.unlinkSync('test/temp_lib/chain/ethereum.ts')
|
|
66
68
|
fs.unlinkSync('test/temp_lib/chain/near.ts')
|
|
67
|
-
fs.unlinkSync('test/temp_lib/chain/
|
|
69
|
+
fs.unlinkSync('test/temp_lib/chain/cosmos.ts')
|
|
68
70
|
fs.rmdirSync('test/temp_lib/chain')
|
|
69
71
|
fs.unlinkSync('test/temp_lib/index.ts')
|
|
70
72
|
fs.rmdirSync('test/temp_lib')
|