import { Input, Output, Protocol, Token } from '../../../../types/index';
import { Address } from 'viem';

export type BungeeQuote = {
    originChainId: number;
    destinationChainId: number;
    userAddress: string;
    receiverAddress: string;
    input: Input;
    destinationExec: string | null;
    autoRoute: AutoRoute;
    gasFee: string | null;
    txData: TxData | null;
    routeDetails: {
        name: string;
        logoURI: string;
        routeFee: string | null;
    };
    manualRoutes: ManualRoute[];
};
type AutoRoute = {
    userOp: "sign" | "tx";
    output: {
        token: Token;
        priceInUsd: number;
        valueInUsd: number;
        minAmountOut: string;
        amount: string;
    };
    requestType: RequestType;
    requestHash: string;
    approvalData: string | null;
    slippage: number;
    signTypedData: SignTypedData;
    refuel: AutoRefuel;
    txData: TxData | null;
    quoteId: string;
    rewards?: Rewards;
    estimatedTime: number;
    gasFee?: GasFee;
};
type ManualRoute = {
    routeId: string;
    output: {
        token: Token;
        amount: string;
        priceInUsd: number;
        valueInUsd: number;
        minAmountOut: string;
        effectiveReceivedInUsd: number;
    };
    affiliateFee: string | null;
    approvalData: {
        spenderAddress: string;
        amount: string;
        tokenAddress: string;
    };
    gasFee: GasFee;
    slippage: number | null;
    estimatedTime: number;
    routeDetails: Protocol;
    refuel: ManualRefuel;
};
export type GasFee = {
    gasToken: Token;
    gasLimit: string;
    gasPrice: string;
    estimatedFee: string;
    feeInUsd: number;
};
export type AutoRefuel = {
    output: RefuelEndpoint;
};
export type ManualRefuel = {
    input: RefuelEndpoint;
    output: RefuelEndpoint;
};
export type RefuelEndpoint = {
    token: Token;
    amount: string;
};
type BaseFormattedQuote = {
    routingMode: "auto" | "manual";
    receiver: string;
    sender: string;
    input: Input[];
    output: Output[];
    primaryInput: Input;
    primaryOutput: Output;
    estimatedFulfilTime: number;
    isSwapRoute: boolean;
    srcToDestRate?: number;
    destToSrcRate?: number;
    slippage?: number | null;
    minOutput?: {
        amount: string;
        formattedAmount: string;
        valueInUsd?: number;
    };
    approvalData?: ApprovalData;
    refuel?: AutoRefuel | ManualRefuel;
};
export type FormattedAutoQuote = BaseFormattedQuote & {
    routingMode: "auto";
    requestHash: string;
    requestType: RequestType;
    signTypedData: SignTypedData;
    txData: TxData | null;
    userOp: "sign" | "tx";
    quoteId: string;
    rewards?: Rewards;
    refuel?: AutoRefuel;
    gasFee?: GasFee;
};
export type FormattedManualQuote = BaseFormattedQuote & {
    routingMode: "manual";
    protocol: Protocol;
    totalGasFeesInUsd: number;
    routeId: string;
    receivedValueInUsd: number;
    refuel: ManualRefuel;
    gasFee: GasFee;
};
export type FormattedQuoteResponse = FormattedAutoQuote | FormattedManualQuote;
export type RequestType = "SWAP_REQUEST" | "SINGLE_OUTPUT_REQUEST";
export type TxData = {
    data: Address;
    to: Address;
    value: bigint;
};
export interface ApprovalData {
    amount: string;
    spenderAddress: string;
    tokenAddress: string;
}
export interface SignTypedData {
    domain: {
        name: string;
        chainId: number;
        verifyingContract: Address;
    };
    types: {
        PermitWitnessTransferFrom: Array<{
            name: string;
            type: string;
        }>;
        TokenPermissions: Array<{
            name: string;
            type: string;
        }>;
        Request: Array<{
            name: string;
            type: string;
        }>;
        BasicRequest: Array<{
            name: string;
            type: string;
        }>;
    };
    values: {
        permitted: {
            token: Address;
            amount: string;
        };
        spender: Address;
        nonce: string;
        deadline: string;
        witness: {
            basicReq: {
                originChainId: number;
                destinationChainId: number;
                deadline: string;
                nonce: string;
                sender: Address;
                receiver: Address;
                delegate: Address;
                bungeeGateway: Address;
                switchboardId: number;
                inputToken: Address;
                inputAmount: string;
                outputToken: Address;
                minOutputAmount: string;
                refuelAmount: string;
            };
            swapOutputToken: Address;
            minSwapOutput: string;
            metadata: Address;
            affiliateFees: Address;
            minDestGas: string;
            destinationPayload: Address;
            exclusiveTransmitter: Address;
        };
    };
}
export type Rewards = {
    rebateAmount: string;
    rewardAmount: string;
    totalRewardAmount: string;
    totalRewardAmountInUsd: number;
    token: Token;
    isRewardEnabled?: boolean;
};
export {};
