import { RpcMethod } from './commonTypes'; export type ReferralPartnerService_Get = RpcMethod; export type ReferralPartnerService_Create = RpcMethod; export type ReferralPartnerService_GetWithdrawalsHistory = RpcMethod; export type ReferralPartnerService_GetTotalStatistics = RpcMethod; export type ReferralPartnerService_UpdateWithdrawalInfo = RpcMethod; export type ReferralPartnerService_CreateWithdrawal = RpcMethod; export type ReferralPartnerService_GetWithdrawalAdditionalInfo = RpcMethod; export type ReferralPartnerService_GetCurrencies = RpcMethod; export interface ReferralPartnerService { /** Returns the referral-partner profile of the current account: referral hash, saved withdrawal info and status (active/blocked). Returns an empty profile when the account has not joined the program yet — call create_referral_partner first. */ Get: ReferralPartnerService_Get; /** Enrolls the current account into the referral-partner program and generates its referral hash. Use once to opt an account in; get_referral_partner then returns the created profile. */ Create: ReferralPartnerService_Create; /** Lists the current account's referral-payout withdrawals, each with date, amount, payout info and status (created/in-process/success/error). Use to show the partner's withdrawal history. */ GetWithdrawalsHistory: ReferralPartnerService_GetWithdrawalsHistory; /** Returns the current account's referral earnings totals: expected, available and total revenues plus the count of referred members. Use for the referral-program dashboard summary. */ GetTotalStatistics: ReferralPartnerService_GetTotalStatistics; /** Overwrites the current account's saved withdrawal (payout) details. Use before create_referral_withdrawal so payouts have destination info; replaces the previous value. */ UpdateWithdrawalInfo: ReferralPartnerService_UpdateWithdrawalInfo; /** Requests a payout of the given amount from the account's available referral balance. Use to withdraw earned referral revenue; each call creates a new withdrawal, so do not retry blindly. */ CreateWithdrawal: ReferralPartnerService_CreateWithdrawal; /** Computes a withdrawal quote for an amount and target currency: total fee, source and target amounts and optionally a payout form. Use to preview fees and conversion before create_referral_withdrawal. */ GetWithdrawalAdditionalInfo: ReferralPartnerService_GetWithdrawalAdditionalInfo; /** Lists the currencies available for referral withdrawals, with code, display name and whether decimals are supported. Use to populate the withdrawal currency selector. */ GetCurrencies: ReferralPartnerService_GetCurrencies; } export type GetRequest = {}; export type GetResponse_Status = 'UNKNOWN' | 'ACTIVE' | 'BLOCKED'; export type GetResponse = { referralHash: string; withdrawalInfo: string; status: GetResponse_Status; }; export type CreateRequest = {}; export type CreateResponse = {}; export type GetWithdrawalsHistoryRequest = {}; export type GetWithdrawalsHistoryResponse_Status = 'UNKNOWN' | 'CREATED' | 'IN_PROCESS' | 'SUCCESS' | 'ERROR'; export type GetWithdrawalsHistoryResponse_Withdrawal = { date: Date; status: GetWithdrawalsHistoryResponse_Status; /** create withdrawal structure */ withdrawalInfo: string; amount: number; }; export type GetWithdrawalsHistoryResponse = { withdrawals: GetWithdrawalsHistoryResponse_Withdrawal[]; }; export type GetTotalStatisticsRequest = {}; export type GetTotalStatisticsResponse = { expectedRevenues: number; availableRevenues: number; totalRevenues: number; membersCount: number; }; export type UpdateWithdrawalInfoRequest = { /** Payout destination details (e.g. bank or PayPal info) saved on the partner profile. */ withdrawalInfo?: string; }; export type UpdateWithdrawalInfoResponse = {}; export type CreateWithdrawalRequest = { /** Amount to withdraw from the available referral balance. */ amount?: number; }; export type CreateWithdrawalResponse = {}; export type GetWithdrawalAdditionalInfoRequest = { /** Withdrawal amount to quote fees and conversion for. */ amount?: number; /** Target payout currency code (see list_referral_currencies). */ currency?: string; /** When true, also returns a prefilled payout form in the response. */ withForm?: boolean; }; export type GetWithdrawalAdditionalInfoResponse = { totalFee: number; sourceAmount: number; targetAmount: number; targetCurrency: string; form: string; }; export type GetCurrenciesRequest = {}; export type GetCurrenciesResponse_Currency = { code: string; name: string; supportsDecimals: boolean; }; export type GetCurrenciesResponse = { currencies: GetCurrenciesResponse_Currency[]; };