@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 +47 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -29
- package/dist/index.mjs.map +1 -1
- package/dist/libs/contract/contract.d.ts +3 -3
- package/dist/libs/contract/types.d.ts +3 -1
- package/dist/libs/maci/maci.d.ts +13 -6
- package/dist/maci.d.ts +9 -4
- package/package.json +1 -1
- package/src/libs/contract/contract.ts +8 -3
- package/src/libs/contract/types.ts +4 -1
- package/src/libs/maci/maci.ts +19 -5
- package/src/maci.ts +14 -2
package/dist/index.mjs
CHANGED
|
@@ -4671,7 +4671,8 @@ var Contract = class {
|
|
|
4671
4671
|
maxOption,
|
|
4672
4672
|
voiceCreditAmount,
|
|
4673
4673
|
circuitType,
|
|
4674
|
-
preDeactivateRoot
|
|
4674
|
+
preDeactivateRoot,
|
|
4675
|
+
fee = "auto"
|
|
4675
4676
|
}) {
|
|
4676
4677
|
const start_time = (startVoting.getTime() * 10 ** 6).toString();
|
|
4677
4678
|
const end_time = (endVoting.getTime() * 10 ** 6).toString();
|
|
@@ -4702,7 +4703,7 @@ var Contract = class {
|
|
|
4702
4703
|
certificationSystem: "0",
|
|
4703
4704
|
circuitType
|
|
4704
4705
|
},
|
|
4705
|
-
|
|
4706
|
+
fee,
|
|
4706
4707
|
void 0,
|
|
4707
4708
|
[requiredFee]
|
|
4708
4709
|
);
|
|
@@ -4734,7 +4735,8 @@ var Contract = class {
|
|
|
4734
4735
|
maxVoter,
|
|
4735
4736
|
maxOption,
|
|
4736
4737
|
circuitType,
|
|
4737
|
-
certSystemType
|
|
4738
|
+
certSystemType,
|
|
4739
|
+
fee = "auto"
|
|
4738
4740
|
}) {
|
|
4739
4741
|
const start_time = (startVoting.getTime() * 10 ** 6).toString();
|
|
4740
4742
|
const end_time = (endVoting.getTime() * 10 ** 6).toString();
|
|
@@ -4783,7 +4785,7 @@ var Contract = class {
|
|
|
4783
4785
|
qtr_lib: QTR_LIB
|
|
4784
4786
|
},
|
|
4785
4787
|
`[MACI] ${title}`,
|
|
4786
|
-
|
|
4788
|
+
fee
|
|
4787
4789
|
);
|
|
4788
4790
|
return instantiateResponse;
|
|
4789
4791
|
}
|
|
@@ -4799,7 +4801,8 @@ var Contract = class {
|
|
|
4799
4801
|
circuitType,
|
|
4800
4802
|
whitelistEcosystem,
|
|
4801
4803
|
whitelistSnapshotHeight,
|
|
4802
|
-
whitelistVotingPowerArgs
|
|
4804
|
+
whitelistVotingPowerArgs,
|
|
4805
|
+
fee = "auto"
|
|
4803
4806
|
}) {
|
|
4804
4807
|
const start_time = (startVoting.getTime() * 1e6).toString();
|
|
4805
4808
|
const end_time = (endVoting.getTime() * 1e6).toString();
|
|
@@ -4838,7 +4841,7 @@ var Contract = class {
|
|
|
4838
4841
|
feegrant_operator: this.feegrantOperator
|
|
4839
4842
|
},
|
|
4840
4843
|
`[Oracle MACI] ${title}`,
|
|
4841
|
-
|
|
4844
|
+
fee
|
|
4842
4845
|
);
|
|
4843
4846
|
return instantiateResponse;
|
|
4844
4847
|
}
|
|
@@ -5257,7 +5260,8 @@ var MACI = class {
|
|
|
5257
5260
|
contractAddress,
|
|
5258
5261
|
maciKeypair,
|
|
5259
5262
|
oracleCertificate,
|
|
5260
|
-
gasStation = false
|
|
5263
|
+
gasStation = false,
|
|
5264
|
+
fee
|
|
5261
5265
|
}) {
|
|
5262
5266
|
try {
|
|
5263
5267
|
if (!address) {
|
|
@@ -5276,7 +5280,8 @@ var MACI = class {
|
|
|
5276
5280
|
pubKey: maciKeypair.pubKey,
|
|
5277
5281
|
contractAddress,
|
|
5278
5282
|
oracleCertificate,
|
|
5279
|
-
gasStation
|
|
5283
|
+
gasStation,
|
|
5284
|
+
fee
|
|
5280
5285
|
});
|
|
5281
5286
|
} else {
|
|
5282
5287
|
return await this.signupSimple({
|
|
@@ -5284,7 +5289,8 @@ var MACI = class {
|
|
|
5284
5289
|
address,
|
|
5285
5290
|
pubKey: maciKeypair.pubKey,
|
|
5286
5291
|
contractAddress,
|
|
5287
|
-
gasStation
|
|
5292
|
+
gasStation,
|
|
5293
|
+
fee
|
|
5288
5294
|
});
|
|
5289
5295
|
}
|
|
5290
5296
|
} catch (error) {
|
|
@@ -5414,10 +5420,11 @@ var MACI = class {
|
|
|
5414
5420
|
address,
|
|
5415
5421
|
pubKey,
|
|
5416
5422
|
contractAddress,
|
|
5417
|
-
gasStation
|
|
5423
|
+
gasStation,
|
|
5424
|
+
fee
|
|
5418
5425
|
}) {
|
|
5419
5426
|
const gasPrice = GasPrice2.fromString("100000000000peaka");
|
|
5420
|
-
|
|
5427
|
+
fee = fee || calculateFee(6e7, gasPrice);
|
|
5421
5428
|
if (gasStation === true) {
|
|
5422
5429
|
const grantFee = {
|
|
5423
5430
|
amount: fee.amount,
|
|
@@ -5458,10 +5465,11 @@ var MACI = class {
|
|
|
5458
5465
|
pubKey,
|
|
5459
5466
|
contractAddress,
|
|
5460
5467
|
oracleCertificate,
|
|
5461
|
-
gasStation
|
|
5468
|
+
gasStation,
|
|
5469
|
+
fee
|
|
5462
5470
|
}) {
|
|
5463
5471
|
const gasPrice = GasPrice2.fromString("100000000000peaka");
|
|
5464
|
-
|
|
5472
|
+
fee = fee || calculateFee(6e7, gasPrice);
|
|
5465
5473
|
if (gasStation === true) {
|
|
5466
5474
|
const grantFee = {
|
|
5467
5475
|
amount: fee.amount,
|
|
@@ -5502,13 +5510,14 @@ var MACI = class {
|
|
|
5502
5510
|
}
|
|
5503
5511
|
async claimAMaciRound({
|
|
5504
5512
|
signer,
|
|
5505
|
-
contractAddress
|
|
5513
|
+
contractAddress,
|
|
5514
|
+
fee = "auto"
|
|
5506
5515
|
}) {
|
|
5507
5516
|
const client = await this.contract.amaciClient({
|
|
5508
5517
|
signer,
|
|
5509
5518
|
contractAddress
|
|
5510
5519
|
});
|
|
5511
|
-
return client.claim();
|
|
5520
|
+
return client.claim(fee);
|
|
5512
5521
|
}
|
|
5513
5522
|
async getOracleCertificateConfig() {
|
|
5514
5523
|
const ecosystems = await this.oracleCertificate.listEcosystems();
|
|
@@ -5526,7 +5535,8 @@ var MACI = class {
|
|
|
5526
5535
|
signer,
|
|
5527
5536
|
contractAddress,
|
|
5528
5537
|
address,
|
|
5529
|
-
amount
|
|
5538
|
+
amount,
|
|
5539
|
+
fee = "auto"
|
|
5530
5540
|
}) {
|
|
5531
5541
|
const client = await this.contract.contractClient({
|
|
5532
5542
|
signer
|
|
@@ -5573,7 +5583,7 @@ var MACI = class {
|
|
|
5573
5583
|
}
|
|
5574
5584
|
];
|
|
5575
5585
|
try {
|
|
5576
|
-
const result = await client.signAndBroadcast(address, msgs,
|
|
5586
|
+
const result = await client.signAndBroadcast(address, msgs, fee);
|
|
5577
5587
|
return result;
|
|
5578
5588
|
} catch (err) {
|
|
5579
5589
|
throw err;
|
|
@@ -5589,7 +5599,8 @@ var MACI = class {
|
|
|
5589
5599
|
async batchRevokeWithdraw({
|
|
5590
5600
|
signer,
|
|
5591
5601
|
contractAddress,
|
|
5592
|
-
address
|
|
5602
|
+
address,
|
|
5603
|
+
fee = "auto"
|
|
5593
5604
|
}) {
|
|
5594
5605
|
const client = await this.contract.contractClient({
|
|
5595
5606
|
signer
|
|
@@ -5628,7 +5639,7 @@ var MACI = class {
|
|
|
5628
5639
|
}
|
|
5629
5640
|
];
|
|
5630
5641
|
try {
|
|
5631
|
-
const result = await client.signAndBroadcast(address, msgs,
|
|
5642
|
+
const result = await client.signAndBroadcast(address, msgs, fee);
|
|
5632
5643
|
return result;
|
|
5633
5644
|
} catch (err) {
|
|
5634
5645
|
throw err;
|
|
@@ -5938,7 +5949,8 @@ var MaciClient2 = class {
|
|
|
5938
5949
|
contractAddress,
|
|
5939
5950
|
maciKeypair,
|
|
5940
5951
|
oracleCertificate,
|
|
5941
|
-
gasStation = false
|
|
5952
|
+
gasStation = false,
|
|
5953
|
+
fee
|
|
5942
5954
|
}) {
|
|
5943
5955
|
return await this.maci.signup({
|
|
5944
5956
|
signer: this.getSigner(signer),
|
|
@@ -5946,7 +5958,8 @@ var MaciClient2 = class {
|
|
|
5946
5958
|
contractAddress,
|
|
5947
5959
|
maciKeypair,
|
|
5948
5960
|
oracleCertificate,
|
|
5949
|
-
gasStation
|
|
5961
|
+
gasStation,
|
|
5962
|
+
fee
|
|
5950
5963
|
});
|
|
5951
5964
|
}
|
|
5952
5965
|
async vote({
|
|
@@ -5972,12 +5985,13 @@ var MaciClient2 = class {
|
|
|
5972
5985
|
}
|
|
5973
5986
|
async claimAMaciRound({
|
|
5974
5987
|
signer,
|
|
5975
|
-
contractAddress
|
|
5988
|
+
contractAddress,
|
|
5989
|
+
fee = "auto"
|
|
5976
5990
|
}) {
|
|
5977
|
-
signer = this.getSigner(signer);
|
|
5978
5991
|
return await this.maci.claimAMaciRound({
|
|
5979
|
-
signer,
|
|
5980
|
-
contractAddress
|
|
5992
|
+
signer: this.getSigner(signer),
|
|
5993
|
+
contractAddress,
|
|
5994
|
+
fee
|
|
5981
5995
|
});
|
|
5982
5996
|
}
|
|
5983
5997
|
async getOracleCertificateConfig() {
|
|
@@ -5987,7 +6001,8 @@ var MaciClient2 = class {
|
|
|
5987
6001
|
signer,
|
|
5988
6002
|
contractAddress,
|
|
5989
6003
|
address,
|
|
5990
|
-
amount
|
|
6004
|
+
amount,
|
|
6005
|
+
fee = "auto"
|
|
5991
6006
|
}) {
|
|
5992
6007
|
if (!address) {
|
|
5993
6008
|
address = await this.getAddress(signer);
|
|
@@ -5996,13 +6011,15 @@ var MaciClient2 = class {
|
|
|
5996
6011
|
signer: this.getSigner(signer),
|
|
5997
6012
|
contractAddress,
|
|
5998
6013
|
address,
|
|
5999
|
-
amount
|
|
6014
|
+
amount,
|
|
6015
|
+
fee
|
|
6000
6016
|
});
|
|
6001
6017
|
}
|
|
6002
6018
|
async batchRevokeWithdraw({
|
|
6003
6019
|
signer,
|
|
6004
6020
|
contractAddress,
|
|
6005
|
-
address
|
|
6021
|
+
address,
|
|
6022
|
+
fee = "auto"
|
|
6006
6023
|
}) {
|
|
6007
6024
|
if (!address) {
|
|
6008
6025
|
address = await this.getAddress(signer);
|
|
@@ -6010,7 +6027,8 @@ var MaciClient2 = class {
|
|
|
6010
6027
|
return await this.maci.batchRevokeWithdraw({
|
|
6011
6028
|
signer: this.getSigner(signer),
|
|
6012
6029
|
contractAddress,
|
|
6013
|
-
address
|
|
6030
|
+
address,
|
|
6031
|
+
fee
|
|
6014
6032
|
});
|
|
6015
6033
|
}
|
|
6016
6034
|
};
|