@graphprotocol/graph-cli 0.37.3 → 0.37.4

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.
Files changed (267) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +5 -1
  3. package/babel.config.js +0 -3
  4. package/jest.config.js +0 -175
  5. package/src/bin.ts +0 -6
  6. package/src/cli.ts +0 -30
  7. package/src/codegen/schema.test.ts +0 -460
  8. package/src/codegen/schema.ts +0 -299
  9. package/src/codegen/template.ts +0 -45
  10. package/src/codegen/types/conversions.ts +0 -358
  11. package/src/codegen/types/index.test.ts +0 -715
  12. package/src/codegen/types/index.ts +0 -111
  13. package/src/codegen/typescript.ts +0 -224
  14. package/src/codegen/util.test.ts +0 -112
  15. package/src/codegen/util.ts +0 -54
  16. package/src/command-helpers/abi.ts +0 -99
  17. package/src/command-helpers/auth.ts +0 -46
  18. package/src/command-helpers/compiler.ts +0 -60
  19. package/src/command-helpers/data-sources.ts +0 -36
  20. package/src/command-helpers/fs.ts +0 -5
  21. package/src/command-helpers/gluegun.ts +0 -52
  22. package/src/command-helpers/ipfs-http-client.d.ts +0 -1
  23. package/src/command-helpers/ipfs.ts +0 -3
  24. package/src/command-helpers/jsonrpc.ts +0 -22
  25. package/src/command-helpers/network.test.ts +0 -85
  26. package/src/command-helpers/network.ts +0 -133
  27. package/src/command-helpers/node.ts +0 -46
  28. package/src/command-helpers/scaffold.ts +0 -174
  29. package/src/command-helpers/spinner.ts +0 -60
  30. package/src/command-helpers/studio.test.ts +0 -84
  31. package/src/command-helpers/studio.ts +0 -25
  32. package/src/command-helpers/subgraph.ts +0 -21
  33. package/src/command-helpers/version.test.ts +0 -241
  34. package/src/command-helpers/version.ts +0 -53
  35. package/src/commands/add.ts +0 -220
  36. package/src/commands/auth.ts +0 -138
  37. package/src/commands/binary-install-raw.d.ts +0 -1
  38. package/src/commands/build.ts +0 -147
  39. package/src/commands/codegen.ts +0 -123
  40. package/src/commands/create.ts +0 -109
  41. package/src/commands/deploy.ts +0 -388
  42. package/src/commands/init.ts +0 -1060
  43. package/src/commands/local.ts +0 -539
  44. package/src/commands/remove.ts +0 -110
  45. package/src/commands/test.ts +0 -369
  46. package/src/compiler/asc.ts +0 -77
  47. package/src/compiler/index.ts +0 -677
  48. package/src/debug.ts +0 -15
  49. package/src/migrations/mapping_api_version_0_0_1.ts +0 -75
  50. package/src/migrations/mapping_api_version_0_0_2.ts +0 -75
  51. package/src/migrations/mapping_api_version_0_0_3.ts +0 -75
  52. package/src/migrations/mapping_api_version_0_0_4.ts +0 -77
  53. package/src/migrations/mapping_api_version_0_0_5.ts +0 -77
  54. package/src/migrations/spec_version_0_0_2.ts +0 -24
  55. package/src/migrations/spec_version_0_0_3.ts +0 -29
  56. package/src/migrations/util/load-manifest.ts +0 -10
  57. package/src/migrations/util/versions.ts +0 -27
  58. package/src/migrations.ts +0 -33
  59. package/src/protocols/arweave/manifest.graphql +0 -57
  60. package/src/protocols/arweave/scaffold/manifest.ts +0 -14
  61. package/src/protocols/arweave/scaffold/mapping.ts +0 -49
  62. package/src/protocols/arweave/subgraph.ts +0 -22
  63. package/src/protocols/contract.ts +0 -9
  64. package/src/protocols/cosmos/manifest.graphql +0 -76
  65. package/src/protocols/cosmos/scaffold/manifest.ts +0 -11
  66. package/src/protocols/cosmos/scaffold/mapping.ts +0 -35
  67. package/src/protocols/cosmos/subgraph.ts +0 -27
  68. package/src/protocols/ethereum/abi.ts +0 -153
  69. package/src/protocols/ethereum/codegen/abi.test.ts +0 -330
  70. package/src/protocols/ethereum/codegen/abi.ts +0 -719
  71. package/src/protocols/ethereum/codegen/template.ts +0 -41
  72. package/src/protocols/ethereum/contract.ts +0 -24
  73. package/src/protocols/ethereum/manifest.graphql +0 -94
  74. package/src/protocols/ethereum/scaffold/manifest.ts +0 -28
  75. package/src/protocols/ethereum/scaffold/mapping.ts +0 -76
  76. package/src/protocols/ethereum/subgraph.ts +0 -189
  77. package/src/protocols/ethereum/type-generator.ts +0 -191
  78. package/src/protocols/index.ts +0 -287
  79. package/src/protocols/ipfs/codegen/file_template.ts +0 -43
  80. package/src/protocols/near/contract.ts +0 -47
  81. package/src/protocols/near/manifest.graphql +0 -64
  82. package/src/protocols/near/scaffold/manifest.ts +0 -13
  83. package/src/protocols/near/scaffold/mapping.ts +0 -35
  84. package/src/protocols/near/subgraph.ts +0 -22
  85. package/src/protocols/subgraph.ts +0 -12
  86. package/src/protocols/substreams/manifest.graphql +0 -45
  87. package/src/protocols/substreams/scaffold/manifest.ts +0 -8
  88. package/src/protocols/substreams/subgraph.ts +0 -22
  89. package/src/scaffold/cosmos.test.ts +0 -83
  90. package/src/scaffold/ethereum.test.ts +0 -512
  91. package/src/scaffold/index.ts +0 -172
  92. package/src/scaffold/mapping.ts +0 -44
  93. package/src/scaffold/near.test.ts +0 -86
  94. package/src/scaffold/schema.ts +0 -89
  95. package/src/scaffold/tests.ts +0 -217
  96. package/src/schema.ts +0 -26
  97. package/src/subgraph.ts +0 -302
  98. package/src/type-generator.ts +0 -266
  99. package/src/validation/contract.ts +0 -51
  100. package/src/validation/index.ts +0 -5
  101. package/src/validation/manifest.ts +0 -360
  102. package/src/validation/schema.test.ts +0 -38
  103. package/src/validation/schema.ts +0 -957
  104. package/src/watcher.ts +0 -96
  105. package/tests/cli/globalSetup.ts +0 -8
  106. package/tests/cli/globalTeardown.ts +0 -8
  107. package/tests/cli/init/ethereum/abis/Marketplace.json +0 -408
  108. package/tests/cli/init/ethereum/abis/OverloadedElements.json +0 -91
  109. package/tests/cli/init/ethereum/abis/SoloMargin.json +0 -2729
  110. package/tests/cli/init/ethereum/from-contract-with-abi-and-structs.stderr +0 -14
  111. package/tests/cli/init/ethereum/from-contract-with-abi-and-structs.stdout +0 -12
  112. package/tests/cli/init/ethereum/from-contract-with-abi.stderr +0 -14
  113. package/tests/cli/init/ethereum/from-contract-with-abi.stdout +0 -12
  114. package/tests/cli/init/ethereum/from-contract-with-overloaded-elements.stderr +0 -14
  115. package/tests/cli/init/ethereum/from-contract-with-overloaded-elements.stdout +0 -12
  116. package/tests/cli/init/ethereum/from-contract.stderr +0 -16
  117. package/tests/cli/init/ethereum/from-contract.stdout +0 -12
  118. package/tests/cli/init/ethereum/from-example.stderr +0 -12
  119. package/tests/cli/init/ethereum/from-example.stdout +0 -12
  120. package/tests/cli/init/near/from-contract.stderr +0 -14
  121. package/tests/cli/init/near/from-contract.stdout +0 -12
  122. package/tests/cli/init.test.ts +0 -157
  123. package/tests/cli/spawn-command.d.ts +0 -7
  124. package/tests/cli/util.ts +0 -132
  125. package/tests/cli/validation/abi-not-found/Abi.json +0 -7
  126. package/tests/cli/validation/abi-not-found/mapping.ts +0 -0
  127. package/tests/cli/validation/abi-not-found/schema.graphql +0 -3
  128. package/tests/cli/validation/abi-not-found/subgraph.yaml +0 -42
  129. package/tests/cli/validation/abi-not-found copy.stderr +0 -13
  130. package/tests/cli/validation/big-decimal-is-valid/Abi.json +0 -7
  131. package/tests/cli/validation/big-decimal-is-valid/mapping.ts +0 -0
  132. package/tests/cli/validation/big-decimal-is-valid/schema.graphql +0 -4
  133. package/tests/cli/validation/big-decimal-is-valid/subgraph.yaml +0 -23
  134. package/tests/cli/validation/call-function-not-found/Abi.json +0 -57
  135. package/tests/cli/validation/call-function-not-found/mapping.ts +0 -0
  136. package/tests/cli/validation/call-function-not-found/schema.graphql +0 -3
  137. package/tests/cli/validation/call-function-not-found/subgraph.yaml +0 -22
  138. package/tests/cli/validation/call-function-not-found.stderr +0 -10
  139. package/tests/cli/validation/call-handler-with-tuple/Abi.json +0 -24
  140. package/tests/cli/validation/call-handler-with-tuple/generated/schema.ts +0 -44
  141. package/tests/cli/validation/call-handler-with-tuple/mapping.ts +0 -0
  142. package/tests/cli/validation/call-handler-with-tuple/schema.graphql +0 -3
  143. package/tests/cli/validation/call-handler-with-tuple/subgraph.yaml +0 -22
  144. package/tests/cli/validation/call-handler-with-tuple.stderr +0 -24
  145. package/tests/cli/validation/conflicting-network-names/Abi.json +0 -7
  146. package/tests/cli/validation/conflicting-network-names/mapping.ts +0 -0
  147. package/tests/cli/validation/conflicting-network-names/schema.graphql +0 -3
  148. package/tests/cli/validation/conflicting-network-names/subgraph.yaml +0 -41
  149. package/tests/cli/validation/conflicting-network-names.stderr +0 -10
  150. package/tests/cli/validation/conflicting-protocol-names/Abi.json +0 -7
  151. package/tests/cli/validation/conflicting-protocol-names/mapping.ts +0 -0
  152. package/tests/cli/validation/conflicting-protocol-names/schema.graphql +0 -3
  153. package/tests/cli/validation/conflicting-protocol-names/subgraph.yaml +0 -41
  154. package/tests/cli/validation/conflicting-protocol-names.stderr +0 -10
  155. package/tests/cli/validation/derived-from-target-type-missing/Abi.json +0 -6
  156. package/tests/cli/validation/derived-from-target-type-missing/mapping.ts +0 -0
  157. package/tests/cli/validation/derived-from-target-type-missing/schema.graphql +0 -4
  158. package/tests/cli/validation/derived-from-target-type-missing/subgraph.yaml +0 -22
  159. package/tests/cli/validation/derived-from-target-type-missing.stderr +0 -5
  160. package/tests/cli/validation/derived-from-with-interface/Gravity.json +0 -1
  161. package/tests/cli/validation/derived-from-with-interface/mapping.ts +0 -22
  162. package/tests/cli/validation/derived-from-with-interface/schema.graphql +0 -19
  163. package/tests/cli/validation/derived-from-with-interface/subgraph.yaml +0 -25
  164. package/tests/cli/validation/duplicate-data-source-name/Abi.json +0 -7
  165. package/tests/cli/validation/duplicate-data-source-name/mapping.ts +0 -0
  166. package/tests/cli/validation/duplicate-data-source-name/schema.graphql +0 -4
  167. package/tests/cli/validation/duplicate-data-source-name/subgraph.yaml +0 -40
  168. package/tests/cli/validation/duplicate-data-source-name.stderr +0 -5
  169. package/tests/cli/validation/duplicate-template-name/Abi.json +0 -7
  170. package/tests/cli/validation/duplicate-template-name/mapping.ts +0 -0
  171. package/tests/cli/validation/duplicate-template-name/schema.graphql +0 -4
  172. package/tests/cli/validation/duplicate-template-name/subgraph.yaml +0 -59
  173. package/tests/cli/validation/duplicate-template-name.stderr +0 -5
  174. package/tests/cli/validation/entity-field-args/Abi.json +0 -7
  175. package/tests/cli/validation/entity-field-args/mapping.ts +0 -0
  176. package/tests/cli/validation/entity-field-args/schema.graphql +0 -4
  177. package/tests/cli/validation/entity-field-args/subgraph.yaml +0 -22
  178. package/tests/cli/validation/entity-field-args.stderr +0 -5
  179. package/tests/cli/validation/ethereum-contract-without-handlers/Abi.json +0 -7
  180. package/tests/cli/validation/ethereum-contract-without-handlers/mapping.ts +0 -0
  181. package/tests/cli/validation/ethereum-contract-without-handlers/schema.graphql +0 -3
  182. package/tests/cli/validation/ethereum-contract-without-handlers/subgraph.yaml +0 -19
  183. package/tests/cli/validation/ethereum-contract-without-handlers.stderr +0 -6
  184. package/tests/cli/validation/event-not-found/Abi.json +0 -7
  185. package/tests/cli/validation/event-not-found/mapping.ts +0 -0
  186. package/tests/cli/validation/event-not-found/schema.graphql +0 -3
  187. package/tests/cli/validation/event-not-found/subgraph.yaml +0 -40
  188. package/tests/cli/validation/event-not-found.stderr +0 -12
  189. package/tests/cli/validation/example-values-found/Abi.json +0 -7
  190. package/tests/cli/validation/example-values-found/generated/ExampleSubgraph/ExampleContract.ts +0 -35
  191. package/tests/cli/validation/example-values-found/generated/schema.ts +0 -44
  192. package/tests/cli/validation/example-values-found/mapping.ts +0 -0
  193. package/tests/cli/validation/example-values-found/schema.graphql +0 -3
  194. package/tests/cli/validation/example-values-found/subgraph.yaml +0 -24
  195. package/tests/cli/validation/example-values-found.stderr +0 -34
  196. package/tests/cli/validation/invalid-abis/InvalidAbi.json +0 -1
  197. package/tests/cli/validation/invalid-abis/mapping.ts +0 -0
  198. package/tests/cli/validation/invalid-abis/schema.graphql +0 -3
  199. package/tests/cli/validation/invalid-abis/subgraph.yaml +0 -22
  200. package/tests/cli/validation/invalid-abis.stderr +0 -5
  201. package/tests/cli/validation/invalid-contract-addresses/Abi.json +0 -7
  202. package/tests/cli/validation/invalid-contract-addresses/mapping.ts +0 -0
  203. package/tests/cli/validation/invalid-contract-addresses/schema.graphql +0 -3
  204. package/tests/cli/validation/invalid-contract-addresses/subgraph.yaml +0 -58
  205. package/tests/cli/validation/invalid-contract-addresses.stderr +0 -14
  206. package/tests/cli/validation/invalid-data-source-template/mapping.ts +0 -0
  207. package/tests/cli/validation/invalid-data-source-template/schema.graphql +0 -3
  208. package/tests/cli/validation/invalid-data-source-template/subgraph.yaml +0 -32
  209. package/tests/cli/validation/invalid-data-source-template.stderr +0 -30
  210. package/tests/cli/validation/invalid-entity-field-types/Abi.json +0 -7
  211. package/tests/cli/validation/invalid-entity-field-types/mapping.ts +0 -0
  212. package/tests/cli/validation/invalid-entity-field-types/schema.graphql +0 -157
  213. package/tests/cli/validation/invalid-entity-field-types/subgraph.yaml +0 -22
  214. package/tests/cli/validation/invalid-entity-field-types.stderr +0 -148
  215. package/tests/cli/validation/invalid-fulltext-directive/Abi.json +0 -7
  216. package/tests/cli/validation/invalid-fulltext-directive/mapping.ts +0 -0
  217. package/tests/cli/validation/invalid-fulltext-directive/schema.graphql +0 -140
  218. package/tests/cli/validation/invalid-fulltext-directive/subgraph.yaml +0 -22
  219. package/tests/cli/validation/invalid-fulltext-directive.stderr +0 -32
  220. package/tests/cli/validation/invalid-graphql-schema/Abi.json +0 -7
  221. package/tests/cli/validation/invalid-graphql-schema/mapping.ts +0 -0
  222. package/tests/cli/validation/invalid-graphql-schema/schema.graphql +0 -8
  223. package/tests/cli/validation/invalid-graphql-schema/subgraph.yaml +0 -22
  224. package/tests/cli/validation/invalid-graphql-schema.stderr +0 -25
  225. package/tests/cli/validation/invalid-manifest/subgraph.yaml +0 -13
  226. package/tests/cli/validation/invalid-manifest-cannot-infer-protocol/subgraph.yaml +0 -12
  227. package/tests/cli/validation/invalid-manifest-cannot-infer-protocol.stderr +0 -5
  228. package/tests/cli/validation/invalid-manifest.stderr +0 -28
  229. package/tests/cli/validation/missing-entity-id/Abi.json +0 -7
  230. package/tests/cli/validation/missing-entity-id/mapping.ts +0 -0
  231. package/tests/cli/validation/missing-entity-id/schema.graphql +0 -3
  232. package/tests/cli/validation/missing-entity-id/subgraph.yaml +0 -22
  233. package/tests/cli/validation/missing-entity-id/types/ExampleSubgraph/ExampleContract.ts +0 -35
  234. package/tests/cli/validation/missing-entity-id/types/schema.ts +0 -27
  235. package/tests/cli/validation/missing-entity-id.stderr +0 -5
  236. package/tests/cli/validation/missing-or-invalid-derived-from-fields/Abi.json +0 -7
  237. package/tests/cli/validation/missing-or-invalid-derived-from-fields/mapping.ts +0 -0
  238. package/tests/cli/validation/missing-or-invalid-derived-from-fields/schema.graphql +0 -40
  239. package/tests/cli/validation/missing-or-invalid-derived-from-fields/subgraph.yaml +0 -22
  240. package/tests/cli/validation/missing-or-invalid-derived-from-fields.stderr +0 -10
  241. package/tests/cli/validation/missing-or-invalid-derived-from-fields.stdout +0 -0
  242. package/tests/cli/validation/near-is-valid/mapping.ts +0 -0
  243. package/tests/cli/validation/near-is-valid/schema.graphql +0 -8
  244. package/tests/cli/validation/near-is-valid/subgraph.yaml +0 -30
  245. package/tests/cli/validation/nested-template-nice-error/Abi.json +0 -7
  246. package/tests/cli/validation/nested-template-nice-error/mapping.ts +0 -0
  247. package/tests/cli/validation/nested-template-nice-error/schema.graphql +0 -3
  248. package/tests/cli/validation/nested-template-nice-error/subgraph.yaml +0 -35
  249. package/tests/cli/validation/nested-template-nice-error.stderr +0 -5
  250. package/tests/cli/validation/no-network-names/Abi.json +0 -7
  251. package/tests/cli/validation/no-network-names/mapping.ts +0 -0
  252. package/tests/cli/validation/no-network-names/schema.graphql +0 -3
  253. package/tests/cli/validation/no-network-names/subgraph.yaml +0 -40
  254. package/tests/cli/validation/no-network-names.stderr +0 -34
  255. package/tests/cli/validation/source-without-address-is-valid/Abi.json +0 -7
  256. package/tests/cli/validation/source-without-address-is-valid/generated/ExampleSubgraph/ExampleContract.ts +0 -35
  257. package/tests/cli/validation/source-without-address-is-valid/mapping.ts +0 -0
  258. package/tests/cli/validation/source-without-address-is-valid/schema.graphql +0 -3
  259. package/tests/cli/validation/source-without-address-is-valid/subgraph.yaml +0 -23
  260. package/tests/cli/validation/source-without-address-is-valid.stderr +0 -24
  261. package/tests/cli/validation/topic0-is-valid/Abi.json +0 -7
  262. package/tests/cli/validation/topic0-is-valid/mapping.ts +0 -0
  263. package/tests/cli/validation/topic0-is-valid/schema.graphql +0 -4
  264. package/tests/cli/validation/topic0-is-valid/subgraph.yaml +0 -24
  265. package/tests/cli/validation.test.ts +0 -226
  266. package/tsconfig.build.json +0 -4
  267. package/tsconfig.json +0 -19
@@ -1,3 +0,0 @@
1
- type MyEntity @entity {
2
- id: ID!
3
- }
@@ -1,40 +0,0 @@
1
- specVersion: 0.0.1
2
- schema:
3
- file: ./schema.graphql
4
- dataSources:
5
- - kind: ethereum/contract
6
- name: ExampleSubgraph
7
- source:
8
- address: '22843e74c59580b3eaf6c233fa67d8b7c561a835'
9
- abi: ExampleContract
10
- mapping:
11
- kind: ethereum/events
12
- apiVersion: 0.0.5
13
- language: wasm/assemblyscript
14
- file: ./mapping.ts
15
- entities:
16
- - ExampleEntity
17
- abis:
18
- - name: ExampleContract
19
- file: ./Abi.json
20
- eventHandlers:
21
- - event: ExampleEvent(string,uint256)
22
- handler: handleExampleEvent
23
- templates:
24
- - kind: ethereum/contract
25
- name: ExampleTemplate
26
- source:
27
- abi: ExampleContract
28
- mapping:
29
- kind: ethereum/events
30
- apiVersion: 0.0.5
31
- language: wasm/assemblyscript
32
- file: ./mapping.ts
33
- entities:
34
- - ExampleEntity
35
- abis:
36
- - name: ExampleContract
37
- file: ./Abi.json
38
- eventHandlers:
39
- - event: ExampleEvent(string,uint256)
40
- handler: handleExampleEvent
@@ -1,12 +0,0 @@
1
- - Load subgraph from subgraph.yaml
2
- ✖ Failed to load subgraph from subgraph.yaml: Error in subgraph.yaml:
3
-
4
- Path: dataSources > 0 > eventHandlers > 0
5
- Event with signature 'ExampleEvent(string,uint256)' not present in ABI 'ExampleContract'.
6
- Available events:
7
- - ExampleEvent(string)
8
-
9
- Path: templates > 0 > eventHandlers > 0
10
- Event with signature 'ExampleEvent(string,uint256)' not present in ABI 'ExampleContract'.
11
- Available events:
12
- - ExampleEvent(string)
@@ -1,7 +0,0 @@
1
- [
2
- {
3
- "type": "event",
4
- "name": "ExampleEvent",
5
- "inputs": [{ "type": "string" }]
6
- }
7
- ]
@@ -1,35 +0,0 @@
1
- // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
-
3
- import {
4
- ethereum,
5
- JSONValue,
6
- TypedMap,
7
- Entity,
8
- Bytes,
9
- Address,
10
- BigInt
11
- } from "@graphprotocol/graph-ts";
12
-
13
- export class ExampleEvent extends ethereum.Event {
14
- get params(): ExampleEvent__Params {
15
- return new ExampleEvent__Params(this);
16
- }
17
- }
18
-
19
- export class ExampleEvent__Params {
20
- _event: ExampleEvent;
21
-
22
- constructor(event: ExampleEvent) {
23
- this._event = event;
24
- }
25
-
26
- get param0(): string {
27
- return this._event.parameters[0].value.toString();
28
- }
29
- }
30
-
31
- export class ExampleContract extends ethereum.SmartContract {
32
- static bind(address: Address): ExampleContract {
33
- return new ExampleContract("ExampleContract", address);
34
- }
35
- }
@@ -1,44 +0,0 @@
1
- // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
-
3
- import {
4
- TypedMap,
5
- Entity,
6
- Value,
7
- ValueKind,
8
- store,
9
- Bytes,
10
- BigInt,
11
- BigDecimal
12
- } from "@graphprotocol/graph-ts";
13
-
14
- export class MyEntity extends Entity {
15
- constructor(id: string) {
16
- super();
17
- this.set("id", Value.fromString(id));
18
- }
19
-
20
- save(): void {
21
- let id = this.get("id");
22
- assert(id != null, "Cannot save MyEntity entity without an ID");
23
- if (id) {
24
- assert(
25
- id.kind == ValueKind.STRING,
26
- `Entities of type MyEntity must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`
27
- );
28
- store.set("MyEntity", id.toString(), this);
29
- }
30
- }
31
-
32
- static load(id: string): MyEntity | null {
33
- return changetype<MyEntity | null>(store.get("MyEntity", id));
34
- }
35
-
36
- get id(): string {
37
- let value = this.get("id");
38
- return value!.toString();
39
- }
40
-
41
- set id(value: string) {
42
- this.set("id", Value.fromString(value));
43
- }
44
- }
@@ -1,3 +0,0 @@
1
- type MyEntity @entity {
2
- id: ID!
3
- }
@@ -1,24 +0,0 @@
1
- specVersion: 0.0.1
2
- repository: https://github.com/graphprotocol/example-subgraph
3
- description: Gravatar for Ethereum
4
- schema:
5
- file: ./schema.graphql
6
- dataSources:
7
- - kind: ethereum/contract
8
- name: ExampleSubgraph
9
- source:
10
- address: '22843e74c59580b3eaf6c233fa67d8b7c561a835'
11
- abi: ExampleContract
12
- mapping:
13
- kind: ethereum/events
14
- apiVersion: 0.0.5
15
- language: wasm/assemblyscript
16
- file: ./mapping.ts
17
- entities:
18
- - ExampleEntity
19
- abis:
20
- - name: ExampleContract
21
- file: ./Abi.json
22
- eventHandlers:
23
- - event: ExampleEvent(string)
24
- handler: handleExampleEvent
@@ -1,34 +0,0 @@
1
- - Load subgraph from subgraph.yaml
2
- ⚠ Warnings while loading subgraph from subgraph.yaml: Warnings in subgraph.yaml:
3
-
4
- Path: repository
5
- The repository is still set to https://github.com/graphprotocol/example-subgraph.
6
- Please replace it with a link to your subgraph source code.
7
-
8
- Path: description
9
- The description is still the one from the example subgraph.
10
- Please update it to tell users more about your subgraph.
11
-
12
- ✔ Load subgraph from subgraph.yaml
13
- - Load contract ABIs
14
- Load contract ABI from Abi.json
15
- - Load contract ABIs
16
- ✔ Load contract ABIs
17
- - Generate types for contract ABIs
18
- Generate types for contract ABI: ExampleContract (Abi.json)
19
- - Generate types for contract ABIs
20
- Write types to generated/ExampleSubgraph/ExampleContract.ts
21
- - Generate types for contract ABIs
22
- ✔ Generate types for contract ABIs
23
- - Generate types for data source templates
24
- ✔ Generate types for data source templates
25
- - Load data source template ABIs
26
- ✔ Load data source template ABIs
27
- - Generate types for data source template ABIs
28
- ✔ Generate types for data source template ABIs
29
- - Load GraphQL schema from schema.graphql
30
- ✔ Load GraphQL schema from schema.graphql
31
- - Generate types for GraphQL schema
32
- Write types to generated/schema.ts
33
- - Generate types for GraphQL schema
34
- ✔ Generate types for GraphQL schema
@@ -1 +0,0 @@
1
- "Hello"
File without changes
@@ -1,3 +0,0 @@
1
- type MyEntity @entity {
2
- id: ID!
3
- }
@@ -1,22 +0,0 @@
1
- specVersion: 0.0.1
2
- schema:
3
- file: ./schema.graphql
4
- dataSources:
5
- - kind: ethereum/contract
6
- name: ExampleSubgraph
7
- source:
8
- address: '22843e74c59580b3eaf6c233fa67d8b7c561a835'
9
- abi: ExampleContract
10
- mapping:
11
- kind: ethereum/events
12
- apiVersion: 0.0.5
13
- language: wasm/assemblyscript
14
- file: ./mapping.ts
15
- entities:
16
- - ExampleEntity
17
- abis:
18
- - name: ExampleContract
19
- file: ./InvalidAbi.json
20
- eventHandlers:
21
- - event: ExampleEvent(string)
22
- handler: handleExampleEvent
@@ -1,5 +0,0 @@
1
- - Load subgraph from subgraph.yaml
2
- ✖ Failed to load subgraph from subgraph.yaml: Error in subgraph.yaml:
3
-
4
- Path: dataSources > 0 > mapping > abis > 0 > file
5
- No valid ABI in file: InvalidAbi.json
@@ -1,7 +0,0 @@
1
- [
2
- {
3
- "type": "event",
4
- "name": "ExampleEvent",
5
- "inputs": [{ "type": "string" }]
6
- }
7
- ]
@@ -1,3 +0,0 @@
1
- type MyEntity @entity {
2
- id: ID!
3
- }
@@ -1,58 +0,0 @@
1
- specVersion: 0.0.1
2
- schema:
3
- file: ./schema.graphql
4
- dataSources:
5
- - kind: ethereum/contract
6
- name: DataSource1
7
- source:
8
- address: '22843e74c59580b3eaf6c233fa67d8b7c561a835a'
9
- abi: ExampleContract
10
- mapping:
11
- kind: ethereum/events
12
- apiVersion: 0.0.5
13
- language: wasm/assemblyscript
14
- file: ./mapping.ts
15
- entities:
16
- - ExampleEntity
17
- abis:
18
- - name: ExampleContract
19
- file: ./Abi.json
20
- eventHandlers:
21
- - event: ExampleEvent(string)
22
- handler: handleExampleEvent
23
- - kind: ethereum/contract
24
- name: DataSource2
25
- source:
26
- address: '22843e74c59580b3eaf6c233fa67d8b7c561axyz'
27
- abi: ExampleContract
28
- mapping:
29
- kind: ethereum/events
30
- apiVersion: 0.0.5
31
- language: wasm/assemblyscript
32
- file: ./mapping.ts
33
- entities:
34
- - ExampleEntity
35
- abis:
36
- - name: ExampleContract
37
- file: ./Abi.json
38
- eventHandlers:
39
- - event: ExampleEvent(string)
40
- handler: handleExampleEvent
41
- - kind: ethereum/contract
42
- name: DataSource3
43
- source:
44
- address: '0x22843e74c59580b3eaf6c233fa67d8b7c561a835a'
45
- abi: ExampleContract
46
- mapping:
47
- kind: ethereum/events
48
- apiVersion: 0.0.5
49
- language: wasm/assemblyscript
50
- file: ./mapping.ts
51
- entities:
52
- - ExampleEntity
53
- abis:
54
- - name: ExampleContract
55
- file: ./Abi.json
56
- eventHandlers:
57
- - event: ExampleEvent(string)
58
- handler: handleExampleEvent
@@ -1,14 +0,0 @@
1
- - Load subgraph from subgraph.yaml
2
- ✖ Failed to load subgraph from subgraph.yaml: Error in subgraph.yaml:
3
-
4
- Path: dataSources > 0 > source > address
5
- Contract address is invalid: 22843e74c59580b3eaf6c233fa67d8b7c561a835a
6
- Must be 40 hexadecimal characters, with an optional '0x' prefix.
7
-
8
- Path: dataSources > 1 > source > address
9
- Contract address is invalid: 22843e74c59580b3eaf6c233fa67d8b7c561axyz
10
- Must be 40 hexadecimal characters, with an optional '0x' prefix.
11
-
12
- Path: dataSources > 2 > source > address
13
- Contract address is invalid: 0x22843e74c59580b3eaf6c233fa67d8b7c561a835a
14
- Must be 40 hexadecimal characters, with an optional '0x' prefix.
@@ -1,3 +0,0 @@
1
- type MyEntity @entity {
2
- id: ID!
3
- }
@@ -1,32 +0,0 @@
1
- specVersion: 0.0.1
2
- schema:
3
- file: ./schema.graphql
4
- dataSources:
5
- - kind: ethereum/contract
6
- name: ExampleSubgraph
7
- source:
8
- address: '22843e74c59580b3eaf6c233fa67d8b7c561a835'
9
- abi: ExampleContract
10
- mapping:
11
- kind: ethereum/events
12
- apiVersion: 0.0.5
13
- language: wasm/assemblyscript
14
- file: ./mapping.ts
15
- entities:
16
- - ExampleEntity
17
- abis:
18
- - name: ExampleContract
19
- file: ./Abi.json
20
- eventHandlers:
21
- - event: ExampleEvent(string,uint256)
22
- handler: handleExampleEvent
23
- templates:
24
- - name: 5
25
- source:
26
- abi: SomeAbi
27
- address: '0x22843e74c59580b3eaf6c233fa67d8b7c561a835'
28
- mapping:
29
- kind: ethereum/foo
30
- abis:
31
- - name: SomeAbi
32
- file: ./NonexistentAbi.json
@@ -1,30 +0,0 @@
1
- - Load subgraph from subgraph.yaml
2
- ✖ Failed to load subgraph from subgraph.yaml: Error in subgraph.yaml:
3
-
4
- Path: dataSources > 0 > mapping > abis > 0 > file
5
- File does not exist: Abi.json
6
-
7
- Path: templates > 0 > kind
8
- No value provided
9
-
10
- Path: templates > 0 > name
11
- Expected string, found number:
12
- 5
13
-
14
- Path: templates > 0 > source
15
- Unexpected key in map: address
16
-
17
- Path: templates > 0 > mapping > entities
18
- No value provided
19
-
20
- Path: templates > 0 > mapping > abis > 0 > file
21
- File does not exist: NonexistentAbi.json
22
-
23
- Path: templates > 0 > mapping > language
24
- No value provided
25
-
26
- Path: templates > 0 > mapping > file
27
- No value provided
28
-
29
- Path: templates > 0 > mapping > apiVersion
30
- No value provided
@@ -1,7 +0,0 @@
1
- [
2
- {
3
- "type": "event",
4
- "name": "ExampleEvent",
5
- "inputs": [{ "type": "string" }]
6
- }
7
- ]
@@ -1,157 +0,0 @@
1
- type MyEntity @entity {
2
- id: ID!
3
-
4
- isSet1: bool
5
- isSet2: boolean
6
- isSet3: Bool
7
-
8
- address1: Address
9
- address2: address
10
-
11
- float1: float
12
- float2: Float
13
-
14
- string1: string
15
-
16
- int: int
17
- uint: uint
18
- uint32: uint32
19
-
20
- i8: i8
21
- i16: i16
22
- i24: i24
23
- i32: i32
24
- i40: i40
25
- i48: i48
26
- i56: i56
27
- i64: i64
28
- i72: i72
29
- i80: i80
30
- i88: i88
31
- i96: i96
32
- i104: i104
33
- i112: i112
34
- i120: i120
35
- i128: i128
36
- i136: i136
37
- i144: i144
38
- i152: i152
39
- i160: i160
40
- i168: i168
41
- i176: i176
42
- i184: i184
43
- i192: i192
44
- i200: i200
45
- i208: i208
46
- i216: i216
47
- i224: i224
48
- i232: i232
49
- i240: i240
50
- i248: i248
51
- i256: i256
52
- i256: i256
53
-
54
- int8: int8
55
- int16: int16
56
- int24: int24
57
- int32: int32
58
- int40: int40
59
- int48: int48
60
- int56: int56
61
- int64: int64
62
- int72: int72
63
- int80: int80
64
- int88: int88
65
- int96: int96
66
- int104: int104
67
- int112: int112
68
- int120: int120
69
- int128: int128
70
- int136: int136
71
- int144: int144
72
- int152: int152
73
- int160: int160
74
- int168: int168
75
- int176: int176
76
- int184: int184
77
- int192: int192
78
- int200: int200
79
- int208: int208
80
- int216: int216
81
- int224: int224
82
- int232: int232
83
- int240: int240
84
- int248: int248
85
- int256: int256
86
- int256: int256
87
-
88
- u8: u8
89
- u16: u16
90
- u24: u24
91
- u32: u32
92
- u40: u40
93
- u48: u48
94
- u56: u56
95
- u64: u64
96
- u72: u72
97
- u80: u80
98
- u88: u88
99
- u96: u96
100
- u104: u104
101
- u112: u112
102
- u120: u120
103
- u128: u128
104
- u136: u136
105
- u144: u144
106
- u152: u152
107
- u160: u160
108
- u168: u168
109
- u176: u176
110
- u184: u184
111
- u192: u192
112
- u200: u200
113
- u208: u208
114
- u216: u216
115
- u224: u224
116
- u232: u232
117
- u240: u240
118
- u248: u248
119
- u256: u256
120
- u256: u256
121
-
122
- uint8: uint8
123
- uint16: uint16
124
- uint24: uint24
125
- uint32: uint32
126
- uint40: uint40
127
- uint48: uint48
128
- uint56: uint56
129
- uint64: uint64
130
- uint72: uint72
131
- uint80: uint80
132
- uint88: uint88
133
- uint96: uint96
134
- uint104: uint104
135
- uint112: uint112
136
- uint120: uint120
137
- uint128: uint128
138
- uint136: uint136
139
- uint144: uint144
140
- uint152: uint152
141
- uint160: uint160
142
- uint168: uint168
143
- uint176: uint176
144
- uint184: uint184
145
- uint192: uint192
146
- uint200: uint200
147
- uint208: uint208
148
- uint216: uint216
149
- uint224: uint224
150
- uint232: uint232
151
- uint240: uint240
152
- uint248: uint248
153
- uint256: uint256
154
- uint256: uint256
155
-
156
- references: [Foo!]!
157
- }
@@ -1,22 +0,0 @@
1
- specVersion: 0.0.1
2
- schema:
3
- file: ./schema.graphql
4
- dataSources:
5
- - kind: ethereum/contract
6
- name: ExampleSubgraph
7
- source:
8
- address: '22843e74c59580b3eaf6c233fa67d8b7c561a835'
9
- abi: ExampleContract
10
- mapping:
11
- kind: ethereum/events
12
- apiVersion: 0.0.5
13
- language: wasm/assemblyscript
14
- file: ./mapping.ts
15
- entities:
16
- - ExampleEntity
17
- abis:
18
- - name: ExampleContract
19
- file: ./Abi.json
20
- eventHandlers:
21
- - event: ExampleEvent(string)
22
- handler: handleExampleEvent