import { BigNumber, ethers } from "ethers";
import { Log } from "@ethersproject/abstract-provider";
/** ********************************************************************************************************************
 *
 * CONSTANTS
 *
 ******************************************************************************************************************* **/
export type CCTPMessageStatus = "finalized" | "ready" | "pending";
export declare const CCTPV2_FINALITY_THRESHOLD_STANDARD = 2000;
export declare const CCTPV2_FINALITY_THRESHOLD_FAST = 1000;
/** ********************************************************************************************************************
 *
 * CCTP SMART CONTRACT EVENT TYPES
 *
 ******************************************************************************************************************* **/
type CommonMessageData = {
    cctpVersion: number;
    sourceDomain: number;
    destinationDomain: number;
    sender: string;
    recipient: string;
    messageHash: string;
    messageBytes: string;
    nonce: number;
    nonceHash: string;
};
type DepositForBurnMessageData = CommonMessageData & {
    amount: string;
    mintRecipient: string;
    burnToken: string;
};
type CommonMessageEvent = CommonMessageData & {
    log: Log;
};
type DepositForBurnMessageEvent = DepositForBurnMessageData & {
    log: Log;
};
type CCTPMessageEvent = CommonMessageEvent | DepositForBurnMessageEvent;
type CCTPV2APIAttestation = {
    status: string;
    attestation: string;
    message: string;
    eventNonce: string;
    cctpVersion: number;
    decodedMessage: {
        recipient: string;
        destinationDomain: number;
        decodedMessageBody: {
            amount: string;
            mintRecipient: string;
            messageSender: string;
        };
    };
};
type CCTPV2APIGetAttestationResponse = {
    messages: CCTPV2APIAttestation[];
};
/** ********************************************************************************************************************
 *
 * Exported functions and constants:
 *
 ******************************************************************************************************************* **/
export type AttestedCCTPMessage = CCTPMessageEvent & {
    status: CCTPMessageStatus;
    attestation?: string;
};
export type AttestedCCTPDeposit = DepositForBurnMessageEvent & {
    status: CCTPMessageStatus;
    attestation?: string;
};
/**
 * @notice Converts an ETH Address string to a 32-byte hex string.
 * @param address The address to convert.
 * @returns The 32-byte hex string representation of the address - required for CCTP messages.
 */
export declare function cctpAddressToBytes32(address: string): string;
/**
 * Converts a 32-byte hex string with padding to a standard ETH address.
 * @param bytes32 The 32-byte hex string to convert.
 * @returns The ETH address representation of the 32-byte hex string.
 */
export declare function cctpBytes32ToAddress(bytes32: string): string;
/**
 * @notice Returns the CCTP domain for a given chain ID. Throws if the chain ID is not a CCTP domain.
 * @param chainId
 * @returns CCTP Domain ID
 */
export declare function getCctpDomainForChainId(chainId: number): number;
/**
 * @notice Returns the chain ID for a given CCTP domain. Inverse functionof `getCctpDomainForChainId()`. However,
 * since CCTP Domains are shared between production and test networks, we need to use the `productionNetworks` flag
 * to determine whether to return the production  or test network chain ID.
 * @param domain CCTP domain ID.
 * @param productionNetworks Whether to return the production or test network chain ID.
 * @returns Chain ID.
 */
export declare function getCctpDestinationChainFromDomain(domain: number, productionNetworks: boolean): number;
/**
 * @notice Typeguard. Returns whether the event is a CCTP deposit for burn event. Should work for V1 and V2
 * @param event CCTP message event.
 * @returns True if the event is a CCTP deposit for burn event.
 */
export declare function isDepositForBurnEvent(event: CCTPMessageEvent): event is DepositForBurnMessageEvent;
/**
 * @notice Fetches CCTP V2 attestations for a given list of transaction hashes. If a transaction hash
 * contains multiple CCTP messages, this will return an object where each key is a transaction hash and
 * a value is an array of attestations.
 * @param depositForBurnTxnHashes List of transaction hashes to fetch attestations for.
 * @param sourceChainId Source chain ID of the transaction hashes.
 * @returns Object with transaction hashes as keys and CCTP V2 attestations as values.
 */
export declare function fetchCctpV2Attestations(depositForBurnTxnHashes: string[], sourceChainId: number): Promise<{
    [sourceTxnHash: string]: CCTPV2APIGetAttestationResponse;
}>;
/**
 * @notice Returns the status of a CCTP attestation.
 * @param attestation Attestation to get the status of.
 * @returns "finalized","pending" or "ready".
 */
export declare function getPendingAttestationStatus(attestation: Pick<CCTPV2APIAttestation, "attestation" | "status">): CCTPMessageStatus;
/**
 * @notice Checks if a CCTP message has been processed by a given contract.
 * @param nonceHash Nonce hash to check.
 * @param contract
 * @returns True if the message has been processed, false otherwise.
 */
export declare function hasCCTPMessageBeenProcessedEvm(nonceHash: string, contract: ethers.Contract): Promise<boolean>;
/**
 * @notice The maximum amount of USDC that can be sent using a fast transfer.
 * @param isMainnet Toggles whether to call CCTP API on mainnet or sandbox environment.
 * @returns USDC amount in units of USDC.
 * @link https://developers.circle.com/api-reference/cctp/all/get-fast-burn-usdc-allowance
 */
export declare function getV2FastBurnAllowance(isMainnet: boolean): Promise<string>;
/**
 * Returns the minimum transfer fees required for a transfer to be relayed. When calling depositForBurn(), the maxFee
 * parameter must be greater than or equal to the minimum fee.
 * @param sourceChainId The source chain ID of the transfer.
 * @param destinationChainId The destination chain ID of the transfer.
 * @param isMainnet Toggles whether to call CCTP API on mainnet or sandbox environment.
 * @returns The standard and fast transfer fees for the given source and destination chains.
 * @link https://developers.circle.com/api-reference/cctp/all/get-burn-usdc-fees
 */
export declare function getV2MinTransferFees(sourceChainId: number, destinationChainId: number): Promise<{
    standard: BigNumber;
    fast: BigNumber;
}>;
/**
 * @notice Fetches attestations for a given transaction hash. If transaction hash contains multiple CCTP
 * messages, this will return an array of attestations. Should work for both v1 and v2.
 * @param sourceDomainId
 * @param transactionHash
 * @param isMainnet
 * @returns Attestation response, list of messages with attestations.
 */
export declare function fetchAttestationsForTxn(sourceDomainId: number, transactionHash: string, isMainnet: boolean): Promise<CCTPV2APIGetAttestationResponse>;
/**
 * @notice Returns the CCTP version of the `MessageSent` event.
 * @param log CCTP event log.
 * @returns 0 for v1 `MessageSent` event, 1 for v2, -1 for other events
 */
export declare function getMessageSentVersion(log: ethers.providers.Log): number;
/**
 * @notice Returns the CCTP version of the `DepositForBurn` event.
 * @param log CCTP event log.
 * @returns 0 for v1 `DepositForBurn` event, 1 for v2, -1 for other events
 */
export declare function getDepositForBurnVersion(log: ethers.providers.Log): number;
export {};
//# sourceMappingURL=CCTPUtils.d.ts.map