import { NatsContext, RpcException } from '@nestjs/microservices';
import { Observable } from 'rxjs';
import { TakeNTradeRPCError } from './rpc-error';
import { TakeNTradeRPCSuccess } from './rpc-response';
export declare class TakeNTradeRpc {
    /**
     * Wraps a promise returned by an RPC request handler.
     * @param promise - A Promise resolving to the response value.
     * @param ctx - Optional NatsContext object.
     * @param successMessage - Optional success message
     */
    static handleRequest<V>(promise: Promise<V>, ctx?: NatsContext): Promise<TakeNTradeRPCSuccess<V> | RpcException>;
    /**
     * Handles errors from an RPC request handler and returns a TakeNTradeRPCError wrapped in RpcException.
     * @param err - Error to be handled.
     * @param ctx - A NATS Context.
     */
    static handleRequestError(err: unknown, ctx: NatsContext): RpcException;
    private static catch;
    /**
     * Handles NATS request response.
     * @param obs - An instance of an Observable.
     * @param successMessage - Optional success message
     */
    static withReply<V>(obs: Observable<V>, successMessage?: string): Promise<TakeNTradeRPCSuccess<V>>;
}
export declare class TakeNTradeRpcV2 {
    /**
     * Wraps a promise returned by an RPC request handler.
     * @param promise - A Promise resolving to the response value.
     * @param ctx - Optional NatsContext object.
     */
    static handleRequest<V>(promise: Promise<V>, ctx?: NatsContext): Promise<TakeNTradeRPCSuccess<V> | TakeNTradeRPCError>;
    /**
     * Handles errors from an RPC request handler and returns a TakeNTradeRPCError.
     * @param err - Error to be handled.
     * @param ctx - A NATS Context.
     */
    static handleRequestError(err: unknown, ctx: NatsContext): TakeNTradeRPCError;
    private static catch;
    /**
     * Handles NATS request response.
     * @param obs - An instance of an Observable.
     */
    static withReply<V>(obs: Observable<V>): Promise<TakeNTradeRPCSuccess<V>>;
}
