@snapshot-labs/snapshot.js 0.3.83 → 0.3.86
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/dist/index.d.ts +1 -1
- package/dist/snapshot.cjs.js +14 -12
- package/dist/snapshot.esm.js +14 -12
- package/dist/snapshot.min.js +1 -1
- package/dist/utils.d.ts +2 -2
- package/package.json +1 -1
- package/src/networks.json +2 -5
- package/src/sign/utils.ts +10 -3
- package/src/utils/blockfinder.ts +1 -1
- package/src/utils.ts +1 -1
package/dist/index.d.ts
CHANGED
package/dist/snapshot.cjs.js
CHANGED
|
@@ -1094,7 +1094,7 @@ function getSnapshots(network, snapshot, provider, networks) {
|
|
|
1094
1094
|
number: true
|
|
1095
1095
|
}
|
|
1096
1096
|
};
|
|
1097
|
-
url = 'https://blockfinder.snapshot.org
|
|
1097
|
+
url = 'https://blockfinder.snapshot.org';
|
|
1098
1098
|
return [4 /*yield*/, subgraphRequest(url, query)];
|
|
1099
1099
|
case 2:
|
|
1100
1100
|
data = _a.sent();
|
|
@@ -1359,15 +1359,12 @@ var networks = {
|
|
|
1359
1359
|
network: "mainnet",
|
|
1360
1360
|
multicall: "0x1ee38d535d541c55c9dae27b12edf090c608e6fb",
|
|
1361
1361
|
rpc: [
|
|
1362
|
-
"https://
|
|
1362
|
+
"https://rpc.ankr.com/bsc",
|
|
1363
1363
|
"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/bsc/mainnet/archive",
|
|
1364
1364
|
"https://bsc.getblock.io/mainnet/?api_key=91f8195f-bf46-488f-846a-73d6853790e7",
|
|
1365
1365
|
"https://bsc-private-dataseed1.nariox.org",
|
|
1366
|
-
"https://bsc-private-dataseed2.nariox.org",
|
|
1367
1366
|
"https://bsc-dataseed1.ninicoin.io",
|
|
1368
|
-
"https://bsc-dataseed1.binance.org"
|
|
1369
|
-
"https://bsc-dataseed2.binance.org",
|
|
1370
|
-
"https://bsc-dataseed3.binance.org"
|
|
1367
|
+
"https://bsc-dataseed1.binance.org"
|
|
1371
1368
|
],
|
|
1372
1369
|
explorer: "https://bscscan.com",
|
|
1373
1370
|
start: 461230,
|
|
@@ -2577,18 +2574,23 @@ function getHash(data) {
|
|
|
2577
2574
|
}
|
|
2578
2575
|
function verify$1(address, sig, data) {
|
|
2579
2576
|
return __awaiter(this, void 0, void 0, function () {
|
|
2580
|
-
var domain, types, message,
|
|
2577
|
+
var domain, types, message, hash, recoverAddress;
|
|
2581
2578
|
return __generator(this, function (_a) {
|
|
2582
2579
|
switch (_a.label) {
|
|
2583
2580
|
case 0:
|
|
2584
2581
|
domain = data.domain, types = data.types, message = data.message;
|
|
2585
|
-
recoverAddress = wallet.verifyTypedData(domain, types, message, sig);
|
|
2586
2582
|
hash = getHash(data);
|
|
2587
2583
|
console.log('Hash', hash);
|
|
2588
2584
|
console.log('Address', address);
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2585
|
+
try {
|
|
2586
|
+
recoverAddress = wallet.verifyTypedData(domain, types, message, sig);
|
|
2587
|
+
console.log('Recover address', recoverAddress);
|
|
2588
|
+
if (address === recoverAddress)
|
|
2589
|
+
return [2 /*return*/, true];
|
|
2590
|
+
}
|
|
2591
|
+
catch (e) {
|
|
2592
|
+
console.log('Could not recoverAddress:' + e.message);
|
|
2593
|
+
}
|
|
2592
2594
|
console.log('Check EIP1271 signature');
|
|
2593
2595
|
return [4 /*yield*/, verify(address, sig, hash)];
|
|
2594
2596
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -2913,7 +2915,7 @@ var SNAPSHOT_SUBGRAPH_URL = {
|
|
|
2913
2915
|
'1': 'https://gateway.thegraph.com/api/0f15b42bdeff7a063a4e1757d7e2f99e/deployments/id/QmXvEzRJXby7KFuTr7NJsM47hGefM5VckEXZrQyZzL9eJd',
|
|
2914
2916
|
'4': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-rinkeby',
|
|
2915
2917
|
'42': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-kovan',
|
|
2916
|
-
'
|
|
2918
|
+
'56': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-binance-smart-chain',
|
|
2917
2919
|
'100': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-gnosis-chain',
|
|
2918
2920
|
'137': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-polygon',
|
|
2919
2921
|
'250': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-fantom'
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -1085,7 +1085,7 @@ function getSnapshots(network, snapshot, provider, networks) {
|
|
|
1085
1085
|
number: true
|
|
1086
1086
|
}
|
|
1087
1087
|
};
|
|
1088
|
-
url = 'https://blockfinder.snapshot.org
|
|
1088
|
+
url = 'https://blockfinder.snapshot.org';
|
|
1089
1089
|
return [4 /*yield*/, subgraphRequest(url, query)];
|
|
1090
1090
|
case 2:
|
|
1091
1091
|
data = _a.sent();
|
|
@@ -1350,15 +1350,12 @@ var networks = {
|
|
|
1350
1350
|
network: "mainnet",
|
|
1351
1351
|
multicall: "0x1ee38d535d541c55c9dae27b12edf090c608e6fb",
|
|
1352
1352
|
rpc: [
|
|
1353
|
-
"https://
|
|
1353
|
+
"https://rpc.ankr.com/bsc",
|
|
1354
1354
|
"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/bsc/mainnet/archive",
|
|
1355
1355
|
"https://bsc.getblock.io/mainnet/?api_key=91f8195f-bf46-488f-846a-73d6853790e7",
|
|
1356
1356
|
"https://bsc-private-dataseed1.nariox.org",
|
|
1357
|
-
"https://bsc-private-dataseed2.nariox.org",
|
|
1358
1357
|
"https://bsc-dataseed1.ninicoin.io",
|
|
1359
|
-
"https://bsc-dataseed1.binance.org"
|
|
1360
|
-
"https://bsc-dataseed2.binance.org",
|
|
1361
|
-
"https://bsc-dataseed3.binance.org"
|
|
1358
|
+
"https://bsc-dataseed1.binance.org"
|
|
1362
1359
|
],
|
|
1363
1360
|
explorer: "https://bscscan.com",
|
|
1364
1361
|
start: 461230,
|
|
@@ -2568,18 +2565,23 @@ function getHash(data) {
|
|
|
2568
2565
|
}
|
|
2569
2566
|
function verify$1(address, sig, data) {
|
|
2570
2567
|
return __awaiter(this, void 0, void 0, function () {
|
|
2571
|
-
var domain, types, message,
|
|
2568
|
+
var domain, types, message, hash, recoverAddress;
|
|
2572
2569
|
return __generator(this, function (_a) {
|
|
2573
2570
|
switch (_a.label) {
|
|
2574
2571
|
case 0:
|
|
2575
2572
|
domain = data.domain, types = data.types, message = data.message;
|
|
2576
|
-
recoverAddress = verifyTypedData(domain, types, message, sig);
|
|
2577
2573
|
hash = getHash(data);
|
|
2578
2574
|
console.log('Hash', hash);
|
|
2579
2575
|
console.log('Address', address);
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2576
|
+
try {
|
|
2577
|
+
recoverAddress = verifyTypedData(domain, types, message, sig);
|
|
2578
|
+
console.log('Recover address', recoverAddress);
|
|
2579
|
+
if (address === recoverAddress)
|
|
2580
|
+
return [2 /*return*/, true];
|
|
2581
|
+
}
|
|
2582
|
+
catch (e) {
|
|
2583
|
+
console.log('Could not recoverAddress:' + e.message);
|
|
2584
|
+
}
|
|
2583
2585
|
console.log('Check EIP1271 signature');
|
|
2584
2586
|
return [4 /*yield*/, verify(address, sig, hash)];
|
|
2585
2587
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -2904,7 +2906,7 @@ var SNAPSHOT_SUBGRAPH_URL = {
|
|
|
2904
2906
|
'1': 'https://gateway.thegraph.com/api/0f15b42bdeff7a063a4e1757d7e2f99e/deployments/id/QmXvEzRJXby7KFuTr7NJsM47hGefM5VckEXZrQyZzL9eJd',
|
|
2905
2907
|
'4': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-rinkeby',
|
|
2906
2908
|
'42': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-kovan',
|
|
2907
|
-
'
|
|
2909
|
+
'56': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-binance-smart-chain',
|
|
2908
2910
|
'100': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-gnosis-chain',
|
|
2909
2911
|
'137': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-polygon',
|
|
2910
2912
|
'250': 'https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-fantom'
|