@dorafactory/maci-sdk 0.1.3-pre.5 → 0.1.3-pre.6
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 +18 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -6
- package/dist/index.mjs.map +1 -1
- package/dist/libs/maci/maci.d.ts +10 -5
- package/dist/maci.d.ts +4 -2
- package/package.json +1 -1
- package/src/libs/maci/maci.ts +19 -6
- package/src/maci.ts +6 -0
package/dist/index.js
CHANGED
|
@@ -7356,6 +7356,7 @@ var MACI = class {
|
|
|
7356
7356
|
pubKey,
|
|
7357
7357
|
oracleCertificate,
|
|
7358
7358
|
gasStation = false,
|
|
7359
|
+
granter,
|
|
7359
7360
|
fee
|
|
7360
7361
|
}) {
|
|
7361
7362
|
try {
|
|
@@ -7373,6 +7374,7 @@ var MACI = class {
|
|
|
7373
7374
|
contractAddress,
|
|
7374
7375
|
oracleCertificate,
|
|
7375
7376
|
gasStation,
|
|
7377
|
+
granter,
|
|
7376
7378
|
fee
|
|
7377
7379
|
});
|
|
7378
7380
|
} else {
|
|
@@ -7382,6 +7384,7 @@ var MACI = class {
|
|
|
7382
7384
|
pubKey,
|
|
7383
7385
|
contractAddress,
|
|
7384
7386
|
gasStation,
|
|
7387
|
+
granter,
|
|
7385
7388
|
fee
|
|
7386
7389
|
});
|
|
7387
7390
|
}
|
|
@@ -7514,6 +7517,7 @@ var MACI = class {
|
|
|
7514
7517
|
pubKey,
|
|
7515
7518
|
payload,
|
|
7516
7519
|
gasStation = false,
|
|
7520
|
+
granter,
|
|
7517
7521
|
fee = 1.8
|
|
7518
7522
|
}) {
|
|
7519
7523
|
const stateIdx = await this.getStateIdxByPubKey({
|
|
@@ -7579,6 +7583,7 @@ var MACI = class {
|
|
|
7579
7583
|
payload,
|
|
7580
7584
|
contractAddress,
|
|
7581
7585
|
gasStation,
|
|
7586
|
+
granter,
|
|
7582
7587
|
fee
|
|
7583
7588
|
});
|
|
7584
7589
|
} catch (error) {
|
|
@@ -7591,6 +7596,7 @@ var MACI = class {
|
|
|
7591
7596
|
payload,
|
|
7592
7597
|
contractAddress,
|
|
7593
7598
|
gasStation,
|
|
7599
|
+
granter,
|
|
7594
7600
|
fee = 1.8
|
|
7595
7601
|
}) {
|
|
7596
7602
|
const msgs = payload.map(
|
|
@@ -7628,13 +7634,13 @@ var MACI = class {
|
|
|
7628
7634
|
const grantFee = {
|
|
7629
7635
|
amount: calculatedFee.amount,
|
|
7630
7636
|
gas: calculatedFee.gas,
|
|
7631
|
-
granter: contractAddress
|
|
7637
|
+
granter: granter || contractAddress
|
|
7632
7638
|
};
|
|
7633
7639
|
return client.signAndBroadcast(address, msgs, grantFee);
|
|
7634
7640
|
} else if (gasStation && typeof fee === "object") {
|
|
7635
7641
|
const grantFee = {
|
|
7636
7642
|
...fee,
|
|
7637
|
-
granter: contractAddress
|
|
7643
|
+
granter: granter || contractAddress
|
|
7638
7644
|
};
|
|
7639
7645
|
return client.signAndBroadcast(address, msgs, grantFee);
|
|
7640
7646
|
}
|
|
@@ -7646,6 +7652,7 @@ var MACI = class {
|
|
|
7646
7652
|
pubKey,
|
|
7647
7653
|
contractAddress,
|
|
7648
7654
|
gasStation,
|
|
7655
|
+
granter,
|
|
7649
7656
|
fee = 1.8
|
|
7650
7657
|
}) {
|
|
7651
7658
|
const msg = {
|
|
@@ -7680,13 +7687,13 @@ var MACI = class {
|
|
|
7680
7687
|
const grantFee = {
|
|
7681
7688
|
amount: calculatedFee.amount,
|
|
7682
7689
|
gas: calculatedFee.gas,
|
|
7683
|
-
granter: contractAddress
|
|
7690
|
+
granter: granter || contractAddress
|
|
7684
7691
|
};
|
|
7685
7692
|
return client.execute(address, contractAddress, msg, grantFee);
|
|
7686
7693
|
} else if (gasStation === true && typeof fee === "object") {
|
|
7687
7694
|
const grantFee = {
|
|
7688
7695
|
...fee,
|
|
7689
|
-
granter: contractAddress
|
|
7696
|
+
granter: granter || contractAddress
|
|
7690
7697
|
};
|
|
7691
7698
|
return client.execute(address, contractAddress, msg, grantFee);
|
|
7692
7699
|
}
|
|
@@ -7699,6 +7706,7 @@ var MACI = class {
|
|
|
7699
7706
|
contractAddress,
|
|
7700
7707
|
oracleCertificate,
|
|
7701
7708
|
gasStation,
|
|
7709
|
+
granter,
|
|
7702
7710
|
fee = 1.8
|
|
7703
7711
|
}) {
|
|
7704
7712
|
const msg = {
|
|
@@ -7735,13 +7743,13 @@ var MACI = class {
|
|
|
7735
7743
|
const grantFee = {
|
|
7736
7744
|
amount: calculatedFee.amount,
|
|
7737
7745
|
gas: calculatedFee.gas,
|
|
7738
|
-
granter: contractAddress
|
|
7746
|
+
granter: granter || contractAddress
|
|
7739
7747
|
};
|
|
7740
7748
|
return client.execute(address, contractAddress, msg, grantFee);
|
|
7741
7749
|
} else if (gasStation === true && typeof fee === "object") {
|
|
7742
7750
|
const grantFee = {
|
|
7743
7751
|
...fee,
|
|
7744
|
-
granter: contractAddress
|
|
7752
|
+
granter: granter || contractAddress
|
|
7745
7753
|
};
|
|
7746
7754
|
return client.execute(address, contractAddress, msg, grantFee);
|
|
7747
7755
|
}
|
|
@@ -8506,6 +8514,7 @@ var MaciClient2 = class {
|
|
|
8506
8514
|
pubKey,
|
|
8507
8515
|
oracleCertificate,
|
|
8508
8516
|
gasStation = false,
|
|
8517
|
+
granter,
|
|
8509
8518
|
fee
|
|
8510
8519
|
}) {
|
|
8511
8520
|
return await this.maci.rawSignup({
|
|
@@ -8515,6 +8524,7 @@ var MaciClient2 = class {
|
|
|
8515
8524
|
pubKey,
|
|
8516
8525
|
oracleCertificate,
|
|
8517
8526
|
gasStation,
|
|
8527
|
+
granter,
|
|
8518
8528
|
fee
|
|
8519
8529
|
});
|
|
8520
8530
|
}
|
|
@@ -8525,6 +8535,7 @@ var MaciClient2 = class {
|
|
|
8525
8535
|
pubKey,
|
|
8526
8536
|
payload,
|
|
8527
8537
|
gasStation = false,
|
|
8538
|
+
granter,
|
|
8528
8539
|
fee
|
|
8529
8540
|
}) {
|
|
8530
8541
|
return await this.maci.rawVote({
|
|
@@ -8534,6 +8545,7 @@ var MaciClient2 = class {
|
|
|
8534
8545
|
pubKey,
|
|
8535
8546
|
payload,
|
|
8536
8547
|
gasStation,
|
|
8548
|
+
granter,
|
|
8537
8549
|
fee
|
|
8538
8550
|
});
|
|
8539
8551
|
}
|