Ed25519SigningSession
A live signing session holding an Ed25519 private key. createEd25519SigningSession returns it.
Import
Section titled “Import”import type { Ed25519SigningSession } from "@category-labs/mera";Members
Section titled “Members”publicKey
Section titled “publicKey”Uint8Array, the 32-byte Ed25519 public key.
signMessage(message)
Section titled “signMessage(message)”Signs an arbitrary-length message and resolves to the 64-byte Ed25519 signature (R || s). Hashing happens inside Ed25519 itself.
Zeroes the session-owned private-key copy and permanently ends the session; later signing throws SESSION_ENDED.
[Symbol.dispose]()
Section titled “[Symbol.dispose]()”Calls end, so a using declaration ends the session when its scope exits:
import { createEd25519SigningSession } from "@category-labs/mera";
const privateKey = crypto.getRandomValues(new Uint8Array(32));const message = new TextEncoder().encode("hello mera");
{ using session = createEd25519SigningSession({ privateKey }); await session.signMessage(message);} // ended hereErrors
Section titled “Errors”SESSION_ENDED:signMessagewas called afterend.
See also
Section titled “See also”- createEd25519SigningSession: creates the session from a private key.
- getSolanaAddress: the address for
publicKey. - Signing sessions: how a session owns the key, and the lifecycle.