@dorafactory/maci-sdk 0.0.39 → 0.0.40

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/index.js CHANGED
@@ -4751,7 +4751,8 @@ var Contract = class {
4751
4751
  maxOption,
4752
4752
  voiceCreditAmount,
4753
4753
  circuitType,
4754
- preDeactivateRoot
4754
+ preDeactivateRoot,
4755
+ fee = "auto"
4755
4756
  }) {
4756
4757
  const start_time = (startVoting.getTime() * 10 ** 6).toString();
4757
4758
  const end_time = (endVoting.getTime() * 10 ** 6).toString();
@@ -4782,7 +4783,7 @@ var Contract = class {
4782
4783
  certificationSystem: "0",
4783
4784
  circuitType
4784
4785
  },
4785
- "auto",
4786
+ fee,
4786
4787
  void 0,
4787
4788
  [requiredFee]
4788
4789
  );
@@ -4814,7 +4815,8 @@ var Contract = class {
4814
4815
  maxVoter,
4815
4816
  maxOption,
4816
4817
  circuitType,
4817
- certSystemType
4818
+ certSystemType,
4819
+ fee = "auto"
4818
4820
  }) {
4819
4821
  const start_time = (startVoting.getTime() * 10 ** 6).toString();
4820
4822
  const end_time = (endVoting.getTime() * 10 ** 6).toString();
@@ -4863,7 +4865,7 @@ var Contract = class {
4863
4865
  qtr_lib: QTR_LIB
4864
4866
  },
4865
4867
  `[MACI] ${title}`,
4866
- "auto"
4868
+ fee
4867
4869
  );
4868
4870
  return instantiateResponse;
4869
4871
  }
@@ -4879,7 +4881,8 @@ var Contract = class {
4879
4881
  circuitType,
4880
4882
  whitelistEcosystem,
4881
4883
  whitelistSnapshotHeight,
4882
- whitelistVotingPowerArgs
4884
+ whitelistVotingPowerArgs,
4885
+ fee = "auto"
4883
4886
  }) {
4884
4887
  const start_time = (startVoting.getTime() * 1e6).toString();
4885
4888
  const end_time = (endVoting.getTime() * 1e6).toString();
@@ -4918,7 +4921,7 @@ var Contract = class {
4918
4921
  feegrant_operator: this.feegrantOperator
4919
4922
  },
4920
4923
  `[Oracle MACI] ${title}`,
4921
- "auto"
4924
+ fee
4922
4925
  );
4923
4926
  return instantiateResponse;
4924
4927
  }
@@ -5337,7 +5340,8 @@ var MACI = class {
5337
5340
  contractAddress,
5338
5341
  maciKeypair,
5339
5342
  oracleCertificate,
5340
- gasStation = false
5343
+ gasStation = false,
5344
+ fee
5341
5345
  }) {
5342
5346
  try {
5343
5347
  if (!address) {
@@ -5356,7 +5360,8 @@ var MACI = class {
5356
5360
  pubKey: maciKeypair.pubKey,
5357
5361
  contractAddress,
5358
5362
  oracleCertificate,
5359
- gasStation
5363
+ gasStation,
5364
+ fee
5360
5365
  });
5361
5366
  } else {
5362
5367
  return await this.signupSimple({
@@ -5364,7 +5369,8 @@ var MACI = class {
5364
5369
  address,
5365
5370
  pubKey: maciKeypair.pubKey,
5366
5371
  contractAddress,
5367
- gasStation
5372
+ gasStation,
5373
+ fee
5368
5374
  });
5369
5375
  }
5370
5376
  } catch (error) {
@@ -5494,10 +5500,11 @@ var MACI = class {
5494
5500
  address,
5495
5501
  pubKey,
5496
5502
  contractAddress,
5497
- gasStation
5503
+ gasStation,
5504
+ fee
5498
5505
  }) {
5499
5506
  const gasPrice = import_stargate2.GasPrice.fromString("100000000000peaka");
5500
- const fee = (0, import_stargate2.calculateFee)(6e7, gasPrice);
5507
+ fee = fee || (0, import_stargate2.calculateFee)(6e7, gasPrice);
5501
5508
  if (gasStation === true) {
5502
5509
  const grantFee = {
5503
5510
  amount: fee.amount,
@@ -5538,10 +5545,11 @@ var MACI = class {
5538
5545
  pubKey,
5539
5546
  contractAddress,
5540
5547
  oracleCertificate,
5541
- gasStation
5548
+ gasStation,
5549
+ fee
5542
5550
  }) {
5543
5551
  const gasPrice = import_stargate2.GasPrice.fromString("100000000000peaka");
5544
- const fee = (0, import_stargate2.calculateFee)(6e7, gasPrice);
5552
+ fee = fee || (0, import_stargate2.calculateFee)(6e7, gasPrice);
5545
5553
  if (gasStation === true) {
5546
5554
  const grantFee = {
5547
5555
  amount: fee.amount,
@@ -5582,13 +5590,14 @@ var MACI = class {
5582
5590
  }
5583
5591
  async claimAMaciRound({
5584
5592
  signer,
5585
- contractAddress
5593
+ contractAddress,
5594
+ fee = "auto"
5586
5595
  }) {
5587
5596
  const client = await this.contract.amaciClient({
5588
5597
  signer,
5589
5598
  contractAddress
5590
5599
  });
5591
- return client.claim();
5600
+ return client.claim(fee);
5592
5601
  }
5593
5602
  async getOracleCertificateConfig() {
5594
5603
  const ecosystems = await this.oracleCertificate.listEcosystems();
@@ -5606,7 +5615,8 @@ var MACI = class {
5606
5615
  signer,
5607
5616
  contractAddress,
5608
5617
  address,
5609
- amount
5618
+ amount,
5619
+ fee = "auto"
5610
5620
  }) {
5611
5621
  const client = await this.contract.contractClient({
5612
5622
  signer
@@ -5653,7 +5663,7 @@ var MACI = class {
5653
5663
  }
5654
5664
  ];
5655
5665
  try {
5656
- const result = await client.signAndBroadcast(address, msgs, "auto");
5666
+ const result = await client.signAndBroadcast(address, msgs, fee);
5657
5667
  return result;
5658
5668
  } catch (err) {
5659
5669
  throw err;
@@ -5669,7 +5679,8 @@ var MACI = class {
5669
5679
  async batchRevokeWithdraw({
5670
5680
  signer,
5671
5681
  contractAddress,
5672
- address
5682
+ address,
5683
+ fee = "auto"
5673
5684
  }) {
5674
5685
  const client = await this.contract.contractClient({
5675
5686
  signer
@@ -5708,7 +5719,7 @@ var MACI = class {
5708
5719
  }
5709
5720
  ];
5710
5721
  try {
5711
- const result = await client.signAndBroadcast(address, msgs, "auto");
5722
+ const result = await client.signAndBroadcast(address, msgs, fee);
5712
5723
  return result;
5713
5724
  } catch (err) {
5714
5725
  throw err;
@@ -6018,7 +6029,8 @@ var MaciClient2 = class {
6018
6029
  contractAddress,
6019
6030
  maciKeypair,
6020
6031
  oracleCertificate,
6021
- gasStation = false
6032
+ gasStation = false,
6033
+ fee
6022
6034
  }) {
6023
6035
  return await this.maci.signup({
6024
6036
  signer: this.getSigner(signer),
@@ -6026,7 +6038,8 @@ var MaciClient2 = class {
6026
6038
  contractAddress,
6027
6039
  maciKeypair,
6028
6040
  oracleCertificate,
6029
- gasStation
6041
+ gasStation,
6042
+ fee
6030
6043
  });
6031
6044
  }
6032
6045
  async vote({
@@ -6052,12 +6065,13 @@ var MaciClient2 = class {
6052
6065
  }
6053
6066
  async claimAMaciRound({
6054
6067
  signer,
6055
- contractAddress
6068
+ contractAddress,
6069
+ fee = "auto"
6056
6070
  }) {
6057
- signer = this.getSigner(signer);
6058
6071
  return await this.maci.claimAMaciRound({
6059
- signer,
6060
- contractAddress
6072
+ signer: this.getSigner(signer),
6073
+ contractAddress,
6074
+ fee
6061
6075
  });
6062
6076
  }
6063
6077
  async getOracleCertificateConfig() {
@@ -6067,7 +6081,8 @@ var MaciClient2 = class {
6067
6081
  signer,
6068
6082
  contractAddress,
6069
6083
  address,
6070
- amount
6084
+ amount,
6085
+ fee = "auto"
6071
6086
  }) {
6072
6087
  if (!address) {
6073
6088
  address = await this.getAddress(signer);
@@ -6076,13 +6091,15 @@ var MaciClient2 = class {
6076
6091
  signer: this.getSigner(signer),
6077
6092
  contractAddress,
6078
6093
  address,
6079
- amount
6094
+ amount,
6095
+ fee
6080
6096
  });
6081
6097
  }
6082
6098
  async batchRevokeWithdraw({
6083
6099
  signer,
6084
6100
  contractAddress,
6085
- address
6101
+ address,
6102
+ fee = "auto"
6086
6103
  }) {
6087
6104
  if (!address) {
6088
6105
  address = await this.getAddress(signer);
@@ -6090,7 +6107,8 @@ var MaciClient2 = class {
6090
6107
  return await this.maci.batchRevokeWithdraw({
6091
6108
  signer: this.getSigner(signer),
6092
6109
  contractAddress,
6093
- address
6110
+ address,
6111
+ fee
6094
6112
  });
6095
6113
  }
6096
6114
  };