createEd25519SigningSession
Creates a signing session from an Ed25519 private key.
Import
Section titled “Import”import { createEd25519SigningSession } from "@category-labs/mera";import { createEd25519SigningSession, getSolanaAddress,} from "@category-labs/mera";
const privateKey = crypto.getRandomValues(new Uint8Array(32));const message = new TextEncoder().encode("hello mera");
const session = createEd25519SigningSession({ privateKey });
const address = getSolanaAddress(session.publicKey);const signature = await session.signMessage(message);
session.end();Parameters
Section titled “Parameters”options is a CreateSigningSessionOptions.
options.privateKey
Section titled “options.privateKey”- Type:
Uint8Array - Required
Ed25519 private key (the 32-byte seed).
Returns
Section titled “Returns”A live Ed25519SigningSession.
Errors
Section titled “Errors”INPUT_INVALID:privateKeyis not 32 bytes.
See also
Section titled “See also”- getSolanaAddress: the address for
session.publicKey. - Signing sessions: how a session owns the key, and the lifecycle.