polkamarkets-js 3.1.9 → 3.1.10
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/package.json
CHANGED
|
@@ -198,11 +198,21 @@ class PredictionMarketV3Contract extends PredictionMarketV2Contract {
|
|
|
198
198
|
const decimals = marketDecimals[marketId];
|
|
199
199
|
|
|
200
200
|
const outcomeShares = Object.fromEntries(marketData.outcomeShares.map((item, index) => {
|
|
201
|
+
const shares = Numbers.fromDecimalsNumber(item, decimals);
|
|
202
|
+
const price = this.getAverageOutcomeBuyPrice({events, marketId, outcomeId: index});
|
|
203
|
+
const voidedWinningsToClaim = marketData.voidedSharesToClaim && shares > 0;
|
|
204
|
+
const voidedWinningsClaimed = voidedWinningsToClaim && events.some((event) => {
|
|
205
|
+
return event.action === 'Claim Voided' &&
|
|
206
|
+
event.marketId === marketId &&
|
|
207
|
+
event.outcomeId === index
|
|
208
|
+
});
|
|
201
209
|
return [
|
|
202
210
|
index,
|
|
203
211
|
{
|
|
204
|
-
shares
|
|
205
|
-
price
|
|
212
|
+
shares,
|
|
213
|
+
price,
|
|
214
|
+
voidedWinningsToClaim,
|
|
215
|
+
voidedWinningsClaimed
|
|
206
216
|
}
|
|
207
217
|
];
|
|
208
218
|
}));
|