@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.
- package/CHANGELOG.md +8 -0
- package/package.json +5 -1
- package/babel.config.js +0 -3
- package/jest.config.js +0 -175
- package/src/bin.ts +0 -6
- package/src/cli.ts +0 -30
- package/src/codegen/schema.test.ts +0 -460
- package/src/codegen/schema.ts +0 -299
- package/src/codegen/template.ts +0 -45
- package/src/codegen/types/conversions.ts +0 -358
- package/src/codegen/types/index.test.ts +0 -715
- package/src/codegen/types/index.ts +0 -111
- package/src/codegen/typescript.ts +0 -224
- package/src/codegen/util.test.ts +0 -112
- package/src/codegen/util.ts +0 -54
- package/src/command-helpers/abi.ts +0 -99
- package/src/command-helpers/auth.ts +0 -46
- package/src/command-helpers/compiler.ts +0 -60
- package/src/command-helpers/data-sources.ts +0 -36
- package/src/command-helpers/fs.ts +0 -5
- package/src/command-helpers/gluegun.ts +0 -52
- package/src/command-helpers/ipfs-http-client.d.ts +0 -1
- package/src/command-helpers/ipfs.ts +0 -3
- package/src/command-helpers/jsonrpc.ts +0 -22
- package/src/command-helpers/network.test.ts +0 -85
- package/src/command-helpers/network.ts +0 -133
- package/src/command-helpers/node.ts +0 -46
- package/src/command-helpers/scaffold.ts +0 -174
- package/src/command-helpers/spinner.ts +0 -60
- package/src/command-helpers/studio.test.ts +0 -84
- package/src/command-helpers/studio.ts +0 -25
- package/src/command-helpers/subgraph.ts +0 -21
- package/src/command-helpers/version.test.ts +0 -241
- package/src/command-helpers/version.ts +0 -53
- package/src/commands/add.ts +0 -220
- package/src/commands/auth.ts +0 -138
- package/src/commands/binary-install-raw.d.ts +0 -1
- package/src/commands/build.ts +0 -147
- package/src/commands/codegen.ts +0 -123
- package/src/commands/create.ts +0 -109
- package/src/commands/deploy.ts +0 -388
- package/src/commands/init.ts +0 -1060
- package/src/commands/local.ts +0 -539
- package/src/commands/remove.ts +0 -110
- package/src/commands/test.ts +0 -369
- package/src/compiler/asc.ts +0 -77
- package/src/compiler/index.ts +0 -677
- package/src/debug.ts +0 -15
- package/src/migrations/mapping_api_version_0_0_1.ts +0 -75
- package/src/migrations/mapping_api_version_0_0_2.ts +0 -75
- package/src/migrations/mapping_api_version_0_0_3.ts +0 -75
- package/src/migrations/mapping_api_version_0_0_4.ts +0 -77
- package/src/migrations/mapping_api_version_0_0_5.ts +0 -77
- package/src/migrations/spec_version_0_0_2.ts +0 -24
- package/src/migrations/spec_version_0_0_3.ts +0 -29
- package/src/migrations/util/load-manifest.ts +0 -10
- package/src/migrations/util/versions.ts +0 -27
- package/src/migrations.ts +0 -33
- package/src/protocols/arweave/manifest.graphql +0 -57
- package/src/protocols/arweave/scaffold/manifest.ts +0 -14
- package/src/protocols/arweave/scaffold/mapping.ts +0 -49
- package/src/protocols/arweave/subgraph.ts +0 -22
- package/src/protocols/contract.ts +0 -9
- package/src/protocols/cosmos/manifest.graphql +0 -76
- package/src/protocols/cosmos/scaffold/manifest.ts +0 -11
- package/src/protocols/cosmos/scaffold/mapping.ts +0 -35
- package/src/protocols/cosmos/subgraph.ts +0 -27
- package/src/protocols/ethereum/abi.ts +0 -153
- package/src/protocols/ethereum/codegen/abi.test.ts +0 -330
- package/src/protocols/ethereum/codegen/abi.ts +0 -719
- package/src/protocols/ethereum/codegen/template.ts +0 -41
- package/src/protocols/ethereum/contract.ts +0 -24
- package/src/protocols/ethereum/manifest.graphql +0 -94
- package/src/protocols/ethereum/scaffold/manifest.ts +0 -28
- package/src/protocols/ethereum/scaffold/mapping.ts +0 -76
- package/src/protocols/ethereum/subgraph.ts +0 -189
- package/src/protocols/ethereum/type-generator.ts +0 -191
- package/src/protocols/index.ts +0 -287
- package/src/protocols/ipfs/codegen/file_template.ts +0 -43
- package/src/protocols/near/contract.ts +0 -47
- package/src/protocols/near/manifest.graphql +0 -64
- package/src/protocols/near/scaffold/manifest.ts +0 -13
- package/src/protocols/near/scaffold/mapping.ts +0 -35
- package/src/protocols/near/subgraph.ts +0 -22
- package/src/protocols/subgraph.ts +0 -12
- package/src/protocols/substreams/manifest.graphql +0 -45
- package/src/protocols/substreams/scaffold/manifest.ts +0 -8
- package/src/protocols/substreams/subgraph.ts +0 -22
- package/src/scaffold/cosmos.test.ts +0 -83
- package/src/scaffold/ethereum.test.ts +0 -512
- package/src/scaffold/index.ts +0 -172
- package/src/scaffold/mapping.ts +0 -44
- package/src/scaffold/near.test.ts +0 -86
- package/src/scaffold/schema.ts +0 -89
- package/src/scaffold/tests.ts +0 -217
- package/src/schema.ts +0 -26
- package/src/subgraph.ts +0 -302
- package/src/type-generator.ts +0 -266
- package/src/validation/contract.ts +0 -51
- package/src/validation/index.ts +0 -5
- package/src/validation/manifest.ts +0 -360
- package/src/validation/schema.test.ts +0 -38
- package/src/validation/schema.ts +0 -957
- package/src/watcher.ts +0 -96
- package/tests/cli/globalSetup.ts +0 -8
- package/tests/cli/globalTeardown.ts +0 -8
- package/tests/cli/init/ethereum/abis/Marketplace.json +0 -408
- package/tests/cli/init/ethereum/abis/OverloadedElements.json +0 -91
- package/tests/cli/init/ethereum/abis/SoloMargin.json +0 -2729
- package/tests/cli/init/ethereum/from-contract-with-abi-and-structs.stderr +0 -14
- package/tests/cli/init/ethereum/from-contract-with-abi-and-structs.stdout +0 -12
- package/tests/cli/init/ethereum/from-contract-with-abi.stderr +0 -14
- package/tests/cli/init/ethereum/from-contract-with-abi.stdout +0 -12
- package/tests/cli/init/ethereum/from-contract-with-overloaded-elements.stderr +0 -14
- package/tests/cli/init/ethereum/from-contract-with-overloaded-elements.stdout +0 -12
- package/tests/cli/init/ethereum/from-contract.stderr +0 -16
- package/tests/cli/init/ethereum/from-contract.stdout +0 -12
- package/tests/cli/init/ethereum/from-example.stderr +0 -12
- package/tests/cli/init/ethereum/from-example.stdout +0 -12
- package/tests/cli/init/near/from-contract.stderr +0 -14
- package/tests/cli/init/near/from-contract.stdout +0 -12
- package/tests/cli/init.test.ts +0 -157
- package/tests/cli/spawn-command.d.ts +0 -7
- package/tests/cli/util.ts +0 -132
- package/tests/cli/validation/abi-not-found/Abi.json +0 -7
- package/tests/cli/validation/abi-not-found/mapping.ts +0 -0
- package/tests/cli/validation/abi-not-found/schema.graphql +0 -3
- package/tests/cli/validation/abi-not-found/subgraph.yaml +0 -42
- package/tests/cli/validation/abi-not-found copy.stderr +0 -13
- package/tests/cli/validation/big-decimal-is-valid/Abi.json +0 -7
- package/tests/cli/validation/big-decimal-is-valid/mapping.ts +0 -0
- package/tests/cli/validation/big-decimal-is-valid/schema.graphql +0 -4
- package/tests/cli/validation/big-decimal-is-valid/subgraph.yaml +0 -23
- package/tests/cli/validation/call-function-not-found/Abi.json +0 -57
- package/tests/cli/validation/call-function-not-found/mapping.ts +0 -0
- package/tests/cli/validation/call-function-not-found/schema.graphql +0 -3
- package/tests/cli/validation/call-function-not-found/subgraph.yaml +0 -22
- package/tests/cli/validation/call-function-not-found.stderr +0 -10
- package/tests/cli/validation/call-handler-with-tuple/Abi.json +0 -24
- package/tests/cli/validation/call-handler-with-tuple/generated/schema.ts +0 -44
- package/tests/cli/validation/call-handler-with-tuple/mapping.ts +0 -0
- package/tests/cli/validation/call-handler-with-tuple/schema.graphql +0 -3
- package/tests/cli/validation/call-handler-with-tuple/subgraph.yaml +0 -22
- package/tests/cli/validation/call-handler-with-tuple.stderr +0 -24
- package/tests/cli/validation/conflicting-network-names/Abi.json +0 -7
- package/tests/cli/validation/conflicting-network-names/mapping.ts +0 -0
- package/tests/cli/validation/conflicting-network-names/schema.graphql +0 -3
- package/tests/cli/validation/conflicting-network-names/subgraph.yaml +0 -41
- package/tests/cli/validation/conflicting-network-names.stderr +0 -10
- package/tests/cli/validation/conflicting-protocol-names/Abi.json +0 -7
- package/tests/cli/validation/conflicting-protocol-names/mapping.ts +0 -0
- package/tests/cli/validation/conflicting-protocol-names/schema.graphql +0 -3
- package/tests/cli/validation/conflicting-protocol-names/subgraph.yaml +0 -41
- package/tests/cli/validation/conflicting-protocol-names.stderr +0 -10
- package/tests/cli/validation/derived-from-target-type-missing/Abi.json +0 -6
- package/tests/cli/validation/derived-from-target-type-missing/mapping.ts +0 -0
- package/tests/cli/validation/derived-from-target-type-missing/schema.graphql +0 -4
- package/tests/cli/validation/derived-from-target-type-missing/subgraph.yaml +0 -22
- package/tests/cli/validation/derived-from-target-type-missing.stderr +0 -5
- package/tests/cli/validation/derived-from-with-interface/Gravity.json +0 -1
- package/tests/cli/validation/derived-from-with-interface/mapping.ts +0 -22
- package/tests/cli/validation/derived-from-with-interface/schema.graphql +0 -19
- package/tests/cli/validation/derived-from-with-interface/subgraph.yaml +0 -25
- package/tests/cli/validation/duplicate-data-source-name/Abi.json +0 -7
- package/tests/cli/validation/duplicate-data-source-name/mapping.ts +0 -0
- package/tests/cli/validation/duplicate-data-source-name/schema.graphql +0 -4
- package/tests/cli/validation/duplicate-data-source-name/subgraph.yaml +0 -40
- package/tests/cli/validation/duplicate-data-source-name.stderr +0 -5
- package/tests/cli/validation/duplicate-template-name/Abi.json +0 -7
- package/tests/cli/validation/duplicate-template-name/mapping.ts +0 -0
- package/tests/cli/validation/duplicate-template-name/schema.graphql +0 -4
- package/tests/cli/validation/duplicate-template-name/subgraph.yaml +0 -59
- package/tests/cli/validation/duplicate-template-name.stderr +0 -5
- package/tests/cli/validation/entity-field-args/Abi.json +0 -7
- package/tests/cli/validation/entity-field-args/mapping.ts +0 -0
- package/tests/cli/validation/entity-field-args/schema.graphql +0 -4
- package/tests/cli/validation/entity-field-args/subgraph.yaml +0 -22
- package/tests/cli/validation/entity-field-args.stderr +0 -5
- package/tests/cli/validation/ethereum-contract-without-handlers/Abi.json +0 -7
- package/tests/cli/validation/ethereum-contract-without-handlers/mapping.ts +0 -0
- package/tests/cli/validation/ethereum-contract-without-handlers/schema.graphql +0 -3
- package/tests/cli/validation/ethereum-contract-without-handlers/subgraph.yaml +0 -19
- package/tests/cli/validation/ethereum-contract-without-handlers.stderr +0 -6
- package/tests/cli/validation/event-not-found/Abi.json +0 -7
- package/tests/cli/validation/event-not-found/mapping.ts +0 -0
- package/tests/cli/validation/event-not-found/schema.graphql +0 -3
- package/tests/cli/validation/event-not-found/subgraph.yaml +0 -40
- package/tests/cli/validation/event-not-found.stderr +0 -12
- package/tests/cli/validation/example-values-found/Abi.json +0 -7
- package/tests/cli/validation/example-values-found/generated/ExampleSubgraph/ExampleContract.ts +0 -35
- package/tests/cli/validation/example-values-found/generated/schema.ts +0 -44
- package/tests/cli/validation/example-values-found/mapping.ts +0 -0
- package/tests/cli/validation/example-values-found/schema.graphql +0 -3
- package/tests/cli/validation/example-values-found/subgraph.yaml +0 -24
- package/tests/cli/validation/example-values-found.stderr +0 -34
- package/tests/cli/validation/invalid-abis/InvalidAbi.json +0 -1
- package/tests/cli/validation/invalid-abis/mapping.ts +0 -0
- package/tests/cli/validation/invalid-abis/schema.graphql +0 -3
- package/tests/cli/validation/invalid-abis/subgraph.yaml +0 -22
- package/tests/cli/validation/invalid-abis.stderr +0 -5
- package/tests/cli/validation/invalid-contract-addresses/Abi.json +0 -7
- package/tests/cli/validation/invalid-contract-addresses/mapping.ts +0 -0
- package/tests/cli/validation/invalid-contract-addresses/schema.graphql +0 -3
- package/tests/cli/validation/invalid-contract-addresses/subgraph.yaml +0 -58
- package/tests/cli/validation/invalid-contract-addresses.stderr +0 -14
- package/tests/cli/validation/invalid-data-source-template/mapping.ts +0 -0
- package/tests/cli/validation/invalid-data-source-template/schema.graphql +0 -3
- package/tests/cli/validation/invalid-data-source-template/subgraph.yaml +0 -32
- package/tests/cli/validation/invalid-data-source-template.stderr +0 -30
- package/tests/cli/validation/invalid-entity-field-types/Abi.json +0 -7
- package/tests/cli/validation/invalid-entity-field-types/mapping.ts +0 -0
- package/tests/cli/validation/invalid-entity-field-types/schema.graphql +0 -157
- package/tests/cli/validation/invalid-entity-field-types/subgraph.yaml +0 -22
- package/tests/cli/validation/invalid-entity-field-types.stderr +0 -148
- package/tests/cli/validation/invalid-fulltext-directive/Abi.json +0 -7
- package/tests/cli/validation/invalid-fulltext-directive/mapping.ts +0 -0
- package/tests/cli/validation/invalid-fulltext-directive/schema.graphql +0 -140
- package/tests/cli/validation/invalid-fulltext-directive/subgraph.yaml +0 -22
- package/tests/cli/validation/invalid-fulltext-directive.stderr +0 -32
- package/tests/cli/validation/invalid-graphql-schema/Abi.json +0 -7
- package/tests/cli/validation/invalid-graphql-schema/mapping.ts +0 -0
- package/tests/cli/validation/invalid-graphql-schema/schema.graphql +0 -8
- package/tests/cli/validation/invalid-graphql-schema/subgraph.yaml +0 -22
- package/tests/cli/validation/invalid-graphql-schema.stderr +0 -25
- package/tests/cli/validation/invalid-manifest/subgraph.yaml +0 -13
- package/tests/cli/validation/invalid-manifest-cannot-infer-protocol/subgraph.yaml +0 -12
- package/tests/cli/validation/invalid-manifest-cannot-infer-protocol.stderr +0 -5
- package/tests/cli/validation/invalid-manifest.stderr +0 -28
- package/tests/cli/validation/missing-entity-id/Abi.json +0 -7
- package/tests/cli/validation/missing-entity-id/mapping.ts +0 -0
- package/tests/cli/validation/missing-entity-id/schema.graphql +0 -3
- package/tests/cli/validation/missing-entity-id/subgraph.yaml +0 -22
- package/tests/cli/validation/missing-entity-id/types/ExampleSubgraph/ExampleContract.ts +0 -35
- package/tests/cli/validation/missing-entity-id/types/schema.ts +0 -27
- package/tests/cli/validation/missing-entity-id.stderr +0 -5
- package/tests/cli/validation/missing-or-invalid-derived-from-fields/Abi.json +0 -7
- package/tests/cli/validation/missing-or-invalid-derived-from-fields/mapping.ts +0 -0
- package/tests/cli/validation/missing-or-invalid-derived-from-fields/schema.graphql +0 -40
- package/tests/cli/validation/missing-or-invalid-derived-from-fields/subgraph.yaml +0 -22
- package/tests/cli/validation/missing-or-invalid-derived-from-fields.stderr +0 -10
- package/tests/cli/validation/missing-or-invalid-derived-from-fields.stdout +0 -0
- package/tests/cli/validation/near-is-valid/mapping.ts +0 -0
- package/tests/cli/validation/near-is-valid/schema.graphql +0 -8
- package/tests/cli/validation/near-is-valid/subgraph.yaml +0 -30
- package/tests/cli/validation/nested-template-nice-error/Abi.json +0 -7
- package/tests/cli/validation/nested-template-nice-error/mapping.ts +0 -0
- package/tests/cli/validation/nested-template-nice-error/schema.graphql +0 -3
- package/tests/cli/validation/nested-template-nice-error/subgraph.yaml +0 -35
- package/tests/cli/validation/nested-template-nice-error.stderr +0 -5
- package/tests/cli/validation/no-network-names/Abi.json +0 -7
- package/tests/cli/validation/no-network-names/mapping.ts +0 -0
- package/tests/cli/validation/no-network-names/schema.graphql +0 -3
- package/tests/cli/validation/no-network-names/subgraph.yaml +0 -40
- package/tests/cli/validation/no-network-names.stderr +0 -34
- package/tests/cli/validation/source-without-address-is-valid/Abi.json +0 -7
- package/tests/cli/validation/source-without-address-is-valid/generated/ExampleSubgraph/ExampleContract.ts +0 -35
- package/tests/cli/validation/source-without-address-is-valid/mapping.ts +0 -0
- package/tests/cli/validation/source-without-address-is-valid/schema.graphql +0 -3
- package/tests/cli/validation/source-without-address-is-valid/subgraph.yaml +0 -23
- package/tests/cli/validation/source-without-address-is-valid.stderr +0 -24
- package/tests/cli/validation/topic0-is-valid/Abi.json +0 -7
- package/tests/cli/validation/topic0-is-valid/mapping.ts +0 -0
- package/tests/cli/validation/topic0-is-valid/schema.graphql +0 -4
- package/tests/cli/validation/topic0-is-valid/subgraph.yaml +0 -24
- package/tests/cli/validation.test.ts +0 -226
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -19
|
@@ -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)
|
package/tests/cli/validation/example-values-found/generated/ExampleSubgraph/ExampleContract.ts
DELETED
|
@@ -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
|
-
}
|
|
File without changes
|
|
@@ -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,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
|
|
File without changes
|
|
@@ -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.
|
|
File without changes
|
|
@@ -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
|
|
File without changes
|
|
@@ -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
|