Skip to main content
Version: v1.2

Cli Module

Table of contents

Interfaces

Functions

Functions

airdrop

airdrop(AirdropArgs): Promise<void>

Utility that can be used to get topup credits airdropped to the coordinator

Parameters

NameTypeDescription
AirdropArgsAirdropArgsThe arguments for the airdrop command

Returns

Promise<void>

Defined in

commands/airdrop.ts:11


checkVerifyingKeys

checkVerifyingKeys(CheckVerifyingKeysArgs): Promise<boolean>

Command to confirm that the verifying keys in the contract match the local ones

Parameters

NameTypeDescription
CheckVerifyingKeysArgsCheckVerifyingKeysArgsThe arguments for the checkVerifyingKeys command

Returns

Promise<boolean>

Whether the verifying keys match or not

Note

see different options for zkey files to use specific circuits https://maci.pse.dev/docs/security/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing

Defined in

commands/checkVerifyingKeys.ts:28


deploy

deploy(DeployArgs): Promise<DeployedContracts>

Deploy MACI and related contracts

Parameters

NameTypeDescription
DeployArgsDeployArgsThe arguments for the deploy command

Returns

Promise<DeployedContracts>

The addresses of the deployed contracts

Defined in

commands/deploy.ts:26


deployPoll

deployPoll(DeployPollArgs): Promise<PollContracts>

Deploy a new Poll for the set of MACI's contracts already deployed

Parameters

NameTypeDescription
DeployPollArgsDeployPollArgsThe arguments for the deployPoll command

Returns

Promise<PollContracts>

The addresses of the deployed contracts

Defined in

commands/deployPoll.ts:21


deployVkRegistryContract

deployVkRegistryContract(quiet): Promise<string>

Deploy the vkRegistry contract

Parameters

NameTypeDescription
quietDeployVkRegistryArgswhether to print the contract address

Returns

Promise<string>

Defined in

commands/deployVkRegistry.ts:20


fundWallet

fundWallet(«destructured»): Promise<void>

Fund a new wallet with Ether

Parameters

NameType
«destructured»FundWalletArgs

Returns

Promise<void>

Defined in

commands/fundWallet.ts:9


genKeyPair

genKeyPair(args): Object

Generate a new Maci Key Pair and print it to the screen

Parameters

NameTypeDescription
argsIGenKeypairArgskeypair generation params

Returns

Object

  • keypair
NameType
privateKeystring
publicKeystring

Defined in

commands/genKeyPair.ts:15


genLocalState

genLocalState(GenLocalStateArgs): Promise<void>

Generate a local MACI state from the smart contracts events

Parameters

NameTypeDescription
GenLocalStateArgsGenLocalStateArgsThe arguments for the genLocalState command

Returns

Promise<void>

Defined in

commands/genLocalState.ts:24


genMaciPubKey

genMaciPubKey(privkey, quiet?): string

Generate a new Maci Public key from a private key

Parameters

NameTypeDefault valueDescription
privkeystringundefined-
quietbooleantruewhether to log the output

Returns

string

the public key serialized

Defined in

commands/genPubKey.ts:13


genProofs

genProofs(GenProofsArgs): Promise<TallyData>

Generate proofs for the message processing, tally and subsidy calculations

Parameters

NameTypeDescription
GenProofsArgsGenProofsArgsThe arguments for the genProofs command

Returns

Promise<TallyData>

The tally data

Note

see different options for zkey files to use specific circuits https://maci.pse.dev/docs/security/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing

Defined in

commands/genProofs.ts:42


getPoll

getPoll(args): Promise<IGetPollData>

Get deployed poll from MACI contract

Parameters

NameTypeDescription
argsIGetPollArgsThe arguments for the get poll command

Returns

Promise<IGetPollData>

poll data

Defined in

commands/poll.ts:14


isRegisteredUser

isRegisteredUser(IRegisteredArgs): Promise<{ isRegistered: boolean ; stateIndex?: string }>

Checks if user is registered with public key

Parameters

NameTypeDescription
IRegisteredArgsIRegisteredUserArgsThe arguments for the register check command

Returns

Promise<{ isRegistered: boolean ; stateIndex?: string }>

user registered or not and state index

Defined in

commands/signup.ts:94


mergeMessages

mergeMessages(MergeMessagesArgs): Promise<void>

Merge the message queue on chain

Parameters

NameTypeDescription
MergeMessagesArgsMergeMessagesArgsThe arguments for the mergeMessages command

Returns

Promise<void>

Defined in

commands/mergeMessages.ts:25


mergeSignups

mergeSignups(MergeSignupsArgs): Promise<void>

Command to merge the signups of a MACI contract

Parameters

NameTypeDescription
MergeSignupsArgsMergeSignupsArgsThe arguments for the mergeSignups command

Returns

Promise<void>

Defined in

commands/mergeSignups.ts:25


proveOnChain

proveOnChain(ProveOnChainArgs): Promise<void>

Command to prove the result of a poll on-chain

Parameters

NameTypeDescription
ProveOnChainArgsProveOnChainArgsThe arguments for the proveOnChain command

Returns

Promise<void>

Defined in

commands/proveOnChain.ts:43


publish

publish(PublishArgs): Promise<string>

Publish a new message to a MACI Poll contract

Parameters

NameTypeDescription
PublishArgsPublishArgsThe arguments for the publish command

Returns

Promise<string>

The ephemeral private key used to encrypt the message

Defined in

commands/publish.ts:17


setVerifyingKeys

setVerifyingKeys(SetVerifyingKeysArgs): Promise<void>

Function that sets the verifying keys in the VkRegistry contract

Parameters

NameTypeDescription
SetVerifyingKeysArgsSetVerifyingKeysArgsThe arguments for the setVerifyingKeys command

Returns

Promise<void>

Note

see different options for zkey files to use specific circuits https://maci.pse.dev/docs/security/trusted-setup, https://maci.pse.dev/docs/testing/#pre-compiled-artifacts-for-testing

Defined in

commands/setVerifyingKeys.ts:26


signup

signup(args): Promise<ISignupData>

Signup a user to the MACI contract

Parameters

NameTypeDescription
argsSignupArgsThe arguments for the signup command

Returns

Promise<ISignupData>

The state index of the user and transaction hash

Defined in

commands/signup.ts:17


timeTravel

timeTravel(«destructured»): Promise<void>

Utility to travel in time when using a local blockchain

Parameters

NameType
«destructured»TimeTravelArgs

Returns

Promise<void>

Defined in

commands/timeTravel.ts:10


topup

topup(TopupArgs): Promise<void>

Publish a topup message

Parameters

NameTypeDescription
TopupArgsTopupArgsThe arguments for the topup command

Returns

Promise<void>

Defined in

commands/topup.ts:9


verify

verify(VerifyArgs): Promise<void>

Verify the results of a poll and optionally the subsidy results on-chain

Parameters

NameTypeDescription
VerifyArgsVerifyArgsThe arguments for the verify command

Returns

Promise<void>

Defined in

commands/verify.ts:23