@snapshot-labs/snapshot.js 0.12.2 → 0.12.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/dist/snapshot.cjs.js +24 -5
- package/dist/snapshot.esm.js +24 -5
- package/dist/snapshot.min.js +2 -2
- package/dist/src/index.d.ts +9 -2
- package/dist/src/schemas/index.d.ts +8 -2
- package/dist/src/utils/delegation.d.ts +1 -0
- package/dist/src/utils.d.ts +1 -0
- package/package.json +1 -1
- package/src/delegationSubgraphs.json +1 -0
- package/src/schemas/proposal.json +4 -1
- package/src/schemas/update-proposal.json +4 -1
- package/src/utils.spec.js +17 -1
- package/src/utils.ts +18 -3
package/dist/snapshot.cjs.js
CHANGED
|
@@ -922,7 +922,10 @@ var definitions$1 = {
|
|
|
922
922
|
type: "array",
|
|
923
923
|
title: "choices",
|
|
924
924
|
minItems: 1,
|
|
925
|
-
|
|
925
|
+
maxLengthWithSpaceType: {
|
|
926
|
+
"default": 500,
|
|
927
|
+
turbo: 1000
|
|
928
|
+
}
|
|
926
929
|
},
|
|
927
930
|
type: {
|
|
928
931
|
type: "string",
|
|
@@ -1015,7 +1018,10 @@ var definitions$2 = {
|
|
|
1015
1018
|
type: "array",
|
|
1016
1019
|
title: "choices",
|
|
1017
1020
|
minItems: 1,
|
|
1018
|
-
|
|
1021
|
+
maxLengthWithSpaceType: {
|
|
1022
|
+
"default": 500,
|
|
1023
|
+
turbo: 1000
|
|
1024
|
+
}
|
|
1019
1025
|
},
|
|
1020
1026
|
type: {
|
|
1021
1027
|
"enum": [
|
|
@@ -3558,6 +3564,7 @@ var delegationSubgraphs = {
|
|
|
3558
3564
|
"100": "https://subgrapher.snapshot.org/delegation/100",
|
|
3559
3565
|
"137": "https://subgrapher.snapshot.org/delegation/137",
|
|
3560
3566
|
"250": "https://subgrapher.snapshot.org/delegation/250",
|
|
3567
|
+
"8453": "https://subgrapher.snapshot.org/delegation/8453",
|
|
3561
3568
|
"42161": "https://subgrapher.snapshot.org/delegation/42161",
|
|
3562
3569
|
"11155111": "https://subgrapher.snapshot.org/delegation/11155111"
|
|
3563
3570
|
};
|
|
@@ -3756,7 +3763,7 @@ ajv.addKeyword({
|
|
|
3756
3763
|
validate.errors = [
|
|
3757
3764
|
{
|
|
3758
3765
|
keyword: 'maxLengthWithSpaceType',
|
|
3759
|
-
message: `must
|
|
3766
|
+
message: `must not have more than ${schema[spaceType]}`,
|
|
3760
3767
|
params: { limit: schema[spaceType] }
|
|
3761
3768
|
}
|
|
3762
3769
|
];
|
|
@@ -4053,7 +4060,13 @@ function getEnsTextRecord(ens_1, record_1) {
|
|
|
4053
4060
|
var _a, _b;
|
|
4054
4061
|
const { ensResolvers = ((_a = networks[network]) === null || _a === void 0 ? void 0 : _a.ensResolvers) ||
|
|
4055
4062
|
networks['1'].ensResolvers, broviderUrl } = options, multicallOptions = __rest(options, ["ensResolvers", "broviderUrl"]);
|
|
4056
|
-
|
|
4063
|
+
let ensHash;
|
|
4064
|
+
try {
|
|
4065
|
+
ensHash = hash.namehash(hash.ensNormalize(ens));
|
|
4066
|
+
}
|
|
4067
|
+
catch (e) {
|
|
4068
|
+
return null;
|
|
4069
|
+
}
|
|
4057
4070
|
const provider = getProvider(network, { broviderUrl });
|
|
4058
4071
|
const calls = [
|
|
4059
4072
|
[ENS_REGISTRY, 'resolver', [ensHash]], // Query for resolver from registry
|
|
@@ -4083,8 +4096,14 @@ function getEnsOwner(ens_1) {
|
|
|
4083
4096
|
return __awaiter(this, arguments, void 0, function* (ens, network = '1', options = {}) {
|
|
4084
4097
|
const provider = getProvider(network, options);
|
|
4085
4098
|
const ensRegistry = new contracts.Contract(ENS_REGISTRY, ['function owner(bytes32) view returns (address)'], provider);
|
|
4099
|
+
let ensHash;
|
|
4100
|
+
try {
|
|
4101
|
+
ensHash = hash.namehash(hash.ensNormalize(ens));
|
|
4102
|
+
}
|
|
4103
|
+
catch (e) {
|
|
4104
|
+
return null;
|
|
4105
|
+
}
|
|
4086
4106
|
const ensNameWrapper = options.ensNameWrapper || networks[network].ensNameWrapper;
|
|
4087
|
-
const ensHash = hash.namehash(hash.ensNormalize(ens));
|
|
4088
4107
|
let owner = yield ensRegistry.owner(ensHash);
|
|
4089
4108
|
// If owner is the ENSNameWrapper contract, resolve the owner of the name
|
|
4090
4109
|
if (owner === ensNameWrapper) {
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -912,7 +912,10 @@ var definitions$1 = {
|
|
|
912
912
|
type: "array",
|
|
913
913
|
title: "choices",
|
|
914
914
|
minItems: 1,
|
|
915
|
-
|
|
915
|
+
maxLengthWithSpaceType: {
|
|
916
|
+
"default": 500,
|
|
917
|
+
turbo: 1000
|
|
918
|
+
}
|
|
916
919
|
},
|
|
917
920
|
type: {
|
|
918
921
|
type: "string",
|
|
@@ -1005,7 +1008,10 @@ var definitions$2 = {
|
|
|
1005
1008
|
type: "array",
|
|
1006
1009
|
title: "choices",
|
|
1007
1010
|
minItems: 1,
|
|
1008
|
-
|
|
1011
|
+
maxLengthWithSpaceType: {
|
|
1012
|
+
"default": 500,
|
|
1013
|
+
turbo: 1000
|
|
1014
|
+
}
|
|
1009
1015
|
},
|
|
1010
1016
|
type: {
|
|
1011
1017
|
"enum": [
|
|
@@ -3548,6 +3554,7 @@ var delegationSubgraphs = {
|
|
|
3548
3554
|
"100": "https://subgrapher.snapshot.org/delegation/100",
|
|
3549
3555
|
"137": "https://subgrapher.snapshot.org/delegation/137",
|
|
3550
3556
|
"250": "https://subgrapher.snapshot.org/delegation/250",
|
|
3557
|
+
"8453": "https://subgrapher.snapshot.org/delegation/8453",
|
|
3551
3558
|
"42161": "https://subgrapher.snapshot.org/delegation/42161",
|
|
3552
3559
|
"11155111": "https://subgrapher.snapshot.org/delegation/11155111"
|
|
3553
3560
|
};
|
|
@@ -3746,7 +3753,7 @@ ajv.addKeyword({
|
|
|
3746
3753
|
validate.errors = [
|
|
3747
3754
|
{
|
|
3748
3755
|
keyword: 'maxLengthWithSpaceType',
|
|
3749
|
-
message: `must
|
|
3756
|
+
message: `must not have more than ${schema[spaceType]}`,
|
|
3750
3757
|
params: { limit: schema[spaceType] }
|
|
3751
3758
|
}
|
|
3752
3759
|
];
|
|
@@ -4043,7 +4050,13 @@ function getEnsTextRecord(ens_1, record_1) {
|
|
|
4043
4050
|
var _a, _b;
|
|
4044
4051
|
const { ensResolvers = ((_a = networks[network]) === null || _a === void 0 ? void 0 : _a.ensResolvers) ||
|
|
4045
4052
|
networks['1'].ensResolvers, broviderUrl } = options, multicallOptions = __rest(options, ["ensResolvers", "broviderUrl"]);
|
|
4046
|
-
|
|
4053
|
+
let ensHash;
|
|
4054
|
+
try {
|
|
4055
|
+
ensHash = namehash(ensNormalize(ens));
|
|
4056
|
+
}
|
|
4057
|
+
catch (e) {
|
|
4058
|
+
return null;
|
|
4059
|
+
}
|
|
4047
4060
|
const provider = getProvider(network, { broviderUrl });
|
|
4048
4061
|
const calls = [
|
|
4049
4062
|
[ENS_REGISTRY, 'resolver', [ensHash]], // Query for resolver from registry
|
|
@@ -4073,8 +4086,14 @@ function getEnsOwner(ens_1) {
|
|
|
4073
4086
|
return __awaiter(this, arguments, void 0, function* (ens, network = '1', options = {}) {
|
|
4074
4087
|
const provider = getProvider(network, options);
|
|
4075
4088
|
const ensRegistry = new Contract$1(ENS_REGISTRY, ['function owner(bytes32) view returns (address)'], provider);
|
|
4089
|
+
let ensHash;
|
|
4090
|
+
try {
|
|
4091
|
+
ensHash = namehash(ensNormalize(ens));
|
|
4092
|
+
}
|
|
4093
|
+
catch (e) {
|
|
4094
|
+
return null;
|
|
4095
|
+
}
|
|
4076
4096
|
const ensNameWrapper = options.ensNameWrapper || networks[network].ensNameWrapper;
|
|
4077
|
-
const ensHash = namehash(ensNormalize(ens));
|
|
4078
4097
|
let owner = yield ensRegistry.owner(ensHash);
|
|
4079
4098
|
// If owner is the ENSNameWrapper contract, resolve the owner of the name
|
|
4080
4099
|
if (owner === ensNameWrapper) {
|