import { BytesLike } from '@ethersproject/bytes'; import { ChainMap, ChainName } from './types'; export declare type Address = string; /** * Converts a 20-byte (or other length) ID to a 32-byte ID. * Ensures that a bytes-like is 32 long. left-padding with 0s if not. * * @param data A string or array of bytes to canonize * @returns A Uint8Array of length 32 */ export declare function canonizeId(data: BytesLike): Uint8Array; /** * Converts an Abacus ID of 20 or 32 bytes to the corresponding EVM Address. * * For 32-byte IDs this enforces the EVM convention of using the LAST 20 bytes. * * @param data The data to truncate * @returns A 20-byte, 0x-prepended hex string representing the EVM Address * @throws if the data is not 20 or 32 bytes */ export declare function evmId(data: BytesLike): Address; /** * Sleep async for some time. * * @param ms the number of milliseconds to sleep * @returns A delay promise */ export declare function delay(ms: number): Promise; export declare class MultiGeneric { protected readonly chainMap: ChainMap; constructor(chainMap: ChainMap); protected get(chain: Chain): ChainMap[Chain]; protected set(chain: Chain, value: Value): void; chains: () => Chain[]; apply(fn: (n: Chain, dc: Value) => void): void; map(fn: (n: Chain, dc: Value) => Output): Record; remoteChains: (name: LocalChain) => Exclude[]; extendWithChain: | Exclude<"arbitrum", Chain> | Exclude<"alfajores", Chain> | Exclude<"bsc", Chain> | Exclude<"mumbai", Chain> | Exclude<"kovan", Chain> | Exclude<"goerli", Chain> | Exclude<"fuji", Chain> | Exclude<"celo", Chain> | Exclude<"ethereum", Chain> | Exclude<"avalanche", Chain> | Exclude<"optimism", Chain> | Exclude<"bsctestnet", Chain> | Exclude<"arbitrumrinkeby", Chain> | Exclude<"optimismkovan", Chain> | Exclude<"auroratestnet", Chain> | Exclude<"test1", Chain> | Exclude<"test2", Chain> | Exclude<"test3", Chain>>(chain: New, value: Value) => MultiGeneric; knownChain: (chain: ChainName) => boolean; } export declare function inferChainMap(map: M): M extends ChainMap ? Record : never; export declare function objMapEntries(obj: Record, func: (k: K, _: I) => O): [K, O][]; export declare function objMap(obj: Record, func: (k: K, _: I) => O): Record; export declare const promiseObjAll: (object: { [key in K]: Promise; }) => Promise>; export declare const utils: { objMap: typeof objMap; promiseObjAll: (object: { [key in K]: Promise; }) => Promise>; canonizeId: typeof canonizeId; evmId: typeof evmId; delay: typeof delay; }; //# sourceMappingURL=utils.d.ts.map