UNPKG

fivesim-api

Version:

Node.js wrapper for the 5sim.net API - SMS verification service with TypeScript support

94 lines (93 loc) 3.05 kB
import { UserProfile, Order, OrderHistoryResponse, PaymentHistoryResponse, PriceLimit, SMSInboxResponse, VendorProfile, VendorWallets, VendorOrdersResponse, VendorPaymentsResponse, SuccessResponse } from "../interfaces/responses"; import { OrderHistoryOptions, PaginationOptions, BuyNumberOptions, SetPriceLimitParams, DeletePriceLimitParams, PayoutMethod, FeeSystem, Country, Operator } from "../interfaces/types"; export declare class UserService { private readonly client; private static readonly baseURL; constructor(token: string); /** * Wait for order status to become RECEIVED * @private */ private waitForOrderReceived; /** * Find the best operator based on lowest cost and highest count * @private */ private findBestOperator; /** * Get user profile information */ getProfile(): Promise<UserProfile>; /** * Get order history with filtering options */ getOrderHistory(options?: OrderHistoryOptions): Promise<OrderHistoryResponse>; /** * Get payment history with pagination */ getPaymentHistory(options?: PaginationOptions): Promise<PaymentHistoryResponse>; /** * Get list of price limits */ getPriceLimits(): Promise<PriceLimit[]>; /** * Set price limit for a product */ setPriceLimit(params: SetPriceLimitParams): Promise<SuccessResponse>; /** * Delete price limit for a product */ deletePriceLimit(params: DeletePriceLimitParams): Promise<SuccessResponse>; /** * Buy activation number */ buyActivationNumber(country: Country, operator: Operator, product: string, options?: BuyNumberOptions): Promise<Order>; /** * Buy hosting number */ buyHostingNumber(country: Country, operator: Operator, product: string, options?: BuyNumberOptions): Promise<Order>; /** * Reuse a number */ reuseNumber(product: string, number: string): Promise<Order>; /** * Check order status and get SMS messages */ checkOrder(id: number): Promise<Order>; /** * Finish an order */ finishOrder(id: number): Promise<Order>; /** * Cancel an order */ cancelOrder(id: number): Promise<Order>; /** * Ban an order */ banOrder(id: number): Promise<Order>; /** * Get SMS inbox for an order */ getSMSInbox(id: number): Promise<SMSInboxResponse>; /** * Get vendor profile */ getVendorProfile(): Promise<VendorProfile>; /** * Get vendor wallet balances */ getVendorWallets(): Promise<VendorWallets>; /** * Get vendor order history */ getVendorOrders(options?: OrderHistoryOptions): Promise<VendorOrdersResponse>; /** * Get vendor payment history */ getVendorPayments(options?: PaginationOptions): Promise<VendorPaymentsResponse>; /** * Create a payout request */ createPayout(receiver: string, method: PayoutMethod, amount: string, fee: FeeSystem): Promise<SuccessResponse>; }