import BN from 'bn.js'; import { Decimal } from 'decimal.js'; import { MessageTypes, TypedMessage } from '@metamask/eth-sig-util'; import { CoinType } from '../constant'; export declare function sleep(ms: number): Promise; /** * Check if string is HEX, requires a 0x in front * * @method isHexStrict * @param {String} hex to be checked * @returns {Boolean} */ export declare function isHexStrict(hex: string | number): boolean; /** * Takes an input and transforms it into an BN * * @method toBN * @param {Number|String|BN} number, string, HEX string or BN * @return {BN} BN */ export declare function toBN(number: number | string): BN; /** * Converts value to it's number representation * * @method hexToNumber * @param {String|Number|BN} value * @return {String} */ export declare function hexToNumber(value: string | number): string | number; /** * Convert a hexadecimal chainId to decimal * @param chainId */ export declare function chainIdHexToNumber(chainId: string | number): number; /** * Converts to a checksum address * * @method toChecksumAddress * @param {String} address the given HEX address * @return {String} */ export declare function toChecksumAddress(address: string): string; /** * Should be called to get hex representation (prefixed by 0x) of utf8 string * * @method utf8ToHex * @param {String} str * @returns {String} hex representation of input string */ export declare function utf8ToHex(str: string): string; /** * Converts value to it's hex representation * * @method numberToHex * @param {String|Number|BN} value * @return {String} */ export declare function numberToHex(value: number | string): string; /** * Converts value to it's decimal representation in string * @param value The value to convert * @returns The decimal representation of the given value */ export declare function toDecimal(value: string | number): Decimal; /** * get mmJson hash and chainId hex * @param typedData * @param chainId */ export declare function mmJsonHashAndChainIdHex(typedData: TypedMessage, chainId: number): string; export declare function convertTpUTXOSignature(base64SignData: string): string; export declare function isDogecoinChain(coinType: CoinType): boolean; /** * String reduction * @param inputString * @param head * @param tail * @param tokenStr */ export declare function collapseString(inputString?: string, head?: number, tail?: number, tokenStr?: string): string; /** * open link in different ways depending on the device. * @param link */ export declare function smartOpen(link: string): void; /** * Copy data to the clipboard * @param text * @param el */ export declare function copyText(text: string, el?: Element): Promise; /** * This function checks if the basic WebAuthn API is supported by the current browser. * It does so by checking if the 'credentials' property exists on the 'navigator' object * and if the 'PublicKeyCredential' property exists on the 'window' object. * * @returns {boolean} Returns true if the basic WebAuthn API is supported, false otherwise. */ export declare function checkWebAuthnSupport(): Promise; /** * Determine if the device supports syncing Passkey with iCloud storage. * * @returns {boolean} Returns true if the device supports syncing Passkey with iCloud storage, false otherwise. */ export declare function checkICloudPasskeySupport(): Promise; /** * get the shadow root of the wallet-bridge element */ export declare function getShadowDomRoot(): ShadowRoot; export declare function isMetaMask(ethereum?: (typeof window)['ethereum']): boolean; export declare function shouldUseWalletConnect(): boolean; export declare function getWalletDeepLink(walletName: string, displayUri: string): string; export declare function openDeepLink(deepLink: string): void; /** * load script * @param src * @param id */ export declare function loadScript(src: string, id: string): Promise;