@snapshot-labs/snapshot.js 0.4.85 → 0.4.87
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/snapshot.cjs.js +35 -15
- package/dist/snapshot.esm.js +35 -15
- package/dist/snapshot.min.js +1 -1
- package/package.json +1 -1
- package/src/delegationSubgraphs.json +8 -8
- package/src/networks.json +13 -4
- package/src/utils.ts +16 -5
package/dist/snapshot.cjs.js
CHANGED
|
@@ -1321,7 +1321,10 @@ var networks = {
|
|
|
1321
1321
|
chainId: 1,
|
|
1322
1322
|
network: "homestead",
|
|
1323
1323
|
multicall: "0xeefba1e63905ef1d7acba5a8513c70307c1ce441",
|
|
1324
|
-
|
|
1324
|
+
ensResolvers: [
|
|
1325
|
+
"0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63",
|
|
1326
|
+
"0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"
|
|
1327
|
+
],
|
|
1325
1328
|
ensNameWrapper: "0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401",
|
|
1326
1329
|
rpc: [
|
|
1327
1330
|
"https://rpc.ankr.com/eth",
|
|
@@ -1356,7 +1359,10 @@ var networks = {
|
|
|
1356
1359
|
network: "goerli",
|
|
1357
1360
|
testnet: true,
|
|
1358
1361
|
multicall: "0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e",
|
|
1359
|
-
|
|
1362
|
+
ensResolvers: [
|
|
1363
|
+
"0xd7a4F6473f32aC2Af804B3686AE8F1932bC35750",
|
|
1364
|
+
"0x4B1488B7a6B320d2D721406204aBc3eeAa9AD329"
|
|
1365
|
+
],
|
|
1360
1366
|
ensNameWrapper: "0x114D4603199df73e7D157787f8778E21fCd13066",
|
|
1361
1367
|
rpc: [
|
|
1362
1368
|
"https://eth-goerli.alchemyapi.io/v2/v4nqH_J-J3STit45Mm07TxuYexMHQsYZ"
|
|
@@ -2334,7 +2340,10 @@ var networks = {
|
|
|
2334
2340
|
network: "mainnet",
|
|
2335
2341
|
multicall: "0x55034b2cF530ae3A8fC1e2e4523F58496796610F",
|
|
2336
2342
|
rpc: [
|
|
2337
|
-
"https://evm-dataseed1.meerscan.
|
|
2343
|
+
"https://evm-dataseed1.meerscan.io",
|
|
2344
|
+
"https://evm-dataseed.meerscan.com",
|
|
2345
|
+
"https://evm-dataseed2.meerscan.io",
|
|
2346
|
+
"https://evm-dataseed3.meerscan.io"
|
|
2338
2347
|
],
|
|
2339
2348
|
explorer: {
|
|
2340
2349
|
url: "https://evm.meerscan.io"
|
|
@@ -3501,14 +3510,14 @@ var networks = {
|
|
|
3501
3510
|
};
|
|
3502
3511
|
|
|
3503
3512
|
var delegationSubgraphs = {
|
|
3504
|
-
"1": "https://subgrapher.
|
|
3505
|
-
"5": "https://subgrapher.
|
|
3506
|
-
"10": "https://subgrapher.
|
|
3507
|
-
"56": "https://subgrapher.
|
|
3508
|
-
"100": "https://subgrapher.
|
|
3509
|
-
"137": "https://subgrapher.
|
|
3510
|
-
"250": "https://subgrapher.
|
|
3511
|
-
"42161": "https://subgrapher.
|
|
3513
|
+
"1": "https://subgrapher-e2icx.ondigitalocean.app/gateway.thegraph.com/api/0f15b42bdeff7a063a4e1757d7e2f99e/deployments/id/QmXZiV6S13ha6QXq4dmaM3TB4CHcDxBMvGexSNu9Kc28EH",
|
|
3514
|
+
"5": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-goerli",
|
|
3515
|
+
"10": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-optimism",
|
|
3516
|
+
"56": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-binance-smart-chain",
|
|
3517
|
+
"100": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-gnosis-chain",
|
|
3518
|
+
"137": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-polygon",
|
|
3519
|
+
"250": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-fantom",
|
|
3520
|
+
"42161": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-arbitrum"
|
|
3512
3521
|
};
|
|
3513
3522
|
|
|
3514
3523
|
var SingleChoiceVoting = /** @class */ (function () {
|
|
@@ -4223,10 +4232,21 @@ function validateSchema(schema, data) {
|
|
|
4223
4232
|
}
|
|
4224
4233
|
function getEnsTextRecord(ens, record, network) {
|
|
4225
4234
|
if (network === void 0) { network = '1'; }
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4235
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4236
|
+
var ensResolvers, ensHash, provider, result;
|
|
4237
|
+
return __generator(this, function (_a) {
|
|
4238
|
+
switch (_a.label) {
|
|
4239
|
+
case 0:
|
|
4240
|
+
ensResolvers = networks[network].ensResolvers || networks['1'].ensResolvers;
|
|
4241
|
+
ensHash = ethEnsNamehash.hash(ethEnsNamehash.normalize(ens));
|
|
4242
|
+
provider = getProvider(network);
|
|
4243
|
+
return [4 /*yield*/, multicall(network, provider, ENS_RESOLVER_ABI, ensResolvers.map(function (address) { return [address, 'text', [ensHash, record]]; }))];
|
|
4244
|
+
case 1:
|
|
4245
|
+
result = _a.sent();
|
|
4246
|
+
return [2 /*return*/, result.flat().find(function (r) { return r; }) || ''];
|
|
4247
|
+
}
|
|
4248
|
+
});
|
|
4249
|
+
});
|
|
4230
4250
|
}
|
|
4231
4251
|
function getSpaceUri(id, network) {
|
|
4232
4252
|
if (network === void 0) { network = '1'; }
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -1312,7 +1312,10 @@ var networks = {
|
|
|
1312
1312
|
chainId: 1,
|
|
1313
1313
|
network: "homestead",
|
|
1314
1314
|
multicall: "0xeefba1e63905ef1d7acba5a8513c70307c1ce441",
|
|
1315
|
-
|
|
1315
|
+
ensResolvers: [
|
|
1316
|
+
"0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63",
|
|
1317
|
+
"0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"
|
|
1318
|
+
],
|
|
1316
1319
|
ensNameWrapper: "0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401",
|
|
1317
1320
|
rpc: [
|
|
1318
1321
|
"https://rpc.ankr.com/eth",
|
|
@@ -1347,7 +1350,10 @@ var networks = {
|
|
|
1347
1350
|
network: "goerli",
|
|
1348
1351
|
testnet: true,
|
|
1349
1352
|
multicall: "0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e",
|
|
1350
|
-
|
|
1353
|
+
ensResolvers: [
|
|
1354
|
+
"0xd7a4F6473f32aC2Af804B3686AE8F1932bC35750",
|
|
1355
|
+
"0x4B1488B7a6B320d2D721406204aBc3eeAa9AD329"
|
|
1356
|
+
],
|
|
1351
1357
|
ensNameWrapper: "0x114D4603199df73e7D157787f8778E21fCd13066",
|
|
1352
1358
|
rpc: [
|
|
1353
1359
|
"https://eth-goerli.alchemyapi.io/v2/v4nqH_J-J3STit45Mm07TxuYexMHQsYZ"
|
|
@@ -2325,7 +2331,10 @@ var networks = {
|
|
|
2325
2331
|
network: "mainnet",
|
|
2326
2332
|
multicall: "0x55034b2cF530ae3A8fC1e2e4523F58496796610F",
|
|
2327
2333
|
rpc: [
|
|
2328
|
-
"https://evm-dataseed1.meerscan.
|
|
2334
|
+
"https://evm-dataseed1.meerscan.io",
|
|
2335
|
+
"https://evm-dataseed.meerscan.com",
|
|
2336
|
+
"https://evm-dataseed2.meerscan.io",
|
|
2337
|
+
"https://evm-dataseed3.meerscan.io"
|
|
2329
2338
|
],
|
|
2330
2339
|
explorer: {
|
|
2331
2340
|
url: "https://evm.meerscan.io"
|
|
@@ -3492,14 +3501,14 @@ var networks = {
|
|
|
3492
3501
|
};
|
|
3493
3502
|
|
|
3494
3503
|
var delegationSubgraphs = {
|
|
3495
|
-
"1": "https://subgrapher.
|
|
3496
|
-
"5": "https://subgrapher.
|
|
3497
|
-
"10": "https://subgrapher.
|
|
3498
|
-
"56": "https://subgrapher.
|
|
3499
|
-
"100": "https://subgrapher.
|
|
3500
|
-
"137": "https://subgrapher.
|
|
3501
|
-
"250": "https://subgrapher.
|
|
3502
|
-
"42161": "https://subgrapher.
|
|
3504
|
+
"1": "https://subgrapher-e2icx.ondigitalocean.app/gateway.thegraph.com/api/0f15b42bdeff7a063a4e1757d7e2f99e/deployments/id/QmXZiV6S13ha6QXq4dmaM3TB4CHcDxBMvGexSNu9Kc28EH",
|
|
3505
|
+
"5": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-goerli",
|
|
3506
|
+
"10": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-optimism",
|
|
3507
|
+
"56": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-binance-smart-chain",
|
|
3508
|
+
"100": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-gnosis-chain",
|
|
3509
|
+
"137": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-polygon",
|
|
3510
|
+
"250": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-fantom",
|
|
3511
|
+
"42161": "https://subgrapher-e2icx.ondigitalocean.app/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-arbitrum"
|
|
3503
3512
|
};
|
|
3504
3513
|
|
|
3505
3514
|
var SingleChoiceVoting = /** @class */ (function () {
|
|
@@ -4214,10 +4223,21 @@ function validateSchema(schema, data) {
|
|
|
4214
4223
|
}
|
|
4215
4224
|
function getEnsTextRecord(ens, record, network) {
|
|
4216
4225
|
if (network === void 0) { network = '1'; }
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4226
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4227
|
+
var ensResolvers, ensHash, provider, result;
|
|
4228
|
+
return __generator(this, function (_a) {
|
|
4229
|
+
switch (_a.label) {
|
|
4230
|
+
case 0:
|
|
4231
|
+
ensResolvers = networks[network].ensResolvers || networks['1'].ensResolvers;
|
|
4232
|
+
ensHash = hash(normalize(ens));
|
|
4233
|
+
provider = getProvider(network);
|
|
4234
|
+
return [4 /*yield*/, multicall(network, provider, ENS_RESOLVER_ABI, ensResolvers.map(function (address) { return [address, 'text', [ensHash, record]]; }))];
|
|
4235
|
+
case 1:
|
|
4236
|
+
result = _a.sent();
|
|
4237
|
+
return [2 /*return*/, result.flat().find(function (r) { return r; }) || ''];
|
|
4238
|
+
}
|
|
4239
|
+
});
|
|
4240
|
+
});
|
|
4221
4241
|
}
|
|
4222
4242
|
function getSpaceUri(id, network) {
|
|
4223
4243
|
if (network === void 0) { network = '1'; }
|