import type { EncodedPQSig } from '../types/transactions/encoded.js'; export declare const ALGORAND_ADDRESS_BYTE_LENGTH = 36; export declare const ALGORAND_CHECKSUM_BYTE_LENGTH = 4; export declare const ALGORAND_ADDRESS_LENGTH = 58; export declare const ALGORAND_ZERO_ADDRESS_STRING = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ"; export declare const MALFORMED_ADDRESS_ERROR_MSG = "address seems to be malformed"; export declare const CHECKSUM_ADDRESS_ERROR_MSG = "wrong checksum for address"; /** * The required byte length of a post-quantum signature scheme identifier. */ export declare const PQ_SCHEME_SIZE = 2; /** * The largest value a post-quantum address salt may take. The salt occupies a * single byte of the address preimage. */ export declare const PQ_SALT_MAX = 255; /** * Represents an Algorand address */ export declare class Address { /** * The binary form of the address. For standard accounts, this is the public key. */ readonly publicKey: Uint8Array; /** * Create a new Address object from its binary form. * @param publicKey - The binary form of the address. Must be 32 bytes. */ constructor(publicKey: Uint8Array); /** * Check if the address is equal to another address. */ equals(other: Address): boolean; /** * Compute the 4 byte checksum of the address. */ checksum(): Uint8Array; /** * Encode the address into a string form. */ toString(): string; /** * Decode an address from a string. * @param address - The address to decode. Must be 58 bytes long. * @returns An Address object corresponding to the input string. */ static fromString(address: string): Address; /** * Get the zero address. */ static zeroAddress(): Address; } /** * decodeAddress takes an Algorand address in string form and decodes it into a Uint8Array. * @param address - an Algorand address with checksum. * @returns the decoded form of the address's public key and checksum */ export declare function decodeAddress(address: string): Address; /** * isValidAddress checks if a string is a valid Algorand address. * @param address - an Algorand address with checksum. * @returns true if valid, false otherwise */ export declare function isValidAddress(address: string): boolean; /** * encodeAddress takes an Algorand address as a Uint8Array and encodes it into a string with checksum. * @param address - a raw Algorand address * @returns the address and checksum encoded as a string. */ export declare function encodeAddress(address: Uint8Array): string; /** * Get the escrow address of an application. * @param appID - The ID of the application. * @returns The address corresponding to that application's escrow account. */ export declare function getApplicationAddress(appID: number | bigint): Address; /** * Derive a post-quantum (PQ) account address together with the canonical salt * used to derive it. * * @remarks * The salt is found by rejection sampling: it is the lowest value whose * preimage hashes to something that could not also be an Ed25519 public key, so * that a PQ account can never collide with an Ed25519 one. * * @param schemeBytes - The 2-byte ASCII PQ scheme identifier (e.g. "f1" for Falcon-1024). * @param key - The scheme's canonical public key. * @returns The derived Address and the canonical 1-byte salt. * @throws If `schemeBytes` is not exactly {@link PQ_SCHEME_SIZE} bytes, or in * the ~2^-256 case where no salt in range yields a valid address. */ export declare function addressFromPQKey(schemeBytes: Uint8Array, key: Uint8Array): { address: Address; salt: number; }; /** * Derive the account address that a post-quantum signature authorizes. * * Unlike an Ed25519 signature, a PQ signature carries the scheme, salt and * public key of the signing account, so the address it authorizes is fully * determined by the signature and does not have to be supplied out of band. * * This also validates the signature's self-consistency: the salt must be the * canonical one for the given scheme and public key, which is what the network * requires. * * @param pqsig - The post-quantum signature to derive the address from. * @returns The address of the account the signature authorizes. * @throws If the signature's scheme is malformed, or if its salt is not the * canonical one for its scheme and public key. */ export declare function addressFromPQSig(pqsig: EncodedPQSig): Address;