@graphprotocol/graph-cli 0.67.0 → 0.67.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/CHANGELOG.md +8 -0
- package/dist/command-helpers/abi.js +15 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @graphprotocol/graph-cli
|
|
2
2
|
|
|
3
|
+
## 0.67.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1568](https://github.com/graphprotocol/graph-tooling/pull/1568)
|
|
8
|
+
[`efa9444`](https://github.com/graphprotocol/graph-tooling/commit/efa94446d97b4137e942e3b9c138d83b2b8cf561)
|
|
9
|
+
Thanks [@saihaj](https://github.com/saihaj)! - add zk sync sepolia RPC url
|
|
10
|
+
|
|
3
11
|
## 0.67.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.loadAbiFromBlockScout = exports.getStartBlockForContract = exports.fetchTransactionByHashFromRPC = exports.fetchContractCreationHashWithRetry = exports.fetchDeployContractTransactionFromEtherscan = exports.loadStartBlockForContract = exports.loadAbiFromEtherscan = void 0;
|
|
7
7
|
const immutable_1 = __importDefault(require("immutable"));
|
|
8
8
|
const constants_1 = require("../constants");
|
|
9
|
+
const debug_1 = __importDefault(require("../debug"));
|
|
9
10
|
const fetch_1 = __importDefault(require("../fetch"));
|
|
10
11
|
const spinner_1 = require("./spinner");
|
|
12
|
+
const logger = (0, debug_1.default)('graph-cli:abi-helpers');
|
|
11
13
|
const loadAbiFromEtherscan = async (ABICtor, network, address) => await (0, spinner_1.withSpinner)(`Fetching ABI from Etherscan`, `Failed to fetch ABI from Etherscan`, `Warnings while fetching ABI from Etherscan`, async () => {
|
|
12
14
|
const scanApiUrl = getEtherscanLikeAPIUrl(network);
|
|
13
15
|
const result = await (0, fetch_1.default)(`${scanApiUrl}?module=contract&action=getabi&address=${address}`);
|
|
@@ -29,7 +31,9 @@ const fetchDeployContractTransactionFromEtherscan = async (network, address) =>
|
|
|
29
31
|
const scanApiUrl = getEtherscanLikeAPIUrl(network);
|
|
30
32
|
const json = await (0, exports.fetchContractCreationHashWithRetry)(`${scanApiUrl}?module=contract&action=getcontractcreation&contractaddresses=${address}`, 5);
|
|
31
33
|
if (json.status === '1') {
|
|
32
|
-
|
|
34
|
+
const hash = json.result[0].txHash;
|
|
35
|
+
logger('Successfully fetchDeployContractTransactionFromEtherscan. txHash: %s', hash);
|
|
36
|
+
return hash;
|
|
33
37
|
}
|
|
34
38
|
throw new Error(`Failed to fetch deploy contract transaction`);
|
|
35
39
|
};
|
|
@@ -45,6 +49,7 @@ const fetchContractCreationHashWithRetry = async (url, retryCount) => {
|
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
catch (error) {
|
|
52
|
+
logger('Failed to fetchContractCreationHashWithRetry: %O', error);
|
|
48
53
|
/* empty */
|
|
49
54
|
}
|
|
50
55
|
}
|
|
@@ -74,6 +79,7 @@ const fetchTransactionByHashFromRPC = async (network, transactionHash) => {
|
|
|
74
79
|
return json;
|
|
75
80
|
}
|
|
76
81
|
catch (error) {
|
|
82
|
+
logger('Failed to fetchTransactionByHashFromRPC: %O', error);
|
|
77
83
|
throw new Error('Failed to fetch contract creation transaction');
|
|
78
84
|
}
|
|
79
85
|
};
|
|
@@ -82,9 +88,12 @@ const getStartBlockForContract = async (network, address) => {
|
|
|
82
88
|
try {
|
|
83
89
|
const transactionHash = await (0, exports.fetchDeployContractTransactionFromEtherscan)(network, address);
|
|
84
90
|
const txn = await (0, exports.fetchTransactionByHashFromRPC)(network, transactionHash);
|
|
85
|
-
|
|
91
|
+
const blockNumber = parseInt(txn.result.blockNumber, 16);
|
|
92
|
+
logger('Successfully getStartBlockForContract. blockNumber: %s', blockNumber);
|
|
93
|
+
return blockNumber;
|
|
86
94
|
}
|
|
87
95
|
catch (error) {
|
|
96
|
+
logger('Failed to fetch getStartBlockForContract: %O', error);
|
|
88
97
|
throw new Error(error?.message);
|
|
89
98
|
}
|
|
90
99
|
};
|
|
@@ -96,8 +105,10 @@ const loadAbiFromBlockScout = async (ABICtor, network, address) => await (0, spi
|
|
|
96
105
|
// a `result` field. The `status` is '0' in case of errors and '1' in
|
|
97
106
|
// case of success
|
|
98
107
|
if (json.status === '1') {
|
|
108
|
+
logger('Successfully loadAbiFromBlockScout. address: %s', address);
|
|
99
109
|
return new ABICtor('Contract', undefined, immutable_1.default.fromJS(JSON.parse(json.result)));
|
|
100
110
|
}
|
|
111
|
+
logger('Failed to loadAbiFromBlockScout. address: %s', address);
|
|
101
112
|
throw new Error('ABI not found, try loading it from a local file');
|
|
102
113
|
});
|
|
103
114
|
exports.loadAbiFromBlockScout = loadAbiFromBlockScout;
|
|
@@ -241,6 +252,8 @@ const getPublicRPCEndpoint = (network) => {
|
|
|
241
252
|
return 'https://mainnet.era.zksync.io';
|
|
242
253
|
case 'zksync-era-testnet':
|
|
243
254
|
return 'https://testnet.era.zksync.dev';
|
|
255
|
+
case 'zksync-era-sepolia':
|
|
256
|
+
return 'https://sepolia.era.zksync.dev';
|
|
244
257
|
case 'sepolia':
|
|
245
258
|
return 'https://rpc.ankr.com/eth_sepolia';
|
|
246
259
|
case 'scroll-sepolia':
|
package/oclif.manifest.json
CHANGED