intents-cli
A CLI tool for signing and executing user operations.
Building the Application
To build the application, run:
make build
Configuration
Before running this, your .env
file should be set up with the necessary configurations like ETH_NODE_URL
, SIGNER_PRIVATE_KEY
, etc.
Checkout .env.example
for the reference.
Running the Application
To run the application with a JSON input string, use:
intents-cli --u 'USER_OP_JSON'
Note the userOp nonce value is automatically generated by the CLI.
Using JSON File
Alternatively, you can use a JSON file as input:
intents-cli [command] --u ./sample.json
Available Commands
sign
: Sign a userOp.
send
: Submit a userOp to the node's EVM Entrypoint handleOps.
sign-send
: Sign and send a userOp.
Available Flags
--u
: User operation JSON as string or path to a JSON file.
Example
1 - Sign a blank userOp without initcode or calldata values:
intents-cli sign --u '{
"sender":"0x1af5Dc71CE5F2e3aE90bf2b3ECD0a3498f981ab3",
"nonce":"0x0",
"initCode":"0x",
"callData":"",
"callGasLimit":"0xc3500",
"verificationGasLimit":"0x996a0",
"preVerificationGas":"0x99000",
"maxFeePerGas":"0x0",
"maxPriorityFeePerGas":"0x0",
"paymasterAndData":"0x",
"signature":"0x"
}'
2 - Sign a userOp with initcode and calldata values:
Note here the EIP-4337 initcode spec for creating a new account: initcode-spec.md
intents-cli sign --u '{
"sender":"0x1af5Dc71CE5F2e3aE90bf2b3ECD0a3498f981ab3",
"nonce":"0x0",
"initCode":"0x42E60c23aCe33c23e0945a07f6e2c1E53843a1d55fbfb9cf000000000000000000000000fd4ec985482e1ed2b651293025EDaD889FaC3947",
"callData":"0x5fbfb9cf000000000000000000000000fd4ec985482e1ed2b651293025EDaD889FaC394700",
"callGasLimit":"0xc3500",
"verificationGasLimit":"0x996a0",
"preVerificationGas":"0x99000",
"maxFeePerGas":"0x0",
"maxPriorityFeePerGas":"0x0",
"paymasterAndData":"0x",
"signature":"0x"
}'
Cleaning Up
To clean up the binaries:
make clean
Running Tests
Run unit and race tests using:
make test-unit
make test-race