Overview
Signs a message using the specified wallet account. Behavior differs depending on the wallet type:- Connected wallets
- Delegates signing to the wallet provider’s native signing method.
- Ethereum: signatures always follow EIP-191.
- The wallet automatically prefixes messages with
"\x19Ethereum Signed Message:\n" + message length before signing.
- As a result, these signatures cannot be used as raw transaction signatures or broadcast on-chain.
- If
addEthereumPrefixis set tofalse, an error is thrown because connected Ethereum wallets always prefix. - Other chains: follows the native connected wallet behavior.
- Embedded wallets
- Uses the Turnkey API to sign the message directly.
- Supports optional
addEthereumPrefix: - If
true(default for Ethereum), the message is prefixed before signing. - If
false, the raw message is signed without any prefix.
- Automatically handles encoding and hashing based on the wallet account’s address format,
- Optionally allows stamping with a specific stamper
StamperType.Passkey, StamperType.ApiKey, or StamperType.Wallet).
Package: core
Defined in: clients/core.ts:2214
Parameters
Response
A successful response returns the following fields:A promise that resolves to a
v1SignRawPayloadResult containing the signature and metadata.