type BlindpayApiResponse<T> = BlindpayErrorResponse | BlindpaySuccessResponse<T>

type ErrorResponse = {
    message: string;
}

type BlindpayErrorResponse = {
    data: null
    error: ErrorResponse;
}

type BlindpaySuccessResponse<T> = {
    data: T;
    error: null;
}

type CurrencyType = "sender" | "receiver";

type Network = "base" | "sepolia" | "arbitrum_sepolia" | "base_sepolia" | "arbitrum" | "polygon" | "polygon_amoy" | "ethereum" | "stellar" | "stellar_testnet" | "tron"

type StablecoinToken = "USDC" | "USDT" | "USDB"  

type TransactionDocumentType = "invoice" | "purchase_order" | "delivery_slip" | "contract" | "customs_declaration" | "bill_of_lading" | "others";

type BankAccountType = "checking" | "savings";

type Currency = "USDC" | "USDT" | "USDB" | "BRL" | "USD" | "MXN" | "COP" | "ARS";

type Rail = "wire" | "ach" | "pix" | "spei_bitso" | "transfers_bitso" | "ach_cop_bitso" | "international_swift" | "rtp";
    
type AccountClass = "individual" | "business";
    
type TransactionStatus = "refunded" | "processing" | "completed" | "failed" | "on_hold";

type Country = 
        | "AF"
        | "AL"
        | "DZ"
        | "AS"
        | "AD"
        | "AO"
        | "AI"
        | "AQ"
        | "AG"
        | "AR"
        | "AM"
        | "AW"
        | "AU"
        | "AT"
        | "AZ"
        | "BS"
        | "BH"
        | "BD"
        | "BB"
        | "BY"
        | "BE"
        | "BZ"
        | "BJ"
        | "BM"
        | "BT"
        | "BO"
        | "BQ"
        | "BA"
        | "BW"
        | "BV"
        | "BR"
        | "IO"
        | "BN"
        | "BG"
        | "BF"
        | "BI"
        | "CV"
        | "KH"
        | "CM"
        | "CA"
        | "KY"
        | "CF"
        | "TD"
        | "CL"
        | "CN"
        | "CX"
        | "CC"
        | "CO"
        | "KM"
        | "CD"
        | "CG"
        | "CK"
        | "CR"
        | "HR"
        | "CU"
        | "CW"
        | "CY"
        | "CZ"
        | "CI"
        | "DK"
        | "DJ"
        | "DM"
        | "DO"
        | "EC"
        | "EG"
        | "SV"
        | "GQ"
        | "ER"
        | "EE"
        | "SZ"
        | "ET"
        | "FK"
        | "FO"
        | "FJ"
        | "FI"
        | "FR"
        | "GF"
        | "PF"
        | "TF"
        | "GA"
        | "GM"
        | "GE"
        | "DE"
        | "GH"
        | "GI"
        | "GR"
        | "GL"
        | "GD"
        | "GP"
        | "GU"
        | "GT"
        | "GG"
        | "GN"
        | "GW"
        | "GY"
        | "HT"
        | "HM"
        | "VA"
        | "HN"
        | "HK"
        | "HU"
        | "IS"
        | "IN"
        | "ID"
        | "IR"
        | "IQ"
        | "IE"
        | "IM"
        | "IL"
        | "IT"
        | "JM"
        | "JP"
        | "JE"
        | "JO"
        | "KZ"
        | "KE"
        | "KI"
        | "KP"
        | "KR"
        | "KW"
        | "KG"
        | "LA"
        | "LV"
        | "LB"
        | "LS"
        | "LR"
        | "LY"
        | "LI"
        | "LT"
        | "LU"
        | "MO"
        | "MG"
        | "MW"
        | "MY"
        | "MV"
        | "ML"
        | "MT"
        | "MH"
        | "MQ"
        | "MR"
        | "MU"
        | "YT"
        | "MX"
        | "FM"
        | "MD"
        | "MC"
        | "MN"
        | "ME"
        | "MS"
        | "MA"
        | "MZ"
        | "MM"
        | "NA"
        | "NR"
        | "NP"
        | "NL"
        | "NC"
        | "NZ"
        | "NI"
        | "NE"
        | "NG"
        | "NU"
        | "NF"
        | "MP"
        | "NO"
        | "OM"
        | "PK"
        | "PW"
        | "PS"
        | "PA"
        | "PG"
        | "PY"
        | "PE"
        | "PH"
        | "PN"
        | "PL"
        | "PT"
        | "PR"
        | "QA"
        | "MK"
        | "RO"
        | "RU"
        | "RW"
        | "RE"
        | "BL"
        | "SH"
        | "KN"
        | "LC"
        | "MF"
        | "PM"
        | "VC"
        | "WS"
        | "SM"
        | "ST"
        | "SA"
        | "SN"
        | "RS"
        | "SC"
        | "SL"
        | "SG"
        | "SX"
        | "SK"
        | "SI"
        | "SB"
        | "SO"
        | "ZA"
        | "GS"
        | "SS"
        | "ES"
        | "LK"
        | "SD"
        | "SR"
        | "SJ"
        | "SE"
        | "CH"
        | "SY"
        | "TW"
        | "TJ"
        | "TZ"
        | "TH"
        | "TL"
        | "TG"
        | "TK"
        | "TO"
        | "TT"
        | "TN"
        | "TR"
        | "TM"
        | "TC"
        | "TV"
        | "UG"
        | "UA"
        | "AE"
        | "GB"
        | "UM"
        | "US"
        | "UY"
        | "UZ"
        | "VU"
        | "VE"
        | "VN"
        | "VG"
        | "VI"
        | "WF"
        | "EH"
        | "YE"
        | "ZM"
        | "ZW"
        | "AX";

type PaginationParams = {
    limit?: '10' | '50' | '100' | '200' | '1000';
    offset?: '0' | '10' | '50' | '100' | '200' | '1000';
    starting_after?: string;
    ending_before?: string;
}

type PaginationMetadata = {
    has_more: boolean;
    next_page: number;
    prev_page: number;
}

type TrackingTransaction = {
    step: string;
    status: string;
    transaction_hash: string;
    completed_at: string;
};

type TrackingPayment = {
    step: string;
    provider_name: string;
    provider_transaction_id: string;
    provider_status: string;
    estimated_time_of_arrival: string;
    completed_at: string;
};

type TrackingLiquidity = {
    step: string;
    provider_transaction_id: string;
    provider_status: string;
    estimated_time_of_arrival: string;
    completed_at: string;
};

type TrackingComplete = {
    step: string;
    status: string;
    transaction_hash: string;
    completed_at: string;
};

type TrackingPartnerFee = {
    step: string;
    transaction_hash: string;
    completed_at: string;
};

/**
 *
 * Internal API client interface that resources use to make HTTP requests.
 * This interface is not exposed to SDK users.
 */
interface InternalApiClient {
    get: <T>(path: string) => Promise<BlindpayApiResponse<T>>;
    post: <T>(path: string, body: Record<string, unknown>) => Promise<BlindpayApiResponse<T>>;
    put: <T>(path: string, body: Record<string, unknown>) => Promise<BlindpayApiResponse<T>>;
    patch: <T>(path: string, body: Record<string, unknown>) => Promise<BlindpayApiResponse<T>>;
    delete: <T>(path: string, body?: Record<string, unknown>) => Promise<BlindpayApiResponse<T>>;
}

export type { AccountClass as A, BlindpayApiResponse as B, Country as C, InternalApiClient as I, Network as N, PaginationParams as P, Rail as R, StablecoinToken as S, TransactionStatus as T, BankAccountType as a, TrackingTransaction as b, TrackingPayment as c, TrackingComplete as d, TrackingPartnerFee as e, PaginationMetadata as f, CurrencyType as g, Currency as h, TrackingLiquidity as i, TransactionDocumentType as j };
