import { ChainData } from "@0xsquid/squid-types";
import { ICountry } from "countries-list";
import { Token } from "../tokens";
export type OnRampTransactionStatusType = "awaiting_payment" | "processing" | "completed" | "failed";
export type PaymentMethodType = "credit_card" | "bank_transfer";
export type OnRampProviderType = "revolut" | "onramper";
export type ExecuteFiatQuoteResult = {
    redirectUrl: string | unknown;
    orderId: string;
};
export type ExecuteFiatQuoteResultClient = ExecuteFiatQuoteResult & {
    executeQuoteRequest: ExecuteQuoteClient;
    toChain: ChainData | undefined;
};
export type OnRampQuoteResponse = {
    fiatCurrency: string;
    cryptoCurrencyID: string;
    amount: number;
    fees?: {
        fixed?: number;
        percentage?: number;
    };
    cryptoAmount: number;
};
export type OnRampQuoteParams = {
    fiatCurrency: string;
    cryptoCurrencyID: string;
    amount: number | string;
    paymentMethod?: string;
    region?: string;
};
export type OnRampTransactionStatus = {
    transactionId: string;
    transactionHash?: string;
    status: OnRampTransactionStatusType;
    createdAt: string;
    updatedAt: string;
    errorMessage?: string | null;
};
export type ExecuteQuoteServer = {
    orderId: string;
    fiatCurrency: string;
    cryptoCurrencyID: string;
    amount: number;
    walletAddress: string;
    paymentMethod: PaymentMethodType;
    region?: string;
    onrampProviderId: string;
};
export type ExecuteQuoteClient = Omit<ExecuteQuoteServer, "paymentMethod"> & {
    cryptoAmount: number;
    squidToken?: {
        address: string;
        chainId: string;
    };
    providerId: string;
    paymentMethod: PaymentMethodType | string;
};
export type FiatCurrency = {
    denomination: string;
    minLimit?: number;
    maxLimit?: number;
};
export type FiatCurrencyEnhanced = FiatCurrency & {
    symbol: string;
    name?: string;
    flagUrl?: string;
    countryCode?: string;
};
export type OnRampCryptoAsset = {
    tokenSymbol: string;
    blockchain: string;
    smartContractAddress?: string;
};
export type TokenWithOnRampID = Token & {
    cryptoCurrencyID: string;
};
export type CountryWithCode = ICountry & {
    code: string;
    flagUrl?: string;
};
export type FiatToCryptoConfig = {
    supportedPaymentMethods: string[];
    supportedTokens: TokenWithOnRampID[];
    supportedCurrencies: FiatCurrencyEnhanced[];
    supportedCountries: CountryWithCode[];
};
export type OnrampPaymentMethodType = "credit_card" | "bank_transfer" | "apple_pay" | "google_pay" | "revolut";
export interface OnrampPaymentMethodLimits {
    min: number;
    max: number;
}
export interface OnrampPaymentMethodDetails {
    currencyStatus: string;
    limits: {
        [provider: string]: OnrampPaymentMethodLimits;
        aggregatedLimit: OnrampPaymentMethodLimits;
    };
}
export interface OnrampPaymentMethod {
    id: string;
    name: string;
    icon?: string;
    isRecommended?: boolean;
    details?: OnrampPaymentMethodDetails;
}
export type OnrampPaymentMethodRecommendation = "BestPrice" | "Fastest" | "LowestFee";
export interface OnrampQuoteResult {
    internalProviderId: string;
    onrampProviderId: string;
    providerName: string;
    providerIcon?: string;
    recommendations?: OnrampPaymentMethodRecommendation[] | string[];
    rate: number;
    networkFee: number;
    serviceFee: number;
    totalFee: number;
    receivedAmount: number;
    paymentMethods: OnrampPaymentMethod[];
    quoteId?: string;
}
export interface OnrampQuoteResponse {
    quotes: OnrampQuoteResult[];
    recommendedQuote?: {
        internalProviderId: string;
        onrampProviderId: string;
        reason?: string;
    };
}
export interface OnrampConfigResponse {
    id: string;
    name: string;
    icon?: string;
    supportedFiats: string[];
    supportedCryptos: {
        id: string;
        address: string;
        chainId: string;
    }[];
    supportedCountries: string[];
    supportedPaymentMethods?: string[];
    supportedOnramps?: {
        id: string;
        name: string;
        icon?: string;
    }[];
    limits?: {
        [key: string]: {
            min: number;
            max: number;
        };
    };
}
