@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.
@@ -1656,6 +1656,7 @@ declare class MACI {
1656
1656
  queryRoundGasStation({ contractAddress }: {
1657
1657
  contractAddress: string;
1658
1658
  }): Promise<boolean>;
1659
+ parseRoundStatus(votingStart: number, votingEnd: number, status: string, currentTime: Date): string;
1659
1660
  requestOracleCertificate({ signer, ecosystem, address, contractAddress, }: {
1660
1661
  signer: OfflineSigner;
1661
1662
  ecosystem: CertificateEcosystem;
package/dist/browser.d.ts CHANGED
@@ -1656,6 +1656,7 @@ declare class MACI {
1656
1656
  queryRoundGasStation({ contractAddress }: {
1657
1657
  contractAddress: string;
1658
1658
  }): Promise<boolean>;
1659
+ parseRoundStatus(votingStart: number, votingEnd: number, status: string, currentTime: Date): string;
1659
1660
  requestOracleCertificate({ signer, ecosystem, address, contractAddress, }: {
1660
1661
  signer: OfflineSigner;
1661
1662
  ecosystem: CertificateEcosystem;
package/dist/browser.js CHANGED
@@ -30325,6 +30325,28 @@ var MACI = class {
30325
30325
  const roundInfo = await this.getRoundInfo({ contractAddress });
30326
30326
  return roundInfo.gasStationEnable;
30327
30327
  }
30328
+ parseRoundStatus(votingStart, votingEnd, status, currentTime) {
30329
+ const startTime = new Date(votingStart / 10 ** 6);
30330
+ const endTime = new Date(votingEnd / 10 ** 6);
30331
+ if (Number(votingStart) === 0) {
30332
+ return "Created";
30333
+ }
30334
+ if (Number(votingEnd) === 0) {
30335
+ if (startTime < currentTime) {
30336
+ return "Ongoing";
30337
+ }
30338
+ } else {
30339
+ if (startTime < currentTime && currentTime < endTime) {
30340
+ return "Ongoing";
30341
+ }
30342
+ if (currentTime > endTime) {
30343
+ if (status !== "Closed") {
30344
+ return "Tallying";
30345
+ }
30346
+ }
30347
+ }
30348
+ return status;
30349
+ }
30328
30350
  async requestOracleCertificate({
30329
30351
  signer,
30330
30352
  ecosystem,