@dorafactory/maci-sdk 0.0.14 → 0.0.15

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/browser.mjs CHANGED
@@ -30301,6 +30301,28 @@ var MACI = class {
30301
30301
  const roundInfo = await this.getRoundInfo({ contractAddress });
30302
30302
  return roundInfo.gasStationEnable;
30303
30303
  }
30304
+ parseRoundStatus(votingStart, votingEnd, status, currentTime) {
30305
+ const startTime = new Date(votingStart / 10 ** 6);
30306
+ const endTime = new Date(votingEnd / 10 ** 6);
30307
+ if (Number(votingStart) === 0) {
30308
+ return "Created";
30309
+ }
30310
+ if (Number(votingEnd) === 0) {
30311
+ if (startTime < currentTime) {
30312
+ return "Ongoing";
30313
+ }
30314
+ } else {
30315
+ if (startTime < currentTime && currentTime < endTime) {
30316
+ return "Ongoing";
30317
+ }
30318
+ if (currentTime > endTime) {
30319
+ if (status !== "Closed") {
30320
+ return "Tallying";
30321
+ }
30322
+ }
30323
+ }
30324
+ return status;
30325
+ }
30304
30326
  async requestOracleCertificate({
30305
30327
  signer,
30306
30328
  ecosystem,