import { Logger } from './logger';
import { BigNumber, Contract, Wallet } from 'ethers';
import { NonceManager } from '@ethersproject/experimental';
import { NetworkConfig } from '../config/types';
import { CustomJsonRpcProvider, Rpc } from '../rpc/rpc.service';
import { Prometheus } from '../prometheus';
import { Config } from '../config/config';
import { Transmitter } from '../transmitter/transmitter.service';
import { NetworkIdT3rn } from '../pricer/types';
import { AssetNumber } from '../pricer/enums';
import { OrderLifecycleEventSuccess } from '../transmitter/types';
import { SqsDetails } from '../guardian/types';
import { EscrowOrderType } from '../escrow-order/types';
/**
 * Sleep for a given number of seconds.
 *
 * @param {number}  seconds seconds to sleep for
 * @param {string=} reason reason for sleeping
 */
export declare function sleep(seconds: number, reason?: string): Promise<void>;
/**
 * Sleep for a random number of seconds, between the given min and max.
 *
 * @param {number}  minSeconds Minimum seconds to sleep for
 * @param {number}  maxSeconds Maximum seconds to sleep for
 * @param {string=} reason reason for sleeping
 */
export declare function sleepRandom(minSeconds: number, maxSeconds: number, reason?: string): Promise<void>;
/**
 * Generate a random number between two given numbers.
 * By default, the result is fixed to 2 digits after the decimal point.
 *
 * @param {number}  min
 * @param {number}  max
 * @param {number=} precision
 * @returns {number}
 */
export declare function randBetween(min: number, max: number, precision?: number): number;
/**
 * Removes the leading 24 chars (12 bytes) from an address, making it an Ethereum address.
 *
 * @param {string} address
 * @return {string}
 */
export declare function removeLeadingZeroes(address: string): string;
export declare function addLeadingZeroes(address: string): string;
/**
 * Decodes network from hex to network ID name.
 * E.g. 0x6f707374 --> opsp
 *
 * @param {string}  encodedNetworkId
 * @returns {NetworkIdT3rn}
 */
export declare function decodeNetworkId(encodedNetworkId: string): NetworkIdT3rn;
export declare function decodeAsset(assetDecoded: number, destination: NetworkIdT3rn): {
    assetNative: boolean;
    assetDecoded: number;
    assetAddress: string;
};
/**
 * Encodes network ID name to hex.
 * E.g. opsp --> 0x6f707374
 *
 * @param {NetworkIdT3rn}  decodedNetworkId
 * @returns {string}
 */
export declare function encodeNetworkId(decodedNetworkId: NetworkIdT3rn): string;
export declare function parseAssetFromHex(asset: number): number;
export declare function parseAssetToHex(asset: number): number;
/**
 * The error message used in the racePromiseWithTimeout() function.
 *
 * We need this to be declared like this, so we can reuse it in
 * conditional and validation checks in other parts of the code.
 */
export declare const PromiseTimeoutErrorMsg = "Timeout";
/**
 * Returns a promise that resolves or rejects based on the first settled promise
 * between the provided promise and a timeout.
 *
 * @template T The type of the resolved value of the input promise.
 * @param {Promise<T>} promise The promise to race against.
 * @param {number} timeoutSec  The timeout duration in seconds.
 * @returns {Promise<T>} A promise that settles based on the first settled promise
 * (either the input promise or the timeout).
 * @throws {Error} - Throws an error with the message 'Timeout' if the timeout is reached.
 */
export declare function racePromiseWithTimeout<T>(promise: Promise<T>, timeoutSec: number): Promise<T>;
export declare const isRemoteL3: (networkId: string, config: Config) => boolean;
export declare const isL3: (networkId: string) => boolean;
export declare const isNonNativeEth: (networkId: string) => boolean;
export declare const isBNB: (networkId: string) => boolean;
export declare const isMonad: (networkId: string) => boolean;
export declare const isSEI: (networkId: string) => boolean;
export declare const isArbitrum: (networkId: string) => boolean;
export declare const isCelestia: (networkId: string) => boolean;
export declare const isExoticBridgeNetworkId: (networkId: string) => boolean;
export declare const isRemoteL3Supported: (config: Config) => boolean;
export declare function initRemoteAttestationsBooks(config: Config, nonceManager: Record<string, NonceManager> | null, wallet?: Wallet): [Contract, Contract];
/**
 * We initialize the L3 network separately and before any other networks,
 * since it will have only one instance of each (rpc, wallet, contracts) and be constant.
 */
export declare function initL3Network(rpc: Rpc, configL3: NetworkConfig, config: Config, prometheus: Prometheus, sqsDetails?: SqsDetails, appName?: string): Promise<{
    provider: CustomJsonRpcProvider;
    wallet: Wallet;
    nonceManager: NonceManager;
    orderBookContract: Contract;
    escrowOrderBookContract: Contract;
    biddingBookContract: Contract;
    attestersPortalContract: Contract;
    segmentBookContract: Contract;
    singleAttestationBookContract: Contract;
    attestationBatchMakerContract: Contract;
    attestationBatchMakerContractV1: Contract;
    attestationBatchMakerContractV2: Contract;
    attestationBatchMakerContractV3: Contract;
    singleAttestationBookContractV1: Contract;
    singleAttestationBookContractV2: Contract;
    singleAttestationBookContractV3: Contract;
    confirmationBookContract: Contract;
    BRNRewardsContract: Contract;
    BRNBalanceGetterContract: Contract;
    payloadGetterContract: Contract;
    bonusesL3: Contract;
    transmitter: Transmitter;
    insurance: BigNumber;
    supportRevertCommitments: boolean;
}>;
/**
 * Waits for all transmitters to complete processing their queues and dry out.
 * This is used during gracefully shutting down services.
 *
 * @param transmittersMap
 * @param config
 */
export declare function waitTransmitterFinishProcessing(transmittersMap: Map<string, Transmitter>, config: Config): Promise<void>;
export declare function setInfiniteAllowanceOnAssetForAddress(networkId: NetworkIdT3rn, assetId: AssetNumber, wallet: Wallet, targetAddress: string, rpcProvider: CustomJsonRpcProvider, childLogger: Logger): Promise<boolean>;
export declare function shouldTrackLifecycleEvent(event: keyof typeof OrderLifecycleEventSuccess): boolean;
export declare function restoreBigNumbers(data: any): any;
export declare function generateOrderId(networkId: NetworkIdT3rn, addr: string, nonce: number): string;
/**
 * This function crafts the calldata to be passed for escrow calls
 * @param orderType - The type of order
 * @param data - The encoded order details in bytes
 * @returns the encoded orderDetails
 */
export declare function createOrderDetails(orderType: EscrowOrderType, data: string): string;
/**
 * This function encodes the ERC20 order details
 * @param tokenToReceive - The address of the token to receive
 * @param minAmount - The minimum amount of tokens to receive
 * @param destinationAccount - The address of the destination account
 * @returns the encoded ERC20 order details
 */
export declare function encodeERC20Order(tokenToReceive: string, minAmount: BigNumber, destinationAccount: string): string;
/**
 * This function encodes the ERC721 mint order details
 * @param nftAddress - The address of the NFT contract
 * @param mintQuantity - The quantity of NFTs to mint
 * @param destinationAccount - The address of the destination account
 * @returns the encoded ERC721 mint order details
 */
export declare function encodeERC721MintOrder(nftAddress: string, mintQuantity: BigNumber, destinationAccount: string): string;
export declare function fetchEnvVarOrThrow(name: string): string;
export declare function generateIdFull(requester: string, nonce: number, networkId: string): string;
//# sourceMappingURL=helpers.d.ts.map