@dorafactory/maci-sdk 0.0.9 → 0.0.10
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 +7 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -22
- package/dist/index.mjs.map +1 -1
- package/dist/libs/contract/contract.d.ts +1 -1
- package/dist/libs/contract/types.d.ts +5 -2
- package/dist/libs/contract/utils.d.ts +1 -0
- package/package.json +1 -1
- package/src/libs/const.ts +2 -2
- package/src/libs/contract/contract.ts +6 -21
- package/src/libs/contract/types.ts +5 -2
- package/src/libs/contract/utils.ts +17 -0
package/dist/index.js
CHANGED
|
@@ -478,7 +478,7 @@ function getDefaultParams(network = "mainnet") {
|
|
|
478
478
|
certificateApiEndpoint: "https://vota-certificate-api.dorafactory.org/api/v1",
|
|
479
479
|
registryAddress: "dora1smg5qp5trjdkcekdjssqpjehdjf6n4cjss0clyvqcud3t3u3948s8rmgg4",
|
|
480
480
|
maciCodeId: 106,
|
|
481
|
-
oracleCodeId:
|
|
481
|
+
oracleCodeId: 116,
|
|
482
482
|
oracleWhitelistBackendPubkey: "A61YtCv2ibMZmDeM02nEElil8wlHx1tLKogBk5dPgf/Q",
|
|
483
483
|
oracleFeegrantOperator: "dora16s9tljk8dy9ae335yvyzlm8gvkypx9228q8pq8"
|
|
484
484
|
};
|
|
@@ -492,7 +492,7 @@ function getDefaultParams(network = "mainnet") {
|
|
|
492
492
|
certificateApiEndpoint: "https://vota-testnet-certificate-api.dorafactory.org/api/v1",
|
|
493
493
|
registryAddress: "dora13c8aecstyxrhax9znvvh5zey89edrmd2k5va57pxvpe3fxtfsfeqlhsjnd",
|
|
494
494
|
maciCodeId: 107,
|
|
495
|
-
oracleCodeId:
|
|
495
|
+
oracleCodeId: 113,
|
|
496
496
|
oracleWhitelistBackendPubkey: "AoYo/zENN/JquagPdG0/NMbWBBYxOM8BVN677mBXJKJQ",
|
|
497
497
|
oracleFeegrantOperator: "dora1xp0twdzsdeq4qg3c64v66552deax8zmvq4zw78"
|
|
498
498
|
};
|
|
@@ -4004,8 +4004,7 @@ var Contract = class {
|
|
|
4004
4004
|
title,
|
|
4005
4005
|
description,
|
|
4006
4006
|
link,
|
|
4007
|
-
|
|
4008
|
-
maxOption,
|
|
4007
|
+
voteOptionMap,
|
|
4009
4008
|
circuitType,
|
|
4010
4009
|
whitelistEcosystem,
|
|
4011
4010
|
whitelistSnapshotHeight,
|
|
@@ -4016,20 +4015,12 @@ var Contract = class {
|
|
|
4016
4015
|
const [{ address }] = await signer.getAccounts();
|
|
4017
4016
|
const client = await createContractClientByWallet(this.rpcEndpoint, signer);
|
|
4018
4017
|
const { x: operatorPubkeyX, y: operatorPubkeyY } = decompressPublicKey(operatorPubkey);
|
|
4019
|
-
const {
|
|
4020
|
-
parameters,
|
|
4021
|
-
groth16ProcessVkey,
|
|
4022
|
-
groth16TallyVkey,
|
|
4023
|
-
plonkProcessVkey,
|
|
4024
|
-
plonkTallyVkey,
|
|
4025
|
-
maciVoteType,
|
|
4026
|
-
maciCertSystem
|
|
4027
|
-
} = getContractParams(
|
|
4018
|
+
const { maciVoteType, maciCertSystem } = getContractParams(
|
|
4028
4019
|
"2" /* ORACLE_MACI */,
|
|
4029
4020
|
circuitType,
|
|
4030
4021
|
"groth16" /* GROTH16 */,
|
|
4031
|
-
|
|
4032
|
-
|
|
4022
|
+
"0",
|
|
4023
|
+
"0"
|
|
4033
4024
|
);
|
|
4034
4025
|
const instantiateResponse = await client.instantiate(
|
|
4035
4026
|
address,
|
|
@@ -4040,23 +4031,17 @@ var Contract = class {
|
|
|
4040
4031
|
start_time,
|
|
4041
4032
|
end_time
|
|
4042
4033
|
},
|
|
4043
|
-
parameters,
|
|
4044
4034
|
coordinator: {
|
|
4045
4035
|
x: operatorPubkeyX,
|
|
4046
4036
|
y: operatorPubkeyY
|
|
4047
4037
|
},
|
|
4048
|
-
|
|
4049
|
-
groth16_tally_vkey: groth16TallyVkey,
|
|
4050
|
-
plonk_process_vkey: plonkProcessVkey,
|
|
4051
|
-
plonk_tally_vkey: plonkTallyVkey,
|
|
4052
|
-
max_vote_options: maxOption,
|
|
4038
|
+
vote_option_map: voteOptionMap,
|
|
4053
4039
|
whitelist_backend_pubkey: this.whitelistBackendPubkey,
|
|
4054
4040
|
whitelist_ecosystem: whitelistEcosystem,
|
|
4055
4041
|
whitelist_snapshot_height: whitelistSnapshotHeight,
|
|
4056
4042
|
whitelist_voting_power_args: whitelistVotingPowerArgs,
|
|
4057
4043
|
circuit_type: maciVoteType,
|
|
4058
4044
|
certification_system: maciCertSystem,
|
|
4059
|
-
qtr_lib: QTR_LIB,
|
|
4060
4045
|
feegrant_operator: this.feegrantOperator
|
|
4061
4046
|
},
|
|
4062
4047
|
`[Oracle MACI] ${title}`,
|