@dorafactory/maci-sdk 0.0.21 → 0.0.23
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/browser.d.mts +52 -23
- package/dist/browser.d.ts +52 -23
- package/dist/browser.js +42 -50
- package/dist/browser.js.map +1 -1
- package/dist/browser.mjs +42 -50
- package/dist/browser.mjs.map +1 -1
- package/dist/index.d.mts +52 -23
- package/dist/index.d.ts +52 -23
- package/dist/index.js +42 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/libs/contract/ts/AMaci.client.ts +40 -100
- package/src/libs/contract/ts/AMaci.types.ts +39 -21
- package/src/libs/maci/maci.ts +27 -0
package/dist/index.mjs
CHANGED
|
@@ -2483,6 +2483,13 @@ var AMaciQueryClient = class {
|
|
|
2483
2483
|
white_list: {}
|
|
2484
2484
|
});
|
|
2485
2485
|
};
|
|
2486
|
+
this.canSignUp = async ({ sender }) => {
|
|
2487
|
+
return this.client.queryContractSmart(this.contractAddress, {
|
|
2488
|
+
can_sign_up: {
|
|
2489
|
+
sender
|
|
2490
|
+
}
|
|
2491
|
+
});
|
|
2492
|
+
};
|
|
2486
2493
|
this.isWhiteList = async ({ sender }) => {
|
|
2487
2494
|
return this.client.queryContractSmart(this.contractAddress, {
|
|
2488
2495
|
is_white_list: {
|
|
@@ -2490,6 +2497,13 @@ var AMaciQueryClient = class {
|
|
|
2490
2497
|
}
|
|
2491
2498
|
});
|
|
2492
2499
|
};
|
|
2500
|
+
this.isRegister = async ({ sender }) => {
|
|
2501
|
+
return this.client.queryContractSmart(this.contractAddress, {
|
|
2502
|
+
is_register: {
|
|
2503
|
+
sender
|
|
2504
|
+
}
|
|
2505
|
+
});
|
|
2506
|
+
};
|
|
2493
2507
|
this.signuped = async ({ pubkeyX }) => {
|
|
2494
2508
|
return this.client.queryContractSmart(this.contractAddress, {
|
|
2495
2509
|
signuped: {
|
|
@@ -2527,6 +2541,11 @@ var AMaciQueryClient = class {
|
|
|
2527
2541
|
query_pre_deactivate_root: {}
|
|
2528
2542
|
});
|
|
2529
2543
|
};
|
|
2544
|
+
this.getDelayRecords = async () => {
|
|
2545
|
+
return this.client.queryContractSmart(this.contractAddress, {
|
|
2546
|
+
get_delay_records: {}
|
|
2547
|
+
});
|
|
2548
|
+
};
|
|
2530
2549
|
this.client = client;
|
|
2531
2550
|
this.contractAddress = contractAddress;
|
|
2532
2551
|
this.admin = this.admin.bind(this);
|
|
@@ -2546,7 +2565,9 @@ var AMaciQueryClient = class {
|
|
|
2546
2565
|
this.getVoiceCreditBalance = this.getVoiceCreditBalance.bind(this);
|
|
2547
2566
|
this.getVoiceCreditAmount = this.getVoiceCreditAmount.bind(this);
|
|
2548
2567
|
this.whiteList = this.whiteList.bind(this);
|
|
2568
|
+
this.canSignUp = this.canSignUp.bind(this);
|
|
2549
2569
|
this.isWhiteList = this.isWhiteList.bind(this);
|
|
2570
|
+
this.isRegister = this.isRegister.bind(this);
|
|
2550
2571
|
this.signuped = this.signuped.bind(this);
|
|
2551
2572
|
this.voteOptionMap = this.voteOptionMap.bind(this);
|
|
2552
2573
|
this.maxVoteOptions = this.maxVoteOptions.bind(this);
|
|
@@ -2554,6 +2575,7 @@ var AMaciQueryClient = class {
|
|
|
2554
2575
|
this.queryCircuitType = this.queryCircuitType.bind(this);
|
|
2555
2576
|
this.queryCertSystem = this.queryCertSystem.bind(this);
|
|
2556
2577
|
this.queryPreDeactivateRoot = this.queryPreDeactivateRoot.bind(this);
|
|
2578
|
+
this.getDelayRecords = this.getDelayRecords.bind(this);
|
|
2557
2579
|
}
|
|
2558
2580
|
};
|
|
2559
2581
|
var AMaciClient = class extends AMaciQueryClient {
|
|
@@ -2803,56 +2825,12 @@ var AMaciClient = class extends AMaciQueryClient {
|
|
|
2803
2825
|
_funds
|
|
2804
2826
|
);
|
|
2805
2827
|
};
|
|
2806
|
-
this.
|
|
2807
|
-
maxAmount
|
|
2808
|
-
}, fee = "auto", memo, _funds) => {
|
|
2809
|
-
return await this.client.execute(
|
|
2810
|
-
this.sender,
|
|
2811
|
-
this.contractAddress,
|
|
2812
|
-
{
|
|
2813
|
-
grant: {
|
|
2814
|
-
max_amount: maxAmount
|
|
2815
|
-
}
|
|
2816
|
-
},
|
|
2817
|
-
fee,
|
|
2818
|
-
memo,
|
|
2819
|
-
_funds
|
|
2820
|
-
);
|
|
2821
|
-
};
|
|
2822
|
-
this.revoke = async (fee = "auto", memo, _funds) => {
|
|
2823
|
-
return await this.client.execute(
|
|
2824
|
-
this.sender,
|
|
2825
|
-
this.contractAddress,
|
|
2826
|
-
{
|
|
2827
|
-
revoke: {}
|
|
2828
|
-
},
|
|
2829
|
-
fee,
|
|
2830
|
-
memo,
|
|
2831
|
-
_funds
|
|
2832
|
-
);
|
|
2833
|
-
};
|
|
2834
|
-
this.bond = async (fee = "auto", memo, _funds) => {
|
|
2828
|
+
this.claim = async (fee = "auto", memo, _funds) => {
|
|
2835
2829
|
return await this.client.execute(
|
|
2836
2830
|
this.sender,
|
|
2837
2831
|
this.contractAddress,
|
|
2838
2832
|
{
|
|
2839
|
-
|
|
2840
|
-
},
|
|
2841
|
-
fee,
|
|
2842
|
-
memo,
|
|
2843
|
-
_funds
|
|
2844
|
-
);
|
|
2845
|
-
};
|
|
2846
|
-
this.withdraw = async ({
|
|
2847
|
-
amount
|
|
2848
|
-
}, fee = "auto", memo, _funds) => {
|
|
2849
|
-
return await this.client.execute(
|
|
2850
|
-
this.sender,
|
|
2851
|
-
this.contractAddress,
|
|
2852
|
-
{
|
|
2853
|
-
withdraw: {
|
|
2854
|
-
amount
|
|
2855
|
-
}
|
|
2833
|
+
claim: {}
|
|
2856
2834
|
},
|
|
2857
2835
|
fee,
|
|
2858
2836
|
memo,
|
|
@@ -2876,10 +2854,7 @@ var AMaciClient = class extends AMaciQueryClient {
|
|
|
2876
2854
|
this.stopProcessingPeriod = this.stopProcessingPeriod.bind(this);
|
|
2877
2855
|
this.processTally = this.processTally.bind(this);
|
|
2878
2856
|
this.stopTallyingPeriod = this.stopTallyingPeriod.bind(this);
|
|
2879
|
-
this.
|
|
2880
|
-
this.revoke = this.revoke.bind(this);
|
|
2881
|
-
this.bond = this.bond.bind(this);
|
|
2882
|
-
this.withdraw = this.withdraw.bind(this);
|
|
2857
|
+
this.claim = this.claim.bind(this);
|
|
2883
2858
|
}
|
|
2884
2859
|
};
|
|
2885
2860
|
|
|
@@ -4880,6 +4855,13 @@ var MACI = class {
|
|
|
4880
4855
|
};
|
|
4881
4856
|
}
|
|
4882
4857
|
}
|
|
4858
|
+
async queryAMaciChargeFee({
|
|
4859
|
+
maxVoter,
|
|
4860
|
+
maxOption
|
|
4861
|
+
}) {
|
|
4862
|
+
const fee = getAMaciRoundCircuitFee(maxVoter, maxOption);
|
|
4863
|
+
return fee;
|
|
4864
|
+
}
|
|
4883
4865
|
async queryRoundGasStation({ contractAddress }) {
|
|
4884
4866
|
const roundInfo = await this.getRoundInfo({ contractAddress });
|
|
4885
4867
|
return roundInfo.gasStationEnable;
|
|
@@ -5176,6 +5158,16 @@ var MACI = class {
|
|
|
5176
5158
|
fee
|
|
5177
5159
|
);
|
|
5178
5160
|
}
|
|
5161
|
+
async claimAMaciRound({
|
|
5162
|
+
signer,
|
|
5163
|
+
contractAddress
|
|
5164
|
+
}) {
|
|
5165
|
+
const client = await this.contract.amaciClient({
|
|
5166
|
+
signer,
|
|
5167
|
+
contractAddress
|
|
5168
|
+
});
|
|
5169
|
+
return client.claim();
|
|
5170
|
+
}
|
|
5179
5171
|
};
|
|
5180
5172
|
|
|
5181
5173
|
// src/maci.ts
|