@snapshot-labs/snapshot.js 0.14.7 → 0.14.9
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 +4 -4
- package/dist/snapshot.esm.js +4 -4
- package/dist/snapshot.min.js +1 -1
- package/dist/src/utils.d.ts +2 -1
- package/package.json +1 -1
- package/src/utils.spec.js +1 -2
- package/src/utils.ts +2 -3
- package/src/voting/rankedChoice.ts +1 -1
package/dist/snapshot.cjs.js
CHANGED
|
@@ -2705,7 +2705,7 @@ class RankedChoiceVoting {
|
|
|
2705
2705
|
return this.proposal.choices.map((choice, i) => this.strategies.map((strategy, sI) => {
|
|
2706
2706
|
return finalRound
|
|
2707
2707
|
.filter((res) => Number(res[0]) === i + 1)
|
|
2708
|
-
.reduce((a, b) => a + b[1][1][sI] || 0, 0);
|
|
2708
|
+
.reduce((a, b) => a + (b[1][1][sI] || 0), 0);
|
|
2709
2709
|
}));
|
|
2710
2710
|
}
|
|
2711
2711
|
getScoresTotal() {
|
|
@@ -3639,7 +3639,8 @@ function getScores(space_1, strategies_1, network_1, addresses_1) {
|
|
|
3639
3639
|
}
|
|
3640
3640
|
});
|
|
3641
3641
|
}
|
|
3642
|
-
function getVp(address, network, strategies, snapshot, space, delegation,
|
|
3642
|
+
function getVp(address, network, strategies, snapshot, space, delegation, // @deprecated - kept for backward compatibility for integrators using this function, no longer sent to API
|
|
3643
|
+
options) {
|
|
3643
3644
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3644
3645
|
const { url, headers } = formatScoreAPIUrl(options === null || options === void 0 ? void 0 : options.url);
|
|
3645
3646
|
if (!isValidAddress(address)) {
|
|
@@ -3666,8 +3667,7 @@ function getVp(address, network, strategies, snapshot, space, delegation, option
|
|
|
3666
3667
|
network,
|
|
3667
3668
|
strategies,
|
|
3668
3669
|
snapshot,
|
|
3669
|
-
space
|
|
3670
|
-
delegation
|
|
3670
|
+
space
|
|
3671
3671
|
}
|
|
3672
3672
|
})
|
|
3673
3673
|
};
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -2695,7 +2695,7 @@ class RankedChoiceVoting {
|
|
|
2695
2695
|
return this.proposal.choices.map((choice, i) => this.strategies.map((strategy, sI) => {
|
|
2696
2696
|
return finalRound
|
|
2697
2697
|
.filter((res) => Number(res[0]) === i + 1)
|
|
2698
|
-
.reduce((a, b) => a + b[1][1][sI] || 0, 0);
|
|
2698
|
+
.reduce((a, b) => a + (b[1][1][sI] || 0), 0);
|
|
2699
2699
|
}));
|
|
2700
2700
|
}
|
|
2701
2701
|
getScoresTotal() {
|
|
@@ -3629,7 +3629,8 @@ function getScores(space_1, strategies_1, network_1, addresses_1) {
|
|
|
3629
3629
|
}
|
|
3630
3630
|
});
|
|
3631
3631
|
}
|
|
3632
|
-
function getVp(address, network, strategies, snapshot, space, delegation,
|
|
3632
|
+
function getVp(address, network, strategies, snapshot, space, delegation, // @deprecated - kept for backward compatibility for integrators using this function, no longer sent to API
|
|
3633
|
+
options) {
|
|
3633
3634
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3634
3635
|
const { url, headers } = formatScoreAPIUrl(options === null || options === void 0 ? void 0 : options.url);
|
|
3635
3636
|
if (!isValidAddress(address)) {
|
|
@@ -3656,8 +3657,7 @@ function getVp(address, network, strategies, snapshot, space, delegation, option
|
|
|
3656
3657
|
network,
|
|
3657
3658
|
strategies,
|
|
3658
3659
|
snapshot,
|
|
3659
|
-
space
|
|
3660
|
-
delegation
|
|
3660
|
+
space
|
|
3661
3661
|
}
|
|
3662
3662
|
})
|
|
3663
3663
|
};
|