sign
Sign a message or typed data with the connected wallet.
Syntax
Section titled “Syntax”sign <variable> [message]Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
variable |
variable |
Variable name |
[message] |
string |
Plain-text message to sign |
Options
Section titled “Options”| Name | Type | Description |
|---|---|---|
--typed |
string |
EIP-712 typed data JSON string |
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