Skip to content

extractEVMSignature

extractEVMSignature(message, signature, protocol, options): Promise<{ r: string; s: string; v: bigint; }>

Extracts an EVM-compatible signature from a base64-encoded signature.

Usage

ts
import { extractEVMSignature } from '@midl/executor';

const result = await extractEVMSignature(
  message,
  signature,
  protocol,
  {
    addressType,
    publicKey,
  }
);
// result: { r, s, v }

Parameters

NameTypeDescription
messagestringThe message that was signed.
signaturestringThe base64-encoded signature.
protocolSignMessageProtocolThe signature protocol used.
optionsobjectAdditional options.
options.addressTypeAddressTypeThe address type of the signer.
options.publicKeystringThe public key of the signer.

Returns

Promise<{ r: string; s: string; v: bigint; }> — The extracted EVM signature components.