import { SmartAccountSigner } from '@alchemy/aa-core' import { type Address, type Hex, type SignableMessage, type TypedData, type TypedDataDefinition, type TypedDataDomain, isHex, toBytes, } from 'viem' import { PKPEthersWallet } from '.' export class PkpLitSigner implements SmartAccountSigner { signerType = 'PKP' constructor(readonly inner: PKPEthersWallet) {} async getAddress() { return this.inner.getAddress() as Promise
} signMessage = async (msg: SignableMessage) => { const result = await (this.inner.signMessage( typeof msg === 'string' ? msg : isHex(msg.raw) ? toBytes(msg.raw) : msg.raw, ) as Promise