Function Signature
Description
Signs an EVM transaction using the wallet identified by the supplied walletMetadata. The SDK is stateless — every call requires walletMetadata. If the wallet was created with backUpToDynamic: true, supply the password so the SDK can recover shares from backup when externalServerKeyShares is omitted.
When you pass externalServerKeyShares (the caller-supplied path), walletMetadata.externalServerKeySharesBackupInfo must also be present — signTransaction throws if shares are supplied but backup metadata is missing. The full walletMetadata returned from createWalletAccount / importPrivateKey already includes it; identity-only metadata from fetchWalletMetadata will be rejected.
Parameters
Required Parameters
walletMetadata (WalletMetadata) - Non-sensitive wallet metadata persisted from createWalletAccount() / importPrivateKey(). The sender address comes from walletMetadata.accountAddress.
transaction (TransactionSerializable) - The transaction to sign (viem format)
Optional Parameters
password (string) - Required if the wallet was created with backUpToDynamic: true. Used for backup decryption when externalServerKeyShares is not provided.
externalServerKeyShares (ServerKeyShare[]) - Caller-supplied plaintext shares. If omitted, the SDK recovers from backup using password.
Returns
Promise<string> - The signed transaction as a hex string
Example
Error Handling