sui-multisig-cli
v1.4.1
Published
CLI tool for managing Sui multisig operations
Maintainers
Readme
Sui Multisig CLI 🛡️
This CLI tool provides a secure way to manage multisig operations on the Sui blockchain. It's designed to be used alongside the web frontend for a complete multisig solution.
Prerequisites
- Sui CLI (REQUIRED: install this custom fork)
- Bash shell environment
- jq (for JSON processing)
NOTE: To use this tool you must use the custom fork of the Sui CLI. This custom fork allows to create a transaction with a custom signer (i.e. the multisig wallet). We created a PR (https://github.com/MystenLabs/sui/pull/22158) to add this new feature to the next version of the Sui CLI.
Installation
You can install the Sui Multisig CLI tool globally using npm:
npm install -g sui-multisig-cliIf you want to run the scripts without installing the tool, see the adjusted instructions here.
Initial setup
Before you start you must initialize the Sui CLI, connected to a Sui Full node (sui client new-env) and create some accounts (sui client new-address <KEY_SCHEME>). Instructions and more details can be found here.
Scripts
0. Setup Multisig Wallet
sui-multisig setupSets up a multisig wallet with multiple signers. The script will guide you through:
- Adding public keys of all signers
- Setting weights for each key
- Setting the threshold for transaction approval
The configuration is saved to a JSON file in the transactions directory for future reference.
1. Create transaction
sui-multisig create [options]Options:
-t, --type <type>: Transaction type (publish,upgrade,call, ortransfer)-b, --batch <file>: Create multiple transactions from a JSON batch file-ms, --multisig <address>: Multisig wallet address to use as sender-d, --directory <dir>: Package directory for publish/upgrade-p, --package <address>: Package address for call-m, --module <name>: Module name for call-f, --function <name>: Function name for call-a, --args <args>: Arguments for call (space-separated string)-r, --recipient <address>: Recipient address for transfer-o, --object <id>: Object ID for transfer
Creates a multisig transaction. The script supports four types of transactions:
Publish - Deploy a new smart contract
sui-multisig create -t publish -d <package_directory>Example:
sui-multisig create -t publish -d ./my-contractUpgrade - Upgrade an existing smart contract
sui-multisig create -t upgrade -d <package_directory>Example:
sui-multisig create -t upgrade -d ./my-contractCall - Call a function on a smart contract
sui-multisig create -t call -p <package_address> -m <module_name> -f <function_name> [-a <args>]Example:
sui-multisig create -t call -p 0x123... -m counter -f createTransfer - Transfer an object to another account
sui-multisig create -t transfer -r <recipient_address> -o <object_id>Example:
sui-multisig create -t transfer -r 0x456... -o 0x789...
If no type is specified, the script will prompt you to select one interactively.
2. Approve transaction
sui-multisig approve [options]Options:
-tx, --transaction <dir>: Specify the transaction directory (either just the name or full path)-ms, --multisig <address>: Specify the multisig wallet address-s, --signer <address>: Specify the signer address to use for approval-y, --assume-yes: Automatically answer 'yes' to all prompts (non-interactive mode)
Examples:
Approve a transaction interactively:
sui-multisig approveApprove a specific transaction non-interactively:
sui-multisig approve -tx tx_20250723_211214_call_counter_create -ms 0x... -s 0x... -y3. Execute transaction
sui-multisig execute [options]Options:
-tx, --transaction <dir>: Specify the transaction directory (either just the name or full path)-ms, --multisig <address>: Specify the multisig wallet address-y, --assume-yes: Automatically answer 'yes' to all prompts (non-interactive mode)
Examples:
Execute a transaction interactively:
sui-multisig executeExecute a specific transaction non-interactively:
sui-multisig execute -tx tx_20250723_211214_call_counter_create -ms 0x... -yConfiguration
The CLI tool stores its configuration in the ~/.sui-multisig directory. This includes:
- Multisig wallet configuration
- Transaction history
- Signer information
Development
To work on the CLI tool:
- Install dependencies:
pnpm install- Build the TypeScript code:
pnpm build- Run in development mode:
pnpm devLicense
MIT
Learn more
To learn more about how multisigs work on Sui check out these resources:
