@graphprotocol/graph-cli 0.49.0-alpha-20230504181204-a99dddd → 0.49.0-alpha-20230504191821-affcb14
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 +6 -1
- package/dist/commands/init.js +26 -3
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @graphprotocol/graph-cli
|
|
2
2
|
|
|
3
|
-
## 0.49.0-alpha-
|
|
3
|
+
## 0.49.0-alpha-20230504191821-affcb14
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
the subgraph. The `schema.graphql` is the schema of the subgraph and the `subgraph.yaml` is the
|
|
26
26
|
manifest file for the subgraph.
|
|
27
27
|
|
|
28
|
+
- [#1335](https://github.com/graphprotocol/graph-tooling/pull/1335)
|
|
29
|
+
[`affcb14`](https://github.com/graphprotocol/graph-tooling/commit/affcb1492f29affdb2426e57a154f132362f24ef)
|
|
30
|
+
Thanks [@saihaj](https://github.com/saihaj)! - respect --abi flag instead of loading from
|
|
31
|
+
etherscan
|
|
32
|
+
|
|
28
33
|
- [#1335](https://github.com/graphprotocol/graph-tooling/pull/1335)
|
|
29
34
|
[`f90dd75`](https://github.com/graphprotocol/graph-tooling/commit/f90dd757a558f4e66cc46780f13612309f45646a)
|
|
30
35
|
Thanks [@saihaj](https://github.com/saihaj)! - remove index events as entities for substreams
|
package/dist/commands/init.js
CHANGED
|
@@ -155,6 +155,7 @@ class InitCommand extends core_1.Command {
|
|
|
155
155
|
studio,
|
|
156
156
|
node,
|
|
157
157
|
abi,
|
|
158
|
+
abiPath,
|
|
158
159
|
allowSimpleName,
|
|
159
160
|
directory,
|
|
160
161
|
contract: fromContract,
|
|
@@ -278,7 +279,7 @@ InitCommand.flags = {
|
|
|
278
279
|
}),
|
|
279
280
|
};
|
|
280
281
|
exports.default = InitCommand;
|
|
281
|
-
async function processInitForm({ protocol: initProtocol, product: initProduct, studio: initStudio, node: initNode, abi: initAbi, directory: initDirectory, contract: initContract, indexEvents: initIndexEvents, fromExample: initFromExample, network: initNetwork, subgraphName: initSubgraphName, contractName: initContractName, startBlock: initStartBlock, allowSimpleName: initAllowSimpleName, }) {
|
|
282
|
+
async function processInitForm({ protocol: initProtocol, product: initProduct, studio: initStudio, node: initNode, abi: initAbi, abiPath: initAbiPath, directory: initDirectory, contract: initContract, indexEvents: initIndexEvents, fromExample: initFromExample, network: initNetwork, subgraphName: initSubgraphName, contractName: initContractName, startBlock: initStartBlock, allowSimpleName: initAllowSimpleName, }) {
|
|
282
283
|
let abiFromEtherscan = undefined;
|
|
283
284
|
try {
|
|
284
285
|
const { protocol } = await gluegun_1.prompt.ask({
|
|
@@ -392,7 +393,7 @@ async function processInitForm({ protocol: initProtocol, product: initProduct, s
|
|
|
392
393
|
return valid ? true : error;
|
|
393
394
|
},
|
|
394
395
|
result: async (value) => {
|
|
395
|
-
if (initFromExample !== undefined || isSubstreams) {
|
|
396
|
+
if (initFromExample !== undefined || isSubstreams || initAbiPath) {
|
|
396
397
|
return value;
|
|
397
398
|
}
|
|
398
399
|
const ABI = protocolInstance.getABI();
|
|
@@ -434,12 +435,34 @@ async function processInitForm({ protocol: initProtocol, product: initProduct, s
|
|
|
434
435
|
skip: () => !protocolInstance.hasABIs() ||
|
|
435
436
|
initFromExample !== undefined ||
|
|
436
437
|
abiFromEtherscan !== undefined ||
|
|
437
|
-
isSubstreams
|
|
438
|
+
isSubstreams ||
|
|
439
|
+
!!initAbiPath,
|
|
438
440
|
validate: async (value) => {
|
|
439
441
|
if (initFromExample || abiFromEtherscan || !protocolInstance.hasABIs()) {
|
|
440
442
|
return true;
|
|
441
443
|
}
|
|
442
444
|
const ABI = protocolInstance.getABI();
|
|
445
|
+
try {
|
|
446
|
+
loadAbiFromFile(ABI, value);
|
|
447
|
+
return true;
|
|
448
|
+
}
|
|
449
|
+
catch (e) {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
result: async (value) => {
|
|
454
|
+
if (initFromExample || abiFromEtherscan || !protocolInstance.hasABIs()) {
|
|
455
|
+
return null;
|
|
456
|
+
}
|
|
457
|
+
const ABI = protocolInstance.getABI();
|
|
458
|
+
if (initAbiPath) {
|
|
459
|
+
try {
|
|
460
|
+
return loadAbiFromFile(ABI, initAbiPath);
|
|
461
|
+
}
|
|
462
|
+
catch (e) {
|
|
463
|
+
return e.message;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
443
466
|
try {
|
|
444
467
|
return loadAbiFromFile(ABI, value);
|
|
445
468
|
}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED