import { Hex } from '@layerzerolabs/lz-utilities'; import * as _layerzerolabs_lz_definitions from '@layerzerolabs/lz-definitions'; /** * Computes the Keccak-256 hash of the given message. * introduction: https://wiki.rugdoc.io/docs/introduction-to-ethereums-keccak-256-algorithm/ * * @param {Uint8Array | string} message - The input message to hash. * @returns {Uint8Array} The Keccak-256 hash of the input message. */ declare function keccak_256(message: Uint8Array | string): Uint8Array; /** * Computes the BLAKE2b hash of the given message. * introduction: https://en.wikipedia.org/wiki/BLAKE_(hash_function) * * @param {Uint8Array | string} message - The input message to hash. * @returns {Uint8Array} The BLAKE2b hash of the input message. */ declare function blake2b(message: Uint8Array | string): Uint8Array; /** * Computes the SHA3-256 hash of the given message. * * @param {Uint8Array | string} message - The input message to hash. * @returns {Uint8Array} The SHA3-256 hash of the input message. */ declare function sha3_256(message: Uint8Array | string): Uint8Array; /** * Computes the SHA-256 hash of the given message. * * @param {Uint8Array | string} message - The input message to hash. * @returns {Uint8Array} The SHA-256 hash of the input message. */ declare function sha2_256(message: Uint8Array | string): Uint8Array; /** * Enum representing different signing algorithms. */ declare enum SignAlgorithm { /** * Native signing algorithm. */ NATIVE = 0, /** * SECP256K1 signing algorithm. * introduction: https://en.bitcoin.it/wiki/Secp256k1 */ SECP256K1 = 1, /** * ED25519 signing algorithm. * introduction: https://ed25519.cr.yp.to/ */ ED25519 = 2 } /** * Interface representing a key pair consisting of a private key and a public key. */ interface KeyPair { /** * The private key as a Uint8Array. */ privateKey: Uint8Array; /** * The public key as a Uint8Array. */ publicKey: Uint8Array; } /** * Signs a hash using the ed25519 algorithm. * * @param {Uint8Array} hash - The hash to sign, must be 32 bytes long. * @param {string | Uint8Array | bigint} privateKey - The private key in hex format, Uint8Array, or bigint. * @returns {Promise} A promise that resolves to the signature. * @throws {Error} If the hash is not 32 bytes long or the signature is invalid. */ declare function signHash$2(hash: Uint8Array, privateKey: string | Uint8Array | bigint): Promise; /** * Gets the public key corresponding to the given private key using the ed25519 algorithm. * * @param {string | Uint8Array | bigint} privateKey - The private key in hex format, Uint8Array, or bigint. * @returns {Promise} A promise that resolves to the public key. */ declare function getPublicKey$1(privateKey: string | Uint8Array | bigint): Promise; declare namespace ed25519 { export { getPublicKey$1 as getPublicKey, signHash$2 as signHash }; } /** * Signs a hash using the secp256k1 algorithm. * * @param {Uint8Array} hash - The hash to sign, must be 32 bytes long. * @param {string | Uint8Array | bigint} privateKey - The private key in hex format, Uint8Array, or bigint. * @returns {Promise} A promise that resolves to the signature. * @throws {Error} If the hash is not 32 bytes long or the signature is invalid. */ declare function signHash$1(hash: Uint8Array, privateKey: string | Uint8Array | bigint): Promise; /** * Gets the public key corresponding to the given private key using the secp256k1 algorithm. * * @param {string | Uint8Array | bigint} privateKey - The private key in hex format, Uint8Array, or bigint. * @returns {Promise} A promise that resolves to the public key. */ declare function getPublicKey(privateKey: string | Uint8Array | bigint): Promise; declare const secp256k1_getPublicKey: typeof getPublicKey; declare namespace secp256k1 { export { secp256k1_getPublicKey as getPublicKey, signHash$1 as signHash }; } /** * Signs a hash using the specified signing algorithm. * * @param {Uint8Array} hash - The hash to sign, must be 32 bytes long. * @param {string | Uint8Array} privateKey - The private key in hex format or Uint8Array. * @param {SignAlgorithm} algorithm - The signing algorithm to use. * @returns {Promise} A promise that resolves to the signature. * @throws {Error} If the hash is not 32 bytes long or the algorithm is unsupported. */ declare function signHash(hash: Uint8Array, privateKey: string | Uint8Array, algorithm: SignAlgorithm): Promise; /** * Interface for signing a hash. */ interface HashSigner { /** * Signs a hash. * @param {Uint8Array} hash - The hash to sign, must be 32 bytes long. * @returns {Promise} A promise that resolves to the signature. */ signHash(hash: Uint8Array): Promise; /** * Returns the public key of the signer. * @returns {Promise} A promise that resolves to the public key. */ getPublicKey(): Promise; } /** * Class for signing hashes using the secp256k1 algorithm. */ declare class Secp256k1Signer implements HashSigner { private readonly privateKey; private constructor(); /** * Creates an instance of Secp256k1Signer from a private key. * @param {Uint8Array} privateKey - The private key. * @returns {Secp256k1Signer} The created Secp256k1Signer instance. */ static from(privatekey: Uint8Array): Secp256k1Signer; /** * Returns the public key of the signer. * @returns {Promise} A promise that resolves to the public key. */ getPublicKey(): Promise; /** * Signs a hash. * @param {Uint8Array} hash - The hash to sign, must be 32 bytes long. * @returns {Promise} A promise that resolves to the signature. */ signHash(hash: Uint8Array): Promise; } /** * Class for signing hashes using the ed25519 algorithm. */ declare class Ed25519Signer implements HashSigner { private readonly privateKey; private constructor(); /** * Creates an instance of Ed25519Signer from a private key. * @param {Uint8Array} privateKey - The private key. * @returns {Ed25519Signer} The created Ed25519Signer instance. */ static from(privateKey: Uint8Array): Ed25519Signer; /** * Signs a hash. * @param {Uint8Array} hash - The hash to sign, must be 32 bytes long. * @returns {Promise} A promise that resolves to the signature. */ signHash(hash: Uint8Array): Promise; /** * Returns the public key of the signer. * @returns {Promise} A promise that resolves to the public key. */ getPublicKey(): Promise; } /** * Encodes a string or Uint8Array to a base58 string. * * @param {string | Uint8Array} value - The value to encode. * @returns {string} The base58 encoded string. */ declare function encode$2(value: string | Uint8Array): string; /** * Decodes a base58 string to a Uint8Array. * * @param {string} value - The base58 string to decode. * @returns {Uint8Array} The decoded Uint8Array. */ declare function decode$2(value: string): Uint8Array; declare namespace base58 { export { decode$2 as decode, encode$2 as encode }; } /** * Encodes a string or Uint8Array to a base58check string. * * @param {string | Uint8Array} value - The value to encode. * @returns {string} The base58check encoded string. */ declare function encode$1(value: string | Uint8Array): string; /** * Decodes a base58check string to a Uint8Array. * * @param {string} value - The base58check string to decode. * @returns {Uint8Array} The decoded Uint8Array. */ declare function decode$1(value: string): Uint8Array; declare namespace base58check { export { decode$1 as decode, encode$1 as encode }; } /** * Encodes a string or Uint8Array to a base64 string. * * @param {string | Uint8Array} value - The value to encode. * @returns {string} The base64 encoded string. */ declare function encode(value: string | Uint8Array): string; /** * Decodes a base64 string to a Uint8Array. * * @param {string} value - The base64 string to decode. * @returns {Uint8Array} The decoded Uint8Array. */ declare function decode(value: string): Uint8Array; declare const base64_decode: typeof decode; declare const base64_encode: typeof encode; declare namespace base64 { export { base64_decode as decode, base64_encode as encode }; } interface Address$7 { raw(): Uint8Array; hr(): string; hex(): Hex; } declare const Address$6: { from: (address: string | Uint8Array, chain: _layerzerolabs_lz_definitions.Chain) => Address$7; }; type Address$6 = Address$7; /** * Represents an EVM address. * @see {@link AddressInterface} */ declare class Address$5 implements Address$6 { /** * The raw address data. */ private data; /** * Creates an instance of Address. * @param {Uint8Array | string} value - The address value. * @throws {Error} If the address is invalid. */ constructor(value: Uint8Array | string); /** * Creates an Address instance from a value. * @param {Uint8Array | string} value - The address value. * @returns {Address} The Address instance. */ static from(value: Uint8Array | string): Address$5; /** * Inspects the address. * @returns {string} The address as a string. */ inspect(): string; /** * Converts the address to a string. * @returns {string} The address as a string. */ toString(): string; /** * Gets the raw address data. * @returns {Uint8Array} The raw address data. */ raw(): Uint8Array; /** * Gets the human-readable address. * @returns {string} The human-readable address. */ hr(): string; /** * Gets the address as a hexadecimal string. * @returns {Hex} The address as a hexadecimal string. */ hex(): Hex; } /** * Converts an address to its checksum format. * @param {string} address - The address to convert. * @returns {string} The checksummed address. */ declare function toChecksumAddress(address: string): string; declare const evm_toChecksumAddress: typeof toChecksumAddress; declare namespace evm { export { Address$5 as Address, evm_toChecksumAddress as toChecksumAddress }; } /** * Represents an Initia address. * @see {@link AddressInterface} */ declare class Address$4 implements Address$6 { /** * The raw address data. */ private data; /** * Creates an instance of Address. * @param {Uint8Array | string} value - The address value. * @throws {Error} If the address is invalid. */ constructor(value: Uint8Array | string); /** * Creates an Address instance from a value. * @param {Uint8Array | string} value - The address value. * @returns {Address} The Address instance. */ static from(value: Uint8Array | string): Address$4; /** * Inspects the address. * @returns {string} The address as a string. */ inspect(): string; /** * Converts the address to a string. * @returns {string} The address as a string. */ toString(): string; /** * Gets the raw address data. * @returns {Uint8Array} The raw address data. */ raw(): Uint8Array; /** * Gets the human-readable address. * @returns {string} The human-readable address. */ hr(): string; /** * Gets the address as a hexadecimal string. * @returns {Hex} The address as a hexadecimal string. */ hex(): Hex; private checkPrefixAndLength; /** * Checks if a string is a valid Initia account address. * @param data string to check */ private validateInitiaAddress; /** * Converts a hex address into an account address * @param hexAddress hex address */ private fromHex; } declare namespace initia { export { Address$4 as Address }; } /** * Represents an Aptos address. * @see {@link AddressInterface} */ declare class Address$3 implements Address$6 { /** * The raw address data. */ private data; /** * Creates an instance of Address. * @param {Uint8Array | string} value - The address value. * @throws {Error} If the address is invalid. */ constructor(value: Uint8Array | string); /** * Creates an Address instance from a value. * @param {Uint8Array | string} value - The address value. * @returns {Address} The Address instance. */ static from(value: Uint8Array | string): Address$3; /** * Inspects the address. * @returns {string} The address as a string. */ inspect(): string; /** * Converts the address to a string. * @returns {string} The address as a string. */ toString(): string; /** * Gets the raw address data. * @returns {Uint8Array} The raw address data. */ raw(): Uint8Array; /** * Gets the human-readable address. * @returns {string} The human-readable address. */ hr(): string; /** * Gets the address as a hexadecimal string. * @returns {Hex} The address as a hexadecimal string. */ hex(): Hex; } declare namespace move { export { Address$3 as Address }; } /** * Represents a Solana address. * @see {@link AddressInterface} */ declare class Address$2 implements Address$6 { /** * The raw address data. */ private data; /** * Creates an instance of Address. * @param {Uint8Array | string} value - The address value. * @throws {Error} If the address is invalid. */ constructor(value: Uint8Array | string); /** * Creates an Address instance from a value. * @param {Uint8Array | string} value - The address value. * @returns {Address} The Address instance. */ static from(value: Uint8Array | string): Address$2; /** * Inspects the address. * @returns {string} The address as a string. */ inspect(): string; /** * Converts the address to a string. * @returns {string} The address as a string. */ toString(): string; /** * Gets the raw address data. * @returns {Uint8Array} The raw address data. */ raw(): Uint8Array; /** * Gets the human-readable address. * @returns {string} The human-readable address. */ hr(): string; /** * Gets the address as a hexadecimal string. * @returns {Hex} The address as a hexadecimal string. */ hex(): Hex; } declare namespace solana { export { Address$2 as Address }; } /** * Represents a Ton address. * @see {@link AddressInterface} */ declare class Address$1 implements Address$6 { private workchain; /** * The raw address data. */ private data; private testOnly; private bounceable; /** * Creates an instance of Address. * @param {Uint8Array | string} value - The address value. * @throws {Error} If the address is invalid. */ constructor(value: Uint8Array | string); /** * Creates an Address instance from a value. * @param {Uint8Array | string} value - The address value. * @returns {Address} The Address instance. */ static from(value: Uint8Array | string): Address$1; /** * Inspects the address. * @returns {string} The address as a string. */ inspect(): string; /** * Converts the address to a string. * @returns {string} The address as a string. */ toString(): string; /** * Gets the raw address data. * @returns {Uint8Array} The raw address data. */ raw(): Uint8Array; /** * Gets the human-readable address. * @returns {string} The human-readable address. */ hr(): string; /** * Gets the address as a hexadecimal string. * @returns {Hex} The address as a hexadecimal string. */ hex(): Hex; private isFriendly; private isRaw; private parseRaw; private parseFriendlyAddress; private crc16; private toStringBuffer; } declare namespace ton { export { Address$1 as Address }; } /** * Represents a Tron address. * @see {@link AddressInterface} */ declare class Address implements Address$6 { /** * The raw address data. */ private data; /** * Creates an instance of Address. * @param {Uint8Array | string} value - The address value. * @throws {Error} If the address is invalid. */ constructor(value: Uint8Array | string); /** * Creates an Address instance from a value. * @param {Uint8Array | string} value - The address value. * @returns {Address} The Address instance. */ static from(value: Uint8Array | string): Address; /** * Inspects the address. * @returns {string} The address as a string. */ inspect(): string; /** * Converts the address to a string. * @returns {string} The address as a string. */ toString(): string; /** * Gets the raw address data. * @returns {Uint8Array} The raw address data. */ raw(): Uint8Array; /** * Gets the human-readable address. * @returns {string} The human-readable address. */ hr(): string; /** * Gets the address as a hexadecimal string. * @returns {Hex} The address as a hexadecimal string. */ hex(): Hex; } type tron_Address = Address; declare const tron_Address: typeof Address; declare namespace tron { export { tron_Address as Address }; } export { Address$6 as Address, Ed25519Signer, type HashSigner, type KeyPair, Secp256k1Signer, SignAlgorithm, base58, base58check, base64, blake2b, ed25519, evm, initia, keccak_256, move, secp256k1, sha2_256, sha3_256, signHash, solana, ton, tron };