UNPKG

@ledgerhq/coin-canton

Version:
37 lines 1.34 kB
/** * Canton Testing Utilities for Ed25519 Key Generation * * Provides utilities to generate proper Ed25519 keypairs for testing Canton * onboarding without requiring physical Ledger devices. * The mock signer implements canonical hash algorithm used by the Canton app. */ import { CantonPreparedTransaction, CantonUntypedVersionedMessage } from "../types/signer"; export interface CantonTestKeyPair { publicKeyHex: string; privateKeyHex: string; privateKeyPem: string; fingerprint: string; sign: (hashHex: string) => string; } /** * Generate fresh Ed25519 keypair */ export declare function generateMockKeyPair(): CantonTestKeyPair; /** * Verify Ed25519 signature against public key and message hash */ export declare function verifySignature(publicKeyHex: string, signatureHex: string, messageHashHex: string): { isValid: boolean; error?: string; details: Record<string, string | number>; }; export declare function createMockSigner(keyPair: CantonTestKeyPair): { getAddress: (_derivationPath: string) => Promise<{ address: string; publicKey: string; }>; signTransaction: (_derivationPath: string, data: CantonPreparedTransaction | CantonUntypedVersionedMessage | string) => Promise<{ signature: string; }>; }; //# sourceMappingURL=cantonTestUtils.d.ts.map