import { ChainTypeName } from "../internal.js"; /** * CAIP-350 text serialization helpers for working with chain references and addresses. * * These helpers implement CAIP-350's text encoding rules, which are chainType-specific * (e.g., for eip155: decimal strings for chain references, hex strings with EIP-55 checksumming * for addresses; for solana: base58 encoding). They are synchronous and contain no ENS * or network resolution logic. */ /** * Converts a binary chain reference to its text representation. * * For EIP-155 chains, converts to decimal string. * For Solana chains, converts to base58-encoded string. * * @param chainReference - The binary chain reference bytes * @param chainType - The binary chain type bytes * @returns The text representation of the chain reference * @throws {UnsupportedChainType} If the chain type is not supported * @example * ```ts * const chainRef = fromHex("0x01", "bytes"); * const chainType = fromHex("0x0000", "bytes"); * const text = chainReferenceToText(chainRef, chainType); * // Returns: "1" * ``` */ export declare const chainReferenceToText: (chainReference: Uint8Array, chainType: Uint8Array) => string; /** * Converts a text chain reference to its binary representation. * * For EIP-155 chains, parses as decimal string. * For Solana chains, decodes from base58-encoded string. * * @param chainReference - The text representation of the chain reference * @param chainType - The chain type (e.g., "eip155", "solana") * @returns The binary chain reference bytes * @throws {UnsupportedChainType} If the chain type is not supported * @example * ```ts * const binary = chainReferenceToBinary("1", "eip155"); * // Returns: Uint8Array([0x01]) * ``` */ export declare const chainReferenceToBinary: (chainReference: string, chainType: ChainTypeName) => Uint8Array; /** * Converts a binary address to its text representation. * * For EIP-155 chains, converts to EIP-55 checksummed address. * For Solana chains, converts to base58-encoded string. * * @param address - The binary address bytes * @param chainType - The binary chain type bytes * @returns The text representation of the address * @throws {UnsupportedChainType} If the chain type is not supported * @example * ```ts * const addr = fromHex("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "bytes"); * const chainType = fromHex("0x0000", "bytes"); * const text = addressToText(addr, chainType); * // Returns: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" * ``` */ export declare const addressToText: (address: Uint8Array, chainType: Uint8Array, chainReference?: Uint8Array) => string; /** * Converts a text address to its binary representation. * * For EIP-155 chains, validates and converts from hex string (with EIP-55 checksum). * For Solana chains, decodes from base58-encoded string. * * @param address - The text representation of the address * @param chainType - The chain type (e.g., "eip155", "solana") * @returns The binary address bytes * @throws {InvalidAddress} If the address format is invalid for the chain type * @throws {UnsupportedChainType} If the chain type is not supported * @example * ```ts * const binary = addressToBinary("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "eip155"); * // Returns: Uint8Array with the address bytes * ``` */ export declare const addressToBinary: (address: string, chainType: ChainTypeName) => Uint8Array; //# sourceMappingURL=caip350.d.ts.map