/** * Utilities for converting between hex and base64 formats * Required for Canton Network integration (Canton uses base64, Privy uses hex) */ /** * Converts hex string to base64 format * @param hex - Hex string (with or without 0x prefix) * @returns Base64 encoded string * @example * ```ts * const base64 = hexToBase64('0x48656c6c6f'); * console.log(base64); // "SGVsbG8=" * ``` */ export declare const hexToBase64: (hex: string) => string; /** * Converts base64 string to hex format * @param base64 - Base64 encoded string * @returns Hex string with 0x prefix * @example * ```ts * const hex = base64ToHex('SGVsbG8='); * console.log(hex); // "0x48656c6c6f" * ``` */ export declare const base64ToHex: (base64: string) => string; /** * Converts Uint8Array to base64 string * @param bytes - Byte array to convert * @returns Base64 encoded string */ export declare const bytesToBase64: (bytes: Uint8Array) => string; /** * Converts base64 string to Uint8Array * @param base64 - Base64 encoded string * @returns Byte array */ export declare const base64ToBytes: (base64: string) => Uint8Array; /** * Removes leading 00 byte from hex string if present * Required for Stellar public keys from Privy which include a leading 00 byte * @param hex - Hex string (with or without 0x prefix) * @returns Clean hex string with 0x prefix * @example * ```ts * const clean = stripLeadingZero('0x00e95cb2553361ed...'); * console.log(clean); // "0xe95cb2553361ed..." * ``` */ export declare const stripLeadingZero: (hex: string) => string; /** * Converts Privy public key (hex with leading 00) to Canton format (base64 without leading 00) * This function handles the conversion from Privy's Stellar wallet public key format * to Canton Network's expected base64 format. * * @param publicKeyHex - Public key in hex format from Privy (may include 0x prefix and leading 00) * @returns Public key in base64 format for Canton Network * @throws {Error} If conversion fails * * @example * ```ts * const wallet = { publicKey: '00e95cb2553361ed...' }; * const cantonKey = privyPublicKeyToCantonBase64(wallet.publicKey); * // Use cantonKey for Canton Network API calls * ``` */ export declare const privyPublicKeyToCantonBase64: (publicKeyHex: string) => string; /** * Decodes a base58 string to bytes using BigInt for precision * @param str - Base58 encoded string * @returns Byte array */ export declare const base58ToBytes: (str: string) => Uint8Array; /** * Converts a Solana address (base58) to base64 for Canton Network * @param address - Solana address in base58 format * @returns Public key in base64 format (32 bytes Ed25519 key) * @throws {Error} If decoded key is not 32 bytes */ export declare const solanaAddressToBase64: (address: string) => string;