@dorafactory/maci-sdk 0.0.16 → 0.0.18
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/README.md +2 -0
- package/dist/browser.d.mts +4 -2
- package/dist/browser.d.ts +4 -2
- package/dist/browser.js +11 -3
- package/dist/browser.js.map +1 -1
- package/dist/browser.mjs +11 -3
- package/dist/browser.mjs.map +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/libs/const.ts +2 -1
- package/src/libs/maci/maci.ts +17 -3
package/README.md
CHANGED
|
@@ -178,6 +178,7 @@ const signupResponse = await client.maci.signup({
|
|
|
178
178
|
signer: wallet,
|
|
179
179
|
address,
|
|
180
180
|
contractAddress: 'dora1...',
|
|
181
|
+
maciAccount,
|
|
181
182
|
oracleCertificate: {
|
|
182
183
|
amount: certificate.amount,
|
|
183
184
|
signature: certificate.signature,
|
|
@@ -206,6 +207,7 @@ const voteResponse = await client.maci.vote({
|
|
|
206
207
|
BigInt(roundInfo.coordinatorPubkeyX),
|
|
207
208
|
BigInt(roundInfo.coordinatorPubkeyY),
|
|
208
209
|
],
|
|
210
|
+
maciAccount,
|
|
209
211
|
gasStation: true,
|
|
210
212
|
});
|
|
211
213
|
```
|
package/dist/browser.d.mts
CHANGED
|
@@ -1666,10 +1666,11 @@ declare class MACI {
|
|
|
1666
1666
|
address: string;
|
|
1667
1667
|
contractAddress: string;
|
|
1668
1668
|
}): Promise<SignatureResponse>;
|
|
1669
|
-
signup({ signer, address, contractAddress, oracleCertificate, gasStation, }: {
|
|
1669
|
+
signup({ signer, address, contractAddress, maciAccount, oracleCertificate, gasStation, }: {
|
|
1670
1670
|
signer: OfflineSigner;
|
|
1671
1671
|
address: string;
|
|
1672
1672
|
contractAddress: string;
|
|
1673
|
+
maciAccount?: Account;
|
|
1673
1674
|
oracleCertificate?: {
|
|
1674
1675
|
amount: string;
|
|
1675
1676
|
signature: string;
|
|
@@ -1677,7 +1678,7 @@ declare class MACI {
|
|
|
1677
1678
|
gasStation?: boolean;
|
|
1678
1679
|
}): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
|
|
1679
1680
|
private processVoteOptions;
|
|
1680
|
-
vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, gasStation, }: {
|
|
1681
|
+
vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciAccount, gasStation, }: {
|
|
1681
1682
|
signer: OfflineSigner;
|
|
1682
1683
|
address: string;
|
|
1683
1684
|
stateIdx: number;
|
|
@@ -1687,6 +1688,7 @@ declare class MACI {
|
|
|
1687
1688
|
vc: number;
|
|
1688
1689
|
}[];
|
|
1689
1690
|
operatorCoordPubKey: PublicKey;
|
|
1691
|
+
maciAccount?: Account;
|
|
1690
1692
|
gasStation?: boolean;
|
|
1691
1693
|
}): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
|
|
1692
1694
|
publishMessage({ client, address, payload, contractAddress, gasStation, }: {
|
package/dist/browser.d.ts
CHANGED
|
@@ -1666,10 +1666,11 @@ declare class MACI {
|
|
|
1666
1666
|
address: string;
|
|
1667
1667
|
contractAddress: string;
|
|
1668
1668
|
}): Promise<SignatureResponse>;
|
|
1669
|
-
signup({ signer, address, contractAddress, oracleCertificate, gasStation, }: {
|
|
1669
|
+
signup({ signer, address, contractAddress, maciAccount, oracleCertificate, gasStation, }: {
|
|
1670
1670
|
signer: OfflineSigner;
|
|
1671
1671
|
address: string;
|
|
1672
1672
|
contractAddress: string;
|
|
1673
|
+
maciAccount?: Account;
|
|
1673
1674
|
oracleCertificate?: {
|
|
1674
1675
|
amount: string;
|
|
1675
1676
|
signature: string;
|
|
@@ -1677,7 +1678,7 @@ declare class MACI {
|
|
|
1677
1678
|
gasStation?: boolean;
|
|
1678
1679
|
}): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
|
|
1679
1680
|
private processVoteOptions;
|
|
1680
|
-
vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, gasStation, }: {
|
|
1681
|
+
vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciAccount, gasStation, }: {
|
|
1681
1682
|
signer: OfflineSigner;
|
|
1682
1683
|
address: string;
|
|
1683
1684
|
stateIdx: number;
|
|
@@ -1687,6 +1688,7 @@ declare class MACI {
|
|
|
1687
1688
|
vc: number;
|
|
1688
1689
|
}[];
|
|
1689
1690
|
operatorCoordPubKey: PublicKey;
|
|
1691
|
+
maciAccount?: Account;
|
|
1690
1692
|
gasStation?: boolean;
|
|
1691
1693
|
}): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
|
|
1692
1694
|
publishMessage({ client, address, payload, contractAddress, gasStation, }: {
|
package/dist/browser.js
CHANGED
|
@@ -26230,7 +26230,9 @@ function getDefaultParams(network = "mainnet") {
|
|
|
26230
26230
|
certificateApiEndpoint: "https://vota-testnet-certificate-api.dorafactory.org/api/v1",
|
|
26231
26231
|
registryAddress: "dora13c8aecstyxrhax9znvvh5zey89edrmd2k5va57pxvpe3fxtfsfeqlhsjnd",
|
|
26232
26232
|
maciCodeId: 107,
|
|
26233
|
-
oracleCodeId: 113,
|
|
26233
|
+
// oracleCodeId: 113, // 9-4-3-625
|
|
26234
|
+
oracleCodeId: 115,
|
|
26235
|
+
// 6-3-3-125
|
|
26234
26236
|
oracleWhitelistBackendPubkey: "AoYo/zENN/JquagPdG0/NMbWBBYxOM8BVN677mBXJKJQ",
|
|
26235
26237
|
oracleFeegrantOperator: "dora1xp0twdzsdeq4qg3c64v66552deax8zmvq4zw78"
|
|
26236
26238
|
};
|
|
@@ -30380,11 +30382,14 @@ var MACI = class {
|
|
|
30380
30382
|
signer,
|
|
30381
30383
|
address,
|
|
30382
30384
|
contractAddress,
|
|
30385
|
+
maciAccount,
|
|
30383
30386
|
oracleCertificate,
|
|
30384
30387
|
gasStation = false
|
|
30385
30388
|
}) {
|
|
30386
30389
|
try {
|
|
30387
|
-
|
|
30390
|
+
if (maciAccount === void 0) {
|
|
30391
|
+
maciAccount = await this.circom.genKeypairFromSign(signer, address);
|
|
30392
|
+
}
|
|
30388
30393
|
const client = await this.contract.contractClient({
|
|
30389
30394
|
signer
|
|
30390
30395
|
});
|
|
@@ -30439,6 +30444,7 @@ var MACI = class {
|
|
|
30439
30444
|
contractAddress,
|
|
30440
30445
|
selectedOptions,
|
|
30441
30446
|
operatorCoordPubKey,
|
|
30447
|
+
maciAccount,
|
|
30442
30448
|
gasStation = false
|
|
30443
30449
|
}) {
|
|
30444
30450
|
if (stateIdx === -1) {
|
|
@@ -30455,7 +30461,9 @@ var MACI = class {
|
|
|
30455
30461
|
contractAddress,
|
|
30456
30462
|
voiceCreditBalance
|
|
30457
30463
|
});
|
|
30458
|
-
|
|
30464
|
+
if (maciAccount === void 0) {
|
|
30465
|
+
maciAccount = await this.circom.genKeypairFromSign(signer, address);
|
|
30466
|
+
}
|
|
30459
30467
|
const plan = options.map((o) => {
|
|
30460
30468
|
return [o.idx, o.vc];
|
|
30461
30469
|
});
|