UNPKG

nodejs-cryptomus

Version:

A comprehensive Node.js client for the Cryptomus API

49 lines (43 loc) 1.57 kB
import { CryptomusClient } from './client'; import { PaymentService } from './services/payment'; import { PayoutService } from './services/payout'; import { WebhookService } from './services/webhook'; import { BalanceService } from './services/balance'; import { CurrencyService } from './services/currency'; import { CryptomusOptions } from './types'; /** * Cryptomus API client */ export class Cryptomus { /** Payment service */ public readonly payment: PaymentService; /** Payout service */ public readonly payout: PayoutService; /** Payment webhook service */ public readonly paymentWebhook: WebhookService; /** Payout webhook service */ public readonly payoutWebhook: WebhookService; /** Balance service */ public readonly balance: BalanceService; /** Currency service */ public readonly currency: CurrencyService; private readonly client: CryptomusClient; /** * Create a new Cryptomus API client * * @param options - Configuration options */ constructor(options: CryptomusOptions) { this.client = new CryptomusClient(options); this.payment = new PaymentService(this.client); this.payout = new PayoutService(this.client); this.paymentWebhook = new WebhookService(options.paymentKey); this.payoutWebhook = new WebhookService(options.payoutKey || ''); this.balance = new BalanceService(this.client); this.currency = new CurrencyService(this.client); } } // Export all types and functions export * from './types'; export * from './utils/signature'; export * from './utils/helpers';