// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.11.4 // protoc v7.34.0 // source: withdrawal.proto /* eslint-disable */ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; import { Observable } from "rxjs"; export const protobufPackage = "withdrawal.v1"; export interface CreateWithdrawalRequest { userId: string; network: string; asset: string; amount: string; toAddress: string; idempotencyKey?: string | undefined; } export interface GetWithdrawalRequest { userId: string; withdrawRequestId: string; } export interface ListWithdrawalsRequest { userId?: string | undefined; status?: string | undefined; network?: string | undefined; from?: string | undefined; to?: string | undefined; take?: number | undefined; } export interface ListWithdrawalsResponse { items: Withdrawal[]; } export interface GetMonthlyWithdrawalLimitRequest { userId: string; } export interface GetWithdrawalLimitsRequest { userId: string; /** Для `min_withdrawal_amount` по выбранной паре; по умолчанию USDT + TRON. */ asset?: | string | undefined; /** "TRON" | "BSC" — enum ChainNetwork */ network?: string | undefined; } export interface GetPayoutPricingRequest { } export interface GetPayoutPricingResponse { rows: PayoutConfigRow[]; } export interface WithdrawalLimits { userId: string; minWithdrawalAmount: string; dailyLimit: string; monthlyLimit: string; dailyUsed: string; dailyRemaining: string; monthlyUsed: string; monthlyRemaining: string; kycTier: string; isCustomLimit: boolean; dayStartUtc: string; dayEndExclusiveUtc: string; monthStartUtc: string; monthEndExclusiveUtc: string; payoutConfigRows: PayoutConfigRow[]; } export interface PayoutConfigRow { asset: string; network: string; minOnChain: string; serviceFee: string; networkFee: string; } export interface AdminUpsertPayoutConfigRequest { adminApiKey: string; asset: string; network: string; minOnChain: string; serviceFee: string; networkFee: string; /** true по умолчанию */ isActive: boolean; } export interface ListPayoutConfigsRequest { adminApiKey: string; } export interface ListPayoutConfigsResponse { rows: PayoutConfigRow[]; } export interface MonthlyWithdrawalLimit { userId: string; monthlyLimitUsdt: string; minWithdrawalUsdt: string; usedThisMonthUsdt: string; remainingThisMonthUsdt: string; monthStartUtc: string; monthEndExclusiveUtc: string; dailyLimitUsdt?: string | undefined; usedThisDayUsdt?: string | undefined; remainingThisDayUsdt?: string | undefined; dayStartUtc?: string | undefined; dayEndExclusiveUtc?: string | undefined; kycTier?: string | undefined; isCustomLimit?: boolean | undefined; } export interface AdminSetMonthlyWithdrawalLimitRequest { adminApiKey: string; userId: string; monthlyLimitUsdt: string; } export interface AdminSetMonthlyWithdrawalLimitResponse { userId: string; monthlyLimitUsdt: string; } export interface AdminSetUserWithdrawalLimitsRequest { adminApiKey: string; userId: string; customDailyLimitUsdt?: string | undefined; customMonthlyLimitUsdt?: string | undefined; clearCustomLimits: boolean; } export interface AdminSetUserWithdrawalLimitsResponse { userId: string; customDailyLimitUsdt?: string | undefined; customMonthlyLimitUsdt?: string | undefined; } export interface AdminRejectWithdrawalRequest { adminApiKey: string; withdrawRequestId: string; } export interface Withdrawal { withdrawRequestId: string; userId: string; network: string; asset: string; amount: string; toAddress: string; status: string; serviceFee: string; networkFee: string; createdAt: string; transactionId?: string | undefined; referenceId?: string | undefined; custodyTxId?: string | undefined; txHash?: string | undefined; amlScore?: number | undefined; amlReason?: string | undefined; amlDecision?: string | undefined; errorCode?: string | undefined; errorMessage?: string | undefined; finalizedAt?: string | undefined; refundedAt?: | string | undefined; /** Счётчик списания: on-chain (amount) + service_fee + network_fee. */ grossDebit?: string | undefined; } export const WITHDRAWAL_V1_PACKAGE_NAME = "withdrawal.v1"; export interface WithdrawalServiceClient { createWithdrawal(request: CreateWithdrawalRequest): Observable; getWithdrawal(request: GetWithdrawalRequest): Observable; listWithdrawals(request: ListWithdrawalsRequest): Observable; getMonthlyWithdrawalLimit(request: GetMonthlyWithdrawalLimitRequest): Observable; getWithdrawalLimits(request: GetWithdrawalLimitsRequest): Observable; /** Один ответ для фронта: мин. on-chain сумма + комиссии по каждой паре asset/network (без user-лимитов). */ getPayoutPricing(request: GetPayoutPricingRequest): Observable; adminSetMonthlyWithdrawalLimit( request: AdminSetMonthlyWithdrawalLimitRequest, ): Observable; adminSetUserWithdrawalLimits( request: AdminSetUserWithdrawalLimitsRequest, ): Observable; adminRejectWithdrawal(request: AdminRejectWithdrawalRequest): Observable; adminUpsertPayoutConfig(request: AdminUpsertPayoutConfigRequest): Observable; listPayoutConfigs(request: ListPayoutConfigsRequest): Observable; } export interface WithdrawalServiceController { createWithdrawal(request: CreateWithdrawalRequest): Promise | Observable | Withdrawal; getWithdrawal(request: GetWithdrawalRequest): Promise | Observable | Withdrawal; listWithdrawals( request: ListWithdrawalsRequest, ): Promise | Observable | ListWithdrawalsResponse; getMonthlyWithdrawalLimit( request: GetMonthlyWithdrawalLimitRequest, ): Promise | Observable | MonthlyWithdrawalLimit; getWithdrawalLimits( request: GetWithdrawalLimitsRequest, ): Promise | Observable | WithdrawalLimits; /** Один ответ для фронта: мин. on-chain сумма + комиссии по каждой паре asset/network (без user-лимитов). */ getPayoutPricing( request: GetPayoutPricingRequest, ): Promise | Observable | GetPayoutPricingResponse; adminSetMonthlyWithdrawalLimit( request: AdminSetMonthlyWithdrawalLimitRequest, ): | Promise | Observable | AdminSetMonthlyWithdrawalLimitResponse; adminSetUserWithdrawalLimits( request: AdminSetUserWithdrawalLimitsRequest, ): | Promise | Observable | AdminSetUserWithdrawalLimitsResponse; adminRejectWithdrawal( request: AdminRejectWithdrawalRequest, ): Promise | Observable | Withdrawal; adminUpsertPayoutConfig( request: AdminUpsertPayoutConfigRequest, ): Promise | Observable | PayoutConfigRow; listPayoutConfigs( request: ListPayoutConfigsRequest, ): Promise | Observable | ListPayoutConfigsResponse; } export function WithdrawalServiceControllerMethods() { return function (constructor: Function) { const grpcMethods: string[] = [ "createWithdrawal", "getWithdrawal", "listWithdrawals", "getMonthlyWithdrawalLimit", "getWithdrawalLimits", "getPayoutPricing", "adminSetMonthlyWithdrawalLimit", "adminSetUserWithdrawalLimits", "adminRejectWithdrawal", "adminUpsertPayoutConfig", "listPayoutConfigs", ]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); GrpcMethod("WithdrawalService", method)(constructor.prototype[method], method, descriptor); } const grpcStreamMethods: string[] = []; for (const method of grpcStreamMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); GrpcStreamMethod("WithdrawalService", method)(constructor.prototype[method], method, descriptor); } }; } export const WITHDRAWAL_SERVICE_NAME = "WithdrawalService";