sign
Sign a message or typed data with the connected wallet.
Smart blocks: cannot be nested. This command performs an immediate wallet, RPC, external-service or control-flow operation and cannot run inside an atomic batch.
Syntax
Section titled “Syntax”sign <variable> [message]Arguments
Section titled “Arguments”| Name | Type | Evaluation | Description |
|---|---|---|---|
variable | variable | Build time | Variable name |
[message] | string | Build time | Plain-text message to sign |
Options
Section titled “Options”| Name | Type | Evaluation | Description |
|---|---|---|---|
--typed | string | Build time | EIP-712 typed data JSON string |
With --typed, the domain, message-struct, and final EIP-712 hashes are printed
from the actual supplied payload before the wallet is asked to sign.
Examples
Section titled “Examples”# Sign a plain-text messagesign $sig "hello world"
# Sign typed data (EIP-712)sign $sig --typed '{"types":{"Mail":[{"name":"to","type":"address"}]},"primaryType":"Mail","message":{"to":"0x1234..."}}'
# Store and print the signaturesign $sig "approve this action"print $sigSee Also
Section titled “See Also”- exec — call a contract function