Skip to content

Ed25519.sign

Signs the payload with the provided private key and returns an Ed25519 signature.

Imports

Named
import { Ed25519 } from 'ox'

Examples

import { Ed25519 } from 'ox'
 
const signature = Ed25519.sign({ 
  payload: '0xdeadbeef', 
  privateKey: '0x...'
})

Definition

function sign<as>(
  options: sign.Options<as>,
): sign.ReturnType<as>

Source: src/core/Ed25519.ts

Parameters

options

  • Type: sign.Options<as>

The signing options.

options.as

  • Type: "Bytes" | "Hex" | as
  • Optional

Format of the returned signature.

options.payload

  • Type: 0x${string} | Uint8Array

Payload to sign.

options.privateKey

  • Type: 0x${string} | Uint8Array

Ed25519 private key.

Return Type

The Ed25519 signature.

sign.ReturnType<as>