Protocol Kit Reference
Transaction Signatures
signTypedData

signTypedData

Signs a transaction with the current signer according to the EIP-712.

Usage


_22
import {
_22
MetaTransactionData,
_22
OperationType
_22
} from '@safe-global/types-kit'
_22
import { protocolKit } from './setup.ts'
_22
_22
const transactions: MetaTransactionData[] = [{
_22
to: '0x...',
_22
value: '123',
_22
data: '0x',
_22
operation: OperationType.Call // Optional
_22
}]
_22
const eip712Data = await protocolKit.createTransaction({
_22
transactions
_22
})
_22
_22
const methodVersion = 'v4'
_22
_22
const signature = await protocolKit.signTypedData(
_22
eip712Data,
_22
methodVersion // Optional
_22
)

Parameters

eip712Data

The Safe transaction or message to sign.


_10
const signature = await protocolKit.signTypedData(
_10
eip712Data
_10
)

methodVersion (Optional)

  • Type: 'v3' | 'v4'

The EIP-712 version to use.


_10
const signature = await protocolKit.signTypedData(
_10
eip712Data,
_10
'v4'
_10
)

Returns

Promise<SafeSignature>

The Safe signature.

Was this page helpful?