@dorafactory/maci-sdk 0.0.28 → 0.0.30-rc
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 +5 -3
- package/dist/browser.d.mts +4 -4
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +12 -9
- package/dist/browser.js.map +1 -1
- package/dist/browser.mjs +12 -9
- package/dist/browser.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/libs/contract/contract.ts +7 -4
- package/src/libs/contract/types.ts +2 -0
- package/src/libs/query/round.ts +1 -1
- package/src/types/index.ts +1 -1
package/README.md
CHANGED
|
@@ -161,14 +161,16 @@ const certificate = await client.maci.requestOracleCertificate({
|
|
|
161
161
|
});
|
|
162
162
|
|
|
163
163
|
// 3. Check Gas Station status
|
|
164
|
-
let
|
|
164
|
+
let hasFeegrant = await client.maci.hasFeegrant({
|
|
165
|
+
address,
|
|
165
166
|
contractAddress: 'dora1...',
|
|
166
167
|
});
|
|
167
168
|
|
|
168
169
|
// Wait for Gas Station to be enabled
|
|
169
|
-
while (!
|
|
170
|
+
while (!hasFeegrant) {
|
|
170
171
|
await delay(1000); // Delay 1 second
|
|
171
|
-
|
|
172
|
+
hasFeegrant = await client.maci.hasFeegrant({
|
|
173
|
+
address,
|
|
172
174
|
contractAddress: 'dora1...',
|
|
173
175
|
});
|
|
174
176
|
}
|
package/dist/browser.d.mts
CHANGED
|
@@ -129,6 +129,7 @@ type CreateRoundParams = {
|
|
|
129
129
|
startVoting: Date;
|
|
130
130
|
endVoting: Date;
|
|
131
131
|
circuitType: MaciCircuitType;
|
|
132
|
+
fee?: number | StdFee | 'auto';
|
|
132
133
|
};
|
|
133
134
|
type CreateAMaciRoundParams = {
|
|
134
135
|
maxVoter: number;
|
|
@@ -242,7 +243,6 @@ type RoundType = {
|
|
|
242
243
|
voiceCreditAmount: string;
|
|
243
244
|
preDeactivateRoot: string;
|
|
244
245
|
identity: string;
|
|
245
|
-
funds: string;
|
|
246
246
|
operatorLogoUrl?: string;
|
|
247
247
|
operatorMoniker?: string;
|
|
248
248
|
resultsList?: {
|
|
@@ -1619,7 +1619,7 @@ declare class Contract {
|
|
|
1619
1619
|
feegrantOperator: string;
|
|
1620
1620
|
whitelistBackendPubkey: string;
|
|
1621
1621
|
constructor({ rpcEndpoint, registryAddress, maciCodeId, oracleCodeId, feegrantOperator, whitelistBackendPubkey, }: ContractParams);
|
|
1622
|
-
createAMaciRound({ signer, startVoting, endVoting, operator, whitelist, title, description, link, maxVoter, maxOption, voiceCreditAmount, circuitType, preDeactivateRoot, }: CreateAMaciRoundParams): Promise<{
|
|
1622
|
+
createAMaciRound({ signer, startVoting, endVoting, operator, whitelist, title, description, link, maxVoter, maxOption, voiceCreditAmount, circuitType, preDeactivateRoot, fee, }: CreateAMaciRoundParams): Promise<{
|
|
1623
1623
|
contractAddress: string;
|
|
1624
1624
|
logs: readonly _cosmjs_stargate_build_logs.Log[];
|
|
1625
1625
|
height: number;
|
|
@@ -1628,8 +1628,8 @@ declare class Contract {
|
|
|
1628
1628
|
gasWanted: bigint;
|
|
1629
1629
|
gasUsed: bigint;
|
|
1630
1630
|
}>;
|
|
1631
|
-
createMaciRound({ signer, operatorPubkey, startVoting, endVoting, whitelist, title, description, link, maxVoter, maxOption, circuitType, certSystemType, }: CreateMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
1632
|
-
createOracleMaciRound({ signer, operatorPubkey, startVoting, endVoting, title, description, link, voteOptionMap, circuitType, whitelistEcosystem, whitelistSnapshotHeight, whitelistVotingPowerArgs, }: CreateOracleMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
1631
|
+
createMaciRound({ signer, operatorPubkey, startVoting, endVoting, whitelist, title, description, link, maxVoter, maxOption, circuitType, certSystemType, fee, }: CreateMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
1632
|
+
createOracleMaciRound({ signer, operatorPubkey, startVoting, endVoting, title, description, link, voteOptionMap, circuitType, whitelistEcosystem, whitelistSnapshotHeight, whitelistVotingPowerArgs, fee, }: CreateOracleMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
1633
1633
|
queryRoundInfo({ signer, roundAddress, }: {
|
|
1634
1634
|
signer: OfflineSigner;
|
|
1635
1635
|
roundAddress: string;
|
package/dist/browser.d.ts
CHANGED
|
@@ -129,6 +129,7 @@ type CreateRoundParams = {
|
|
|
129
129
|
startVoting: Date;
|
|
130
130
|
endVoting: Date;
|
|
131
131
|
circuitType: MaciCircuitType;
|
|
132
|
+
fee?: number | StdFee | 'auto';
|
|
132
133
|
};
|
|
133
134
|
type CreateAMaciRoundParams = {
|
|
134
135
|
maxVoter: number;
|
|
@@ -242,7 +243,6 @@ type RoundType = {
|
|
|
242
243
|
voiceCreditAmount: string;
|
|
243
244
|
preDeactivateRoot: string;
|
|
244
245
|
identity: string;
|
|
245
|
-
funds: string;
|
|
246
246
|
operatorLogoUrl?: string;
|
|
247
247
|
operatorMoniker?: string;
|
|
248
248
|
resultsList?: {
|
|
@@ -1619,7 +1619,7 @@ declare class Contract {
|
|
|
1619
1619
|
feegrantOperator: string;
|
|
1620
1620
|
whitelistBackendPubkey: string;
|
|
1621
1621
|
constructor({ rpcEndpoint, registryAddress, maciCodeId, oracleCodeId, feegrantOperator, whitelistBackendPubkey, }: ContractParams);
|
|
1622
|
-
createAMaciRound({ signer, startVoting, endVoting, operator, whitelist, title, description, link, maxVoter, maxOption, voiceCreditAmount, circuitType, preDeactivateRoot, }: CreateAMaciRoundParams): Promise<{
|
|
1622
|
+
createAMaciRound({ signer, startVoting, endVoting, operator, whitelist, title, description, link, maxVoter, maxOption, voiceCreditAmount, circuitType, preDeactivateRoot, fee, }: CreateAMaciRoundParams): Promise<{
|
|
1623
1623
|
contractAddress: string;
|
|
1624
1624
|
logs: readonly _cosmjs_stargate_build_logs.Log[];
|
|
1625
1625
|
height: number;
|
|
@@ -1628,8 +1628,8 @@ declare class Contract {
|
|
|
1628
1628
|
gasWanted: bigint;
|
|
1629
1629
|
gasUsed: bigint;
|
|
1630
1630
|
}>;
|
|
1631
|
-
createMaciRound({ signer, operatorPubkey, startVoting, endVoting, whitelist, title, description, link, maxVoter, maxOption, circuitType, certSystemType, }: CreateMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
1632
|
-
createOracleMaciRound({ signer, operatorPubkey, startVoting, endVoting, title, description, link, voteOptionMap, circuitType, whitelistEcosystem, whitelistSnapshotHeight, whitelistVotingPowerArgs, }: CreateOracleMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
1631
|
+
createMaciRound({ signer, operatorPubkey, startVoting, endVoting, whitelist, title, description, link, maxVoter, maxOption, circuitType, certSystemType, fee, }: CreateMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
1632
|
+
createOracleMaciRound({ signer, operatorPubkey, startVoting, endVoting, title, description, link, voteOptionMap, circuitType, whitelistEcosystem, whitelistSnapshotHeight, whitelistVotingPowerArgs, fee, }: CreateOracleMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
1633
1633
|
queryRoundInfo({ signer, roundAddress, }: {
|
|
1634
1634
|
signer: OfflineSigner;
|
|
1635
1635
|
roundAddress: string;
|
package/dist/browser.js
CHANGED
|
@@ -27009,8 +27009,8 @@ var Round = class {
|
|
|
27009
27009
|
"maciType",
|
|
27010
27010
|
"voiceCreditAmount",
|
|
27011
27011
|
"preDeactivateRoot",
|
|
27012
|
-
"identity"
|
|
27013
|
-
|
|
27012
|
+
"identity"
|
|
27013
|
+
// 'funds',
|
|
27014
27014
|
];
|
|
27015
27015
|
if (fields && fields.length > 0) {
|
|
27016
27016
|
const invalidFields = fields.filter(
|
|
@@ -30053,7 +30053,8 @@ var Contract = class {
|
|
|
30053
30053
|
maxOption,
|
|
30054
30054
|
voiceCreditAmount,
|
|
30055
30055
|
circuitType,
|
|
30056
|
-
preDeactivateRoot
|
|
30056
|
+
preDeactivateRoot,
|
|
30057
|
+
fee = "auto"
|
|
30057
30058
|
}) {
|
|
30058
30059
|
const start_time = (startVoting.getTime() * 10 ** 6).toString();
|
|
30059
30060
|
const end_time = (endVoting.getTime() * 10 ** 6).toString();
|
|
@@ -30084,7 +30085,7 @@ var Contract = class {
|
|
|
30084
30085
|
certificationSystem: "0",
|
|
30085
30086
|
circuitType
|
|
30086
30087
|
},
|
|
30087
|
-
|
|
30088
|
+
fee,
|
|
30088
30089
|
void 0,
|
|
30089
30090
|
[requiredFee]
|
|
30090
30091
|
);
|
|
@@ -30116,7 +30117,8 @@ var Contract = class {
|
|
|
30116
30117
|
maxVoter,
|
|
30117
30118
|
maxOption,
|
|
30118
30119
|
circuitType,
|
|
30119
|
-
certSystemType
|
|
30120
|
+
certSystemType,
|
|
30121
|
+
fee = "auto"
|
|
30120
30122
|
}) {
|
|
30121
30123
|
const start_time = (startVoting.getTime() * 10 ** 6).toString();
|
|
30122
30124
|
const end_time = (endVoting.getTime() * 10 ** 6).toString();
|
|
@@ -30156,14 +30158,14 @@ var Contract = class {
|
|
|
30156
30158
|
groth16_tally_vkey: groth16TallyVkey,
|
|
30157
30159
|
plonk_process_vkey: plonkProcessVkey,
|
|
30158
30160
|
plonk_tally_vkey: plonkTallyVkey,
|
|
30159
|
-
max_vote_options: maxOption,
|
|
30161
|
+
max_vote_options: maxOption.toString(),
|
|
30160
30162
|
whitelist,
|
|
30161
30163
|
circuit_type: maciVoteType,
|
|
30162
30164
|
certification_system: maciCertSystem,
|
|
30163
30165
|
qtr_lib: QTR_LIB
|
|
30164
30166
|
},
|
|
30165
30167
|
`[MACI] ${title}`,
|
|
30166
|
-
|
|
30168
|
+
fee
|
|
30167
30169
|
);
|
|
30168
30170
|
return instantiateResponse;
|
|
30169
30171
|
}
|
|
@@ -30179,7 +30181,8 @@ var Contract = class {
|
|
|
30179
30181
|
circuitType,
|
|
30180
30182
|
whitelistEcosystem,
|
|
30181
30183
|
whitelistSnapshotHeight,
|
|
30182
|
-
whitelistVotingPowerArgs
|
|
30184
|
+
whitelistVotingPowerArgs,
|
|
30185
|
+
fee = "auto"
|
|
30183
30186
|
}) {
|
|
30184
30187
|
const start_time = (startVoting.getTime() * 1e6).toString();
|
|
30185
30188
|
const end_time = (endVoting.getTime() * 1e6).toString();
|
|
@@ -30216,7 +30219,7 @@ var Contract = class {
|
|
|
30216
30219
|
feegrant_operator: this.feegrantOperator
|
|
30217
30220
|
},
|
|
30218
30221
|
`[Oracle MACI] ${title}`,
|
|
30219
|
-
|
|
30222
|
+
fee
|
|
30220
30223
|
);
|
|
30221
30224
|
return instantiateResponse;
|
|
30222
30225
|
}
|