@dorafactory/maci-sdk 0.0.19 → 0.0.21

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.
@@ -18,7 +18,7 @@ declare class Http {
18
18
  private getFetch;
19
19
  fetch(url: string, options?: any): Promise<Response>;
20
20
  fetchGraphql<T>(query: string, after: string, limit?: number | null): Promise<T>;
21
- fetchRest(path: string): Promise<any>;
21
+ fetchRest(path: string, options?: any): Promise<any>;
22
22
  }
23
23
 
24
24
  /**
@@ -129,16 +129,16 @@ type CreateRoundParams = {
129
129
  circuitType: MaciCircuitType;
130
130
  };
131
131
  type CreateAMaciRoundParams = {
132
- maxVoter: string;
133
- maxOption: string;
132
+ maxVoter: number;
133
+ maxOption: number;
134
134
  operator: string;
135
135
  whitelist: Whitelist$2;
136
136
  voiceCreditAmount: string;
137
137
  preDeactivateRoot?: string;
138
138
  } & CreateRoundParams;
139
139
  type CreateMaciRoundParams = {
140
- maxVoter: string;
141
- maxOption: string;
140
+ maxVoter: number;
141
+ maxOption: number;
142
142
  operatorPubkey: string;
143
143
  whitelist: Whitelist$1;
144
144
  certSystemType: MaciCertSystemType;
@@ -259,6 +259,18 @@ type ProofType = {
259
259
  proof: string;
260
260
  }[];
261
261
  };
262
+ type OperatorDelayType = {
263
+ blockHeight: string;
264
+ delayProcessDmsgCount: number;
265
+ delayDuration: string;
266
+ delayReason: string;
267
+ delayType: string;
268
+ id: string;
269
+ nodeId: string;
270
+ operatorAddress: string;
271
+ timestamp: string;
272
+ roundAddress: string;
273
+ };
262
274
  type OperatorType = {
263
275
  id: string;
264
276
  validatorAddress: string;
@@ -319,6 +331,24 @@ type BalanceResponse = SuccessResponse<{
319
331
  type OperatorResponse = SuccessResponse<{
320
332
  operator: OperatorType;
321
333
  }> | ErrorResponse;
334
+ type MissRateResponse = SuccessResponse<{
335
+ missRate: (MissRateType & {
336
+ date: string;
337
+ })[];
338
+ }> | ErrorResponse;
339
+ type OperatorDelayOperationsResponse = SuccessResponse<{
340
+ operatorDelayOperations: {
341
+ pageInfo: {
342
+ endCursor: string;
343
+ hasNextPage: boolean;
344
+ };
345
+ edges: {
346
+ cursor: string;
347
+ node: OperatorDelayType;
348
+ }[];
349
+ totalCount: number;
350
+ };
351
+ }> | ErrorResponse;
322
352
  type OperatorsResponse = SuccessResponse<{
323
353
  operators: {
324
354
  pageInfo: {
@@ -357,6 +387,31 @@ type RoundsCountGraphqlResponse = {
357
387
  };
358
388
  };
359
389
  };
390
+ type VoteCountGraphqlResponse = {
391
+ data: {
392
+ signupsCount: {
393
+ totalCount: number;
394
+ };
395
+ messagesCount: {
396
+ totalCount: number;
397
+ };
398
+ };
399
+ };
400
+ type OperatorDelayOperationsGraphqlResponse = {
401
+ data: {
402
+ operatorDelayOperations: {
403
+ pageInfo: {
404
+ endCursor: string;
405
+ hasNextPage: boolean;
406
+ };
407
+ edges: {
408
+ cursor: string;
409
+ node: OperatorDelayType;
410
+ }[];
411
+ totalCount: number;
412
+ };
413
+ };
414
+ };
360
415
  type TransactionGraphqlResponse = {
361
416
  data: {
362
417
  transaction: TransactionType;
@@ -447,6 +502,21 @@ type SignUpEventsGraphqlResponse = {
447
502
  };
448
503
  };
449
504
  };
505
+ type MissRateType = {
506
+ delayCount: number;
507
+ deactivateDelay: {
508
+ count: number;
509
+ dmsgCount: number;
510
+ };
511
+ tallyDelay: {
512
+ count: number;
513
+ };
514
+ totalDelayDuration: number;
515
+ avgDelayDuration: number;
516
+ tallyCount: number;
517
+ deactivateCount: number;
518
+ missRate: number;
519
+ };
450
520
 
451
521
  declare class UserAccount {
452
522
  http: Http;
@@ -466,7 +536,9 @@ declare class Operator {
466
536
  amaciRegistryContract: string;
467
537
  constructor(http: Http, amaciRegistryContract: string);
468
538
  getOperatorByAddress(address: string): Promise<OperatorResponse>;
539
+ getOperatorDelayOperationsByAddress(address: string, after: string, limit?: number): Promise<OperatorDelayOperationsResponse>;
469
540
  getOperators(after: string, limit?: number): Promise<OperatorsResponse>;
541
+ queryMissRate(address: string, durationDay: number): Promise<MissRateResponse>;
470
542
  }
471
543
 
472
544
  declare class Round {
@@ -583,6 +655,8 @@ declare class Indexer {
583
655
  * @returns {Promise<OperatorResponse>} The operator response.
584
656
  */
585
657
  getOperatorByAddress(address: string): Promise<OperatorResponse>;
658
+ getOperatorDelayOperationsByAddress(address: string, after: string, limit?: number): Promise<OperatorDelayOperationsResponse>;
659
+ queryMissRate(address: string, durationDay: number): Promise<MissRateResponse>;
586
660
  /**
587
661
  * @method getOperators
588
662
  * @description Get multiple operators.
@@ -1540,12 +1614,21 @@ type SignatureResponse = {
1540
1614
  amount: string;
1541
1615
  snapshotHeight: string;
1542
1616
  };
1617
+ type FeegrantAllowanceResponse = {
1618
+ granter: string;
1619
+ grantee: string;
1620
+ spend_limit: {
1621
+ denom: string;
1622
+ amount: string;
1623
+ }[];
1624
+ };
1543
1625
 
1544
1626
  declare class OracleCertificate {
1545
1627
  private certificateApiEndpoint;
1546
1628
  private http;
1547
1629
  constructor({ certificateApiEndpoint, http }: OracleCertificateParams);
1548
1630
  sign(data: SignatureRequest): Promise<SignatureResponse>;
1631
+ feegrantAllowance(granter: string, grantee: string): Promise<FeegrantAllowanceResponse>;
1549
1632
  }
1550
1633
 
1551
1634
  type MixedData<T> = T | Array<MixedData<T>> | {
@@ -1628,6 +1711,10 @@ declare class MACI {
1628
1711
  contractAddress: string;
1629
1712
  pubKey: bigint[];
1630
1713
  }): Promise<number>;
1714
+ feegrantAllowance({ address, contractAddress, }: {
1715
+ address: string;
1716
+ contractAddress: string;
1717
+ }): Promise<FeegrantAllowanceResponse>;
1631
1718
  queryWhitelistBalanceOf({ signer, address, contractAddress, certificate, mode, }: {
1632
1719
  signer: OfflineSigner;
1633
1720
  address: string;
@@ -1653,6 +1740,12 @@ declare class MACI {
1653
1740
  queryRoundIsQv({ contractAddress }: {
1654
1741
  contractAddress: string;
1655
1742
  }): Promise<boolean>;
1743
+ queryRoundClaimable({ contractAddress, }: {
1744
+ contractAddress: string;
1745
+ }): Promise<{
1746
+ claimable: boolean | null;
1747
+ balance: string | null;
1748
+ }>;
1656
1749
  queryRoundGasStation({ contractAddress }: {
1657
1750
  contractAddress: string;
1658
1751
  }): Promise<boolean>;
@@ -2010,4 +2103,4 @@ declare function decompressPublicKey(compressedPubkey: string): {
2010
2103
  };
2011
2104
  declare function compressPublicKey(decompressedPubkey: any[]): string;
2012
2105
 
2013
- export { type Account, type BalanceResponse, type CertificateEcosystem, Circom, Circuit, type CircuitResponse, type CircuitType, type CircuitsCountGraphqlResponse, type CircuitsResponse, type ClientParams, Contract, type ContractParams, type CreateAMaciRoundParams, type CreateMaciRoundParams, type CreateOracleMaciRoundParams, type CreateRoundParams, type ErrorResponse, Event, Http, Indexer, MACI, MaciCertSystemType, MaciCircuitType, MaciClient, MaciRoundType, type NetworkConfig, Operator, type OperatorResponse, type OperatorType, type OperatorsGraphqlResponse, type OperatorsResponse, OracleCertificate, type PrivateKey, Proof, type ProofGraphqlResponse, type ProofResponse, type ProofType, type PublicKey, Round, type RoundGraphqlResponse, type RoundResponse, type RoundType, type RoundsCountGraphqlResponse, type RoundsGraphqlResponse, type RoundsResponse, type SignUpEventType, type SignUpEventsGraphqlResponse, type SignUpEventsResponse, type SuccessResponse, Transaction, type TransactionGraphqlResponse, type TransactionResponse, type TransactionType, type TransactionsGraphqlResponse, type TransactionsResponse, UserAccount, batchGenMessage, circuits, compressPublicKey, decompressPublicKey, genAddKeyProof, genEcdhSharedKey, genKeypair, genMessageFactory, getDefaultParams, hexToDecimalString, isValidAddress, privateKeyFromTxt, stringizing, validator_operator_set };
2106
+ export { type Account, type BalanceResponse, type CertificateEcosystem, Circom, Circuit, type CircuitResponse, type CircuitType, type CircuitsCountGraphqlResponse, type CircuitsResponse, type ClientParams, Contract, type ContractParams, type CreateAMaciRoundParams, type CreateMaciRoundParams, type CreateOracleMaciRoundParams, type CreateRoundParams, type ErrorResponse, Event, Http, Indexer, MACI, MaciCertSystemType, MaciCircuitType, MaciClient, MaciRoundType, type MissRateResponse, type MissRateType, type NetworkConfig, Operator, type OperatorDelayOperationsGraphqlResponse, type OperatorDelayOperationsResponse, type OperatorDelayType, type OperatorResponse, type OperatorType, type OperatorsGraphqlResponse, type OperatorsResponse, OracleCertificate, type PrivateKey, Proof, type ProofGraphqlResponse, type ProofResponse, type ProofType, type PublicKey, Round, type RoundGraphqlResponse, type RoundResponse, type RoundType, type RoundsCountGraphqlResponse, type RoundsGraphqlResponse, type RoundsResponse, type SignUpEventType, type SignUpEventsGraphqlResponse, type SignUpEventsResponse, type SuccessResponse, Transaction, type TransactionGraphqlResponse, type TransactionResponse, type TransactionType, type TransactionsGraphqlResponse, type TransactionsResponse, UserAccount, type VoteCountGraphqlResponse, batchGenMessage, circuits, compressPublicKey, decompressPublicKey, genAddKeyProof, genEcdhSharedKey, genKeypair, genMessageFactory, getDefaultParams, hexToDecimalString, isValidAddress, privateKeyFromTxt, stringizing, validator_operator_set };
package/dist/browser.d.ts CHANGED
@@ -18,7 +18,7 @@ declare class Http {
18
18
  private getFetch;
19
19
  fetch(url: string, options?: any): Promise<Response>;
20
20
  fetchGraphql<T>(query: string, after: string, limit?: number | null): Promise<T>;
21
- fetchRest(path: string): Promise<any>;
21
+ fetchRest(path: string, options?: any): Promise<any>;
22
22
  }
23
23
 
24
24
  /**
@@ -129,16 +129,16 @@ type CreateRoundParams = {
129
129
  circuitType: MaciCircuitType;
130
130
  };
131
131
  type CreateAMaciRoundParams = {
132
- maxVoter: string;
133
- maxOption: string;
132
+ maxVoter: number;
133
+ maxOption: number;
134
134
  operator: string;
135
135
  whitelist: Whitelist$2;
136
136
  voiceCreditAmount: string;
137
137
  preDeactivateRoot?: string;
138
138
  } & CreateRoundParams;
139
139
  type CreateMaciRoundParams = {
140
- maxVoter: string;
141
- maxOption: string;
140
+ maxVoter: number;
141
+ maxOption: number;
142
142
  operatorPubkey: string;
143
143
  whitelist: Whitelist$1;
144
144
  certSystemType: MaciCertSystemType;
@@ -259,6 +259,18 @@ type ProofType = {
259
259
  proof: string;
260
260
  }[];
261
261
  };
262
+ type OperatorDelayType = {
263
+ blockHeight: string;
264
+ delayProcessDmsgCount: number;
265
+ delayDuration: string;
266
+ delayReason: string;
267
+ delayType: string;
268
+ id: string;
269
+ nodeId: string;
270
+ operatorAddress: string;
271
+ timestamp: string;
272
+ roundAddress: string;
273
+ };
262
274
  type OperatorType = {
263
275
  id: string;
264
276
  validatorAddress: string;
@@ -319,6 +331,24 @@ type BalanceResponse = SuccessResponse<{
319
331
  type OperatorResponse = SuccessResponse<{
320
332
  operator: OperatorType;
321
333
  }> | ErrorResponse;
334
+ type MissRateResponse = SuccessResponse<{
335
+ missRate: (MissRateType & {
336
+ date: string;
337
+ })[];
338
+ }> | ErrorResponse;
339
+ type OperatorDelayOperationsResponse = SuccessResponse<{
340
+ operatorDelayOperations: {
341
+ pageInfo: {
342
+ endCursor: string;
343
+ hasNextPage: boolean;
344
+ };
345
+ edges: {
346
+ cursor: string;
347
+ node: OperatorDelayType;
348
+ }[];
349
+ totalCount: number;
350
+ };
351
+ }> | ErrorResponse;
322
352
  type OperatorsResponse = SuccessResponse<{
323
353
  operators: {
324
354
  pageInfo: {
@@ -357,6 +387,31 @@ type RoundsCountGraphqlResponse = {
357
387
  };
358
388
  };
359
389
  };
390
+ type VoteCountGraphqlResponse = {
391
+ data: {
392
+ signupsCount: {
393
+ totalCount: number;
394
+ };
395
+ messagesCount: {
396
+ totalCount: number;
397
+ };
398
+ };
399
+ };
400
+ type OperatorDelayOperationsGraphqlResponse = {
401
+ data: {
402
+ operatorDelayOperations: {
403
+ pageInfo: {
404
+ endCursor: string;
405
+ hasNextPage: boolean;
406
+ };
407
+ edges: {
408
+ cursor: string;
409
+ node: OperatorDelayType;
410
+ }[];
411
+ totalCount: number;
412
+ };
413
+ };
414
+ };
360
415
  type TransactionGraphqlResponse = {
361
416
  data: {
362
417
  transaction: TransactionType;
@@ -447,6 +502,21 @@ type SignUpEventsGraphqlResponse = {
447
502
  };
448
503
  };
449
504
  };
505
+ type MissRateType = {
506
+ delayCount: number;
507
+ deactivateDelay: {
508
+ count: number;
509
+ dmsgCount: number;
510
+ };
511
+ tallyDelay: {
512
+ count: number;
513
+ };
514
+ totalDelayDuration: number;
515
+ avgDelayDuration: number;
516
+ tallyCount: number;
517
+ deactivateCount: number;
518
+ missRate: number;
519
+ };
450
520
 
451
521
  declare class UserAccount {
452
522
  http: Http;
@@ -466,7 +536,9 @@ declare class Operator {
466
536
  amaciRegistryContract: string;
467
537
  constructor(http: Http, amaciRegistryContract: string);
468
538
  getOperatorByAddress(address: string): Promise<OperatorResponse>;
539
+ getOperatorDelayOperationsByAddress(address: string, after: string, limit?: number): Promise<OperatorDelayOperationsResponse>;
469
540
  getOperators(after: string, limit?: number): Promise<OperatorsResponse>;
541
+ queryMissRate(address: string, durationDay: number): Promise<MissRateResponse>;
470
542
  }
471
543
 
472
544
  declare class Round {
@@ -583,6 +655,8 @@ declare class Indexer {
583
655
  * @returns {Promise<OperatorResponse>} The operator response.
584
656
  */
585
657
  getOperatorByAddress(address: string): Promise<OperatorResponse>;
658
+ getOperatorDelayOperationsByAddress(address: string, after: string, limit?: number): Promise<OperatorDelayOperationsResponse>;
659
+ queryMissRate(address: string, durationDay: number): Promise<MissRateResponse>;
586
660
  /**
587
661
  * @method getOperators
588
662
  * @description Get multiple operators.
@@ -1540,12 +1614,21 @@ type SignatureResponse = {
1540
1614
  amount: string;
1541
1615
  snapshotHeight: string;
1542
1616
  };
1617
+ type FeegrantAllowanceResponse = {
1618
+ granter: string;
1619
+ grantee: string;
1620
+ spend_limit: {
1621
+ denom: string;
1622
+ amount: string;
1623
+ }[];
1624
+ };
1543
1625
 
1544
1626
  declare class OracleCertificate {
1545
1627
  private certificateApiEndpoint;
1546
1628
  private http;
1547
1629
  constructor({ certificateApiEndpoint, http }: OracleCertificateParams);
1548
1630
  sign(data: SignatureRequest): Promise<SignatureResponse>;
1631
+ feegrantAllowance(granter: string, grantee: string): Promise<FeegrantAllowanceResponse>;
1549
1632
  }
1550
1633
 
1551
1634
  type MixedData<T> = T | Array<MixedData<T>> | {
@@ -1628,6 +1711,10 @@ declare class MACI {
1628
1711
  contractAddress: string;
1629
1712
  pubKey: bigint[];
1630
1713
  }): Promise<number>;
1714
+ feegrantAllowance({ address, contractAddress, }: {
1715
+ address: string;
1716
+ contractAddress: string;
1717
+ }): Promise<FeegrantAllowanceResponse>;
1631
1718
  queryWhitelistBalanceOf({ signer, address, contractAddress, certificate, mode, }: {
1632
1719
  signer: OfflineSigner;
1633
1720
  address: string;
@@ -1653,6 +1740,12 @@ declare class MACI {
1653
1740
  queryRoundIsQv({ contractAddress }: {
1654
1741
  contractAddress: string;
1655
1742
  }): Promise<boolean>;
1743
+ queryRoundClaimable({ contractAddress, }: {
1744
+ contractAddress: string;
1745
+ }): Promise<{
1746
+ claimable: boolean | null;
1747
+ balance: string | null;
1748
+ }>;
1656
1749
  queryRoundGasStation({ contractAddress }: {
1657
1750
  contractAddress: string;
1658
1751
  }): Promise<boolean>;
@@ -2010,4 +2103,4 @@ declare function decompressPublicKey(compressedPubkey: string): {
2010
2103
  };
2011
2104
  declare function compressPublicKey(decompressedPubkey: any[]): string;
2012
2105
 
2013
- export { type Account, type BalanceResponse, type CertificateEcosystem, Circom, Circuit, type CircuitResponse, type CircuitType, type CircuitsCountGraphqlResponse, type CircuitsResponse, type ClientParams, Contract, type ContractParams, type CreateAMaciRoundParams, type CreateMaciRoundParams, type CreateOracleMaciRoundParams, type CreateRoundParams, type ErrorResponse, Event, Http, Indexer, MACI, MaciCertSystemType, MaciCircuitType, MaciClient, MaciRoundType, type NetworkConfig, Operator, type OperatorResponse, type OperatorType, type OperatorsGraphqlResponse, type OperatorsResponse, OracleCertificate, type PrivateKey, Proof, type ProofGraphqlResponse, type ProofResponse, type ProofType, type PublicKey, Round, type RoundGraphqlResponse, type RoundResponse, type RoundType, type RoundsCountGraphqlResponse, type RoundsGraphqlResponse, type RoundsResponse, type SignUpEventType, type SignUpEventsGraphqlResponse, type SignUpEventsResponse, type SuccessResponse, Transaction, type TransactionGraphqlResponse, type TransactionResponse, type TransactionType, type TransactionsGraphqlResponse, type TransactionsResponse, UserAccount, batchGenMessage, circuits, compressPublicKey, decompressPublicKey, genAddKeyProof, genEcdhSharedKey, genKeypair, genMessageFactory, getDefaultParams, hexToDecimalString, isValidAddress, privateKeyFromTxt, stringizing, validator_operator_set };
2106
+ export { type Account, type BalanceResponse, type CertificateEcosystem, Circom, Circuit, type CircuitResponse, type CircuitType, type CircuitsCountGraphqlResponse, type CircuitsResponse, type ClientParams, Contract, type ContractParams, type CreateAMaciRoundParams, type CreateMaciRoundParams, type CreateOracleMaciRoundParams, type CreateRoundParams, type ErrorResponse, Event, Http, Indexer, MACI, MaciCertSystemType, MaciCircuitType, MaciClient, MaciRoundType, type MissRateResponse, type MissRateType, type NetworkConfig, Operator, type OperatorDelayOperationsGraphqlResponse, type OperatorDelayOperationsResponse, type OperatorDelayType, type OperatorResponse, type OperatorType, type OperatorsGraphqlResponse, type OperatorsResponse, OracleCertificate, type PrivateKey, Proof, type ProofGraphqlResponse, type ProofResponse, type ProofType, type PublicKey, Round, type RoundGraphqlResponse, type RoundResponse, type RoundType, type RoundsCountGraphqlResponse, type RoundsGraphqlResponse, type RoundsResponse, type SignUpEventType, type SignUpEventsGraphqlResponse, type SignUpEventsResponse, type SuccessResponse, Transaction, type TransactionGraphqlResponse, type TransactionResponse, type TransactionType, type TransactionsGraphqlResponse, type TransactionsResponse, UserAccount, type VoteCountGraphqlResponse, batchGenMessage, circuits, compressPublicKey, decompressPublicKey, genAddKeyProof, genEcdhSharedKey, genKeypair, genMessageFactory, getDefaultParams, hexToDecimalString, isValidAddress, privateKeyFromTxt, stringizing, validator_operator_set };