/** * HD Wallet WASM Wrapper for sdn-js * * Re-exports from hd-wallet-wasm npm package with SDN-specific helpers. * Provides BIP-39 mnemonic generation, SLIP-10 key derivation, * Ed25519 signing, and X25519 encryption. */ import { HDWalletOptions, MnemonicOptions, DerivedKey, KeyPair, IdentityKeyPair, DerivedIdentity } from './types'; /** * Initialize the HD wallet WASM module */ export declare function initHDWallet(_options?: HDWalletOptions): Promise; /** * Check if HD wallet module is loaded */ export declare function isHDWalletAvailable(): boolean; /** * Inject entropy for WASI environments */ export declare function injectEntropy(entropy: Uint8Array): void; /** * Check if entropy is available */ export declare function hasEntropy(): boolean; /** * Generate a new BIP-39 mnemonic phrase */ export declare function generateMnemonic(options?: MnemonicOptions): Promise; /** * Validate a BIP-39 mnemonic phrase */ export declare function validateMnemonic(mnemonic: string, language?: MnemonicOptions['language']): Promise; /** * Convert a mnemonic to a 64-byte seed using PBKDF2 */ export declare function mnemonicToSeed(mnemonic: string, passphrase?: string): Promise; /** * Derive an Ed25519 key at the given path using SLIP-10 */ export declare function deriveEd25519Key(seed: Uint8Array, path: string): Promise; /** * Derive Ed25519 public key from a 32-byte seed */ export declare function ed25519PublicKey(seed: Uint8Array): Promise; /** * Derive a full Ed25519 key pair */ export declare function deriveEd25519KeyPair(seed: Uint8Array, path: string): Promise; /** * Derive X25519 public key from private key */ export declare function x25519PublicKey(privateKey: Uint8Array): Promise; /** * Derive a secp256k1 key pair at the given BIP-32 path */ export declare function deriveSecp256k1Key(seed: Uint8Array, path: string): Promise; /** * Derive a PeerID string from a secp256k1 compressed public key */ export declare function derivePeerIdFromPublicKey(publicKey: Uint8Array): string; /** * Derive a PeerID string from an xpub */ export declare function derivePeerIdFromXpub(xpub: string): string; /** * Derive an IPNS hash from an xpub */ export declare function deriveIpnsHashFromXpub(xpub: string): string; /** * Derive a complete SDN identity from a seed */ export declare function deriveIdentity(seed: Uint8Array, account?: number): Promise; /** * Derive a deterministic account xpub from the seed. * * Path: m/44'/0'/{account}' */ export declare function deriveXPub(seed: Uint8Array, account?: number): Promise; /** * Create identity from mnemonic (convenience function) */ export declare function identityFromMnemonic(mnemonic: string, passphrase?: string, account?: number): Promise; /** * Sign a message using Ed25519 */ export declare function sign(privateKey: Uint8Array, message: Uint8Array): Promise; /** * Verify an Ed25519 signature */ export declare function verify(publicKey: Uint8Array, message: Uint8Array, signature: Uint8Array): Promise; /** * Perform X25519 key exchange */ export declare function x25519ECDH(privateKey: Uint8Array, publicKey: Uint8Array): Promise; /** * Encrypt data using AES-GCM in the HD wallet WASM native crypto backend. */ export declare function encrypt(key: Uint8Array, plaintext: Uint8Array): Promise; /** * Decrypt data using AES-GCM in the HD wallet WASM native crypto backend. */ export declare function decrypt(key: Uint8Array, ciphertext: Uint8Array): Promise; /** * Encrypt bytes using ECDH-derived shared secret (backward compatible) */ export declare function encryptBytes(message: Uint8Array, recipientPubKey: Uint8Array, senderPrivKey: Uint8Array): Promise; /** * Decrypt bytes using ECDH-derived shared secret (backward compatible) */ export declare function decryptBytes(encrypted: Uint8Array, senderPubKey: Uint8Array, recipientPrivKey: Uint8Array): Promise; /** * Generate random bytes */ export declare function randomBytes(length: number): Uint8Array; /** * Generate a random 32-byte encryption key */ export declare function generateKey(): Uint8Array; /** * Compute SHA-256 hash */ export declare function sha256(data: Uint8Array): Promise; /** * Compute SHA-512 hash. */ export declare function sha512(data: Uint8Array): Promise; /** * Derive bytes with HKDF-SHA256 in the native WASM backend. */ export declare function hkdfSha256(inputKeyMaterial: Uint8Array, salt: Uint8Array, info: Uint8Array, length: number): Promise; /** * Derive bytes with PBKDF2-SHA256 in the native WASM backend. */ export declare function pbkdf2Sha256(password: Uint8Array, salt: Uint8Array, iterations: number, length: number): Promise; /** * Encrypt using AES-GCM with a caller-provided IV in the native WASM backend. * The returned bytes are ciphertext || tag. */ export declare function aesGcmEncryptWithIv(key: Uint8Array, plaintext: Uint8Array, iv: Uint8Array, aad?: Uint8Array): Promise; /** * Decrypt ciphertext || tag with AES-GCM in the native WASM backend. */ export declare function aesGcmDecryptWithIv(key: Uint8Array, ciphertextAndTag: Uint8Array, iv: Uint8Array, aad?: Uint8Array): Promise; /** * Decrypt AES-CTR bytes in the native WASM backend. */ export declare function aesCtrDecryptWithIv(key: Uint8Array, ciphertext: Uint8Array, iv: Uint8Array): Promise; //# sourceMappingURL=hd-wallet.d.ts.map