@snapshot-labs/snapshot.js 0.3.13 → 0.3.17
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 +3 -0
- package/dist/schemas/index.d.ts +3 -0
- package/dist/snapshot.cjs.js +11 -5
- package/dist/snapshot.esm.js +11 -5
- package/dist/snapshot.min.js +2 -2
- package/package.json +1 -1
- package/src/networks.json +2 -2
- package/src/schemas/space.json +3 -0
- package/src/voting/rankedChoice.ts +8 -5
package/dist/index.d.ts
CHANGED
package/dist/schemas/index.d.ts
CHANGED
package/dist/snapshot.cjs.js
CHANGED
|
@@ -785,6 +785,9 @@ var definitions = {
|
|
|
785
785
|
},
|
|
786
786
|
blind: {
|
|
787
787
|
type: "boolean"
|
|
788
|
+
},
|
|
789
|
+
hideAbstain: {
|
|
790
|
+
type: "boolean"
|
|
788
791
|
}
|
|
789
792
|
},
|
|
790
793
|
additionalProperties: false
|
|
@@ -990,12 +993,12 @@ var networks = {
|
|
|
990
993
|
multicall: "0xeefba1e63905ef1d7acba5a8513c70307c1ce441",
|
|
991
994
|
ensResolver: "0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41",
|
|
992
995
|
rpc: [
|
|
993
|
-
"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/eth/mainnet/archive",
|
|
994
996
|
{
|
|
995
997
|
url: "https://api-geth-archive.ankr.com",
|
|
996
998
|
user: "balancer_user",
|
|
997
999
|
password: "balancerAnkr20201015"
|
|
998
1000
|
},
|
|
1001
|
+
"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/eth/mainnet/archive",
|
|
999
1002
|
"https://apis.ankr.com/e62bc219f9c9462b8749defe472d2dc5/6106d4a3ec1d1bcc87ec72158f8fd089/eth/archive/main",
|
|
1000
1003
|
"https://eth-archival.gateway.pokt.network/v1/5f76124fb90218002e9ce985",
|
|
1001
1004
|
"https://eth-mainnet.alchemyapi.io/v2/4bdDVB5QAaorY2UE-GBUbM2yQB3QJqzv",
|
|
@@ -1153,8 +1156,8 @@ var networks = {
|
|
|
1153
1156
|
network: "mainnet",
|
|
1154
1157
|
multicall: "0x1ee38d535d541c55c9dae27b12edf090c608e6fb",
|
|
1155
1158
|
rpc: [
|
|
1156
|
-
"https://apis.ankr.com/c0d871dd3c6d4529b01c9362a9b79e89/6106d4a3ec1d1bcc87ec72158f8fd089/binance/archive/main",
|
|
1157
1159
|
"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/bsc/mainnet/archive",
|
|
1160
|
+
"https://apis.ankr.com/c0d871dd3c6d4529b01c9362a9b79e89/6106d4a3ec1d1bcc87ec72158f8fd089/binance/archive/main",
|
|
1158
1161
|
"https://bsc.getblock.io/mainnet/?api_key=91f8195f-bf46-488f-846a-73d6853790e7",
|
|
1159
1162
|
"https://bsc-private-dataseed1.nariox.org",
|
|
1160
1163
|
"https://bsc-private-dataseed2.nariox.org",
|
|
@@ -2034,9 +2037,12 @@ function irv(ballots, rounds) {
|
|
|
2034
2037
|
var votes = Object.entries(ballots.reduce(function (votes, _a, i, src) {
|
|
2035
2038
|
var _b = __read(_a, 1), v = _b[0];
|
|
2036
2039
|
votes[v[0]][0] += src[i][1];
|
|
2037
|
-
votes[v[0]][1].length > 1
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
+
if (votes[v[0]][1].length > 1)
|
|
2041
|
+
votes[v[0]][1] = votes[v[0]][1].map(function (score, sI) { return score + src[i][2][sI]; });
|
|
2042
|
+
else
|
|
2043
|
+
votes[v[0]][1] = [
|
|
2044
|
+
votes[v[0]][1].concat(src[i][2]).reduce(function (a, b) { return a + b; }, 0)
|
|
2045
|
+
];
|
|
2040
2046
|
return votes;
|
|
2041
2047
|
}, Object.assign.apply(Object, __spread([{}], candidates.map(function (c) {
|
|
2042
2048
|
var _a;
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -776,6 +776,9 @@ var definitions = {
|
|
|
776
776
|
},
|
|
777
777
|
blind: {
|
|
778
778
|
type: "boolean"
|
|
779
|
+
},
|
|
780
|
+
hideAbstain: {
|
|
781
|
+
type: "boolean"
|
|
779
782
|
}
|
|
780
783
|
},
|
|
781
784
|
additionalProperties: false
|
|
@@ -981,12 +984,12 @@ var networks = {
|
|
|
981
984
|
multicall: "0xeefba1e63905ef1d7acba5a8513c70307c1ce441",
|
|
982
985
|
ensResolver: "0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41",
|
|
983
986
|
rpc: [
|
|
984
|
-
"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/eth/mainnet/archive",
|
|
985
987
|
{
|
|
986
988
|
url: "https://api-geth-archive.ankr.com",
|
|
987
989
|
user: "balancer_user",
|
|
988
990
|
password: "balancerAnkr20201015"
|
|
989
991
|
},
|
|
992
|
+
"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/eth/mainnet/archive",
|
|
990
993
|
"https://apis.ankr.com/e62bc219f9c9462b8749defe472d2dc5/6106d4a3ec1d1bcc87ec72158f8fd089/eth/archive/main",
|
|
991
994
|
"https://eth-archival.gateway.pokt.network/v1/5f76124fb90218002e9ce985",
|
|
992
995
|
"https://eth-mainnet.alchemyapi.io/v2/4bdDVB5QAaorY2UE-GBUbM2yQB3QJqzv",
|
|
@@ -1144,8 +1147,8 @@ var networks = {
|
|
|
1144
1147
|
network: "mainnet",
|
|
1145
1148
|
multicall: "0x1ee38d535d541c55c9dae27b12edf090c608e6fb",
|
|
1146
1149
|
rpc: [
|
|
1147
|
-
"https://apis.ankr.com/c0d871dd3c6d4529b01c9362a9b79e89/6106d4a3ec1d1bcc87ec72158f8fd089/binance/archive/main",
|
|
1148
1150
|
"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/bsc/mainnet/archive",
|
|
1151
|
+
"https://apis.ankr.com/c0d871dd3c6d4529b01c9362a9b79e89/6106d4a3ec1d1bcc87ec72158f8fd089/binance/archive/main",
|
|
1149
1152
|
"https://bsc.getblock.io/mainnet/?api_key=91f8195f-bf46-488f-846a-73d6853790e7",
|
|
1150
1153
|
"https://bsc-private-dataseed1.nariox.org",
|
|
1151
1154
|
"https://bsc-private-dataseed2.nariox.org",
|
|
@@ -2025,9 +2028,12 @@ function irv(ballots, rounds) {
|
|
|
2025
2028
|
var votes = Object.entries(ballots.reduce(function (votes, _a, i, src) {
|
|
2026
2029
|
var _b = __read(_a, 1), v = _b[0];
|
|
2027
2030
|
votes[v[0]][0] += src[i][1];
|
|
2028
|
-
votes[v[0]][1].length > 1
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
+
if (votes[v[0]][1].length > 1)
|
|
2032
|
+
votes[v[0]][1] = votes[v[0]][1].map(function (score, sI) { return score + src[i][2][sI]; });
|
|
2033
|
+
else
|
|
2034
|
+
votes[v[0]][1] = [
|
|
2035
|
+
votes[v[0]][1].concat(src[i][2]).reduce(function (a, b) { return a + b; }, 0)
|
|
2036
|
+
];
|
|
2031
2037
|
return votes;
|
|
2032
2038
|
}, Object.assign.apply(Object, __spread([{}], candidates.map(function (c) {
|
|
2033
2039
|
var _a;
|