Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.startale.com/llms.txt

Use this file to discover all available pages before exploring further.

Produces an ERC-1271-compatible signature over a plain message.

Request

import { stringToHex } from 'viem'

const signature = await provider.request<`0x${string}`>({
  method: 'personal_sign',
  params: [stringToHex('I acknowledge the terms.'), address],
})

Parameters

params[0]
`0x${string}`
required
Hex-encoded message bytes.
params[1]
`0x${string}`
required
Smart-account address. Must match the connected account.

Returns

0x${string}, the signature, packed for ERC-1271 verification.

Errors

CodeCause
4001User rejected the signature
4100Wallet not connected

Verification

import { publicClient } from './viem'

const isValid = await publicClient.verifyMessage({
  address,
  message: 'I acknowledge the terms.',
  signature,
})
viem handles ERC-1271 (and ERC-6492 for undeployed accounts) automatically.