SignatureErc8010.wrap
Wraps a signature into ERC-8010 format.
Imports
Named
import { SignatureErc8010 } from 'ox/erc8010'
Examples
import { Secp256k1, Signature } from 'ox'
import { SignatureErc8010 } from 'ox/erc8010'
const signature = Secp256k1.sign({
payload: '0x...',
privateKey: '0x...',
})
const wrapped = SignatureErc8010.wrap({
authorization: { ... },
data: '0xdeadbeef',
signature: Signature.toHex(signature),
})
Definition
function wrap(
value: SignatureErc8010.Unwrapped,
): Wrapped
Source: src/erc8010/SignatureErc8010.ts
Parameters
value
Values to wrap.
value.authorization
- Type:
{ address: abitype_Address; chainId: number; nonce: bigint; r: bigint; s: bigint; yParity: number; }
Authorization signed by the delegatee.
value.data
- Type:
0x${string}
- Optional
Data to initialize the delegation.
value.signature
- Type:
0x${string}
The original signature.
value.to
- Type:
Address.Address | undefined
- Optional
Address of the initializer.
Return Type
Wrapped signature.