FrameSignature.assert
Asserts that a FrameSignature.FrameSignature is structurally valid.
Checks metadata, signature scalars, and public key shape without verifying authorization.
Imports
Named
import { FrameSignature } from 'ox'Examples
Basic Usage
Unsigned protocol entries are accepted by default.
import { FrameSignature } from 'ox'
FrameSignature.assert({
payload: '0x',
scheme: 'secp256k1'
})Requiring a Signature
Set signed to require a protocol signature.
import { FrameSignature, Hash, Secp256k1 } from 'ox'
const payload = Hash.keccak256('0xdeadbeef')
const privateKey = Secp256k1.randomPrivateKey()
const signature = Secp256k1.sign({ payload, privateKey })
const entry = FrameSignature.from({
payload,
scheme: 'secp256k1',
signature
})
FrameSignature.assert(entry, { signed: true })Definition
function assert(
entry: FrameSignature,
options?: assert.Options,
): voidSource: src/core/FrameSignature.ts
Parameters
entry
- Type:
FrameSignature
The signature entry to assert.
entry.payload
- Type:
0x${string} - Optional
Explicit nonzero digest. Omit or use empty bytes for the transaction signing hash.
entry.publicKey
- Type:
{ prefix: number; x: bigint; y: bigint; } - Optional
Public key, if already known. Empty wire signatures do not retain it.
entry.scheme
- Type:
2 | "p256"
P-256 verification scheme.
entry.signature
- Type:
0x${string} | { r: bigint; s: bigint; yParity?: number; }
P-256 signature or Signature.toHex bytes.
entry.signer
- Type:
Address.Address | undefined - Optional
Signer address. Omit to use the transaction sender.
options
- Type:
assert.Options - Optional
Validation options.
options.signed
- Type:
boolean - Optional
Require a protocol signature. Does not perform cryptographic verification.
Return Type
void

