npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nowpayments-sdk

v1.0.3

Published

A lightweight, fully-typed, and dependency-free SDK for the NOWPayments API.

Readme

NOWPayments SDK

A lightweight, fully-typed, and dependency-free SDK for the NOWPayments API.

Installation

npm install nowpayments-sdk

Usage

First, you need to get your API key from your NOWPayments account.

import { NOWPaymentsClient } from 'nowpayments-sdk';

const client = new NOWPaymentsClient('YOUR_API_KEY');

async function getStatus() {
  try {
    const status = await client.getStatus();
    console.log('API Status:', status);
  } catch (error) {
    console.error('Error fetching status:', error);
  }
}

getStatus();

API Reference

NOWPaymentsClient(apiKey)

Creates a new API client.

  • apiKey (string, required): Your NOWPayments API key.

Main Endpoints

  • getStatus(): Promise<Status>: Get the API status.
  • getCurrencies(): Promise<Currency[]>: Get a list of all supported currencies.
  • getFullCurrencies(): Promise<Currency[]>: Get a list of all supported currencies with extra information.
  • getMerchantCoins(): Promise<string[]>: Get a list of all supported currencies for a merchant.
  • getMinAmount(currencyFrom: string, currencyTo: string): Promise<MinAmount>: Get the minimum payment amount for a specific currency pair.
  • createInvoice(data: CreateInvoiceRequest): Promise<CreateInvoiceResponse>: Create a new invoice.
  • createPayment(data: CreatePaymentRequest): Promise<CreatePaymentResponse>: Create a new payment.
  • getPaymentStatus(paymentId: string): Promise<PaymentStatus>: Get the status of a payment.
  • getEstimate(amount: number, currencyFrom: string, currencyTo: string): Promise<Estimate>: Get an estimated price for a payment.
  • updateMerchantEstimate(paymentId: string): Promise<UpdateMerchantEstimateResponse>: Update the merchant estimate for a payment.

Payouts

  • validateAddress(data: ValidateAddressRequest): Promise<ValidateAddressResponse>: Validate a crypto address.
  • createPayout(data: CreatePayoutRequest): Promise<CreatePayoutResponse>: Create a new payout.
  • verifyPayout(withdrawalId: string, verificationCode: string): Promise<VerifyPayoutResponse>: Verify a payout.
  • getPayout(payoutId: string): Promise<Payout>: Get information about a specific payout.
  • getPayouts(params: GetPayoutsRequest): Promise<GetPayoutsResponse>: Get a list of payouts.

Subscriptions

  • createSubscriptionPlan(data: CreateSubscriptionPlanRequest): Promise<CreateSubscriptionPlanResponse>: Create a new subscription plan.
  • updateSubscriptionPlan(planId: string, data: UpdateSubscriptionPlanRequest): Promise<UpdateSubscriptionPlanResponse>: Update a subscription plan.
  • getSubscriptionPlan(planId: string): Promise<SubscriptionPlan>: Get information about a specific subscription plan.
  • getSubscriptionPlans(params: GetSubscriptionPlansRequest): Promise<GetSubscriptionPlansResponse>: Get a list of subscription plans.
  • createSubscription(data: CreateSubscriptionRequest): Promise<CreateSubscriptionResponse>: Create a new subscription.
  • getSubscriptions(params: GetSubscriptionsRequest): Promise<GetSubscriptionsResponse>: Get a list of subscriptions.
  • getSubscription(subId: string): Promise<Subscription>: Get information about a specific subscription.
  • deleteSubscription(subId: string): Promise<{ result: string }>: Delete a subscription.

Balance

  • getBalance(): Promise<Balance>: Get your account balance.

Sub-partner

  • createSubPartner(data: CreateSubPartnerRequest): Promise<CreateSubPartnerResponse>: Create a new sub-partner.
  • getSubPartnerBalance(id: string): Promise<SubPartnerBalance>: Get the balance of a sub-partner.
  • getSubPartners(params: GetSubPartnersRequest): Promise<GetSubPartnersResponse>: Get a list of sub-partners.
  • getSubPartnerTransfers(params: GetSubPartnerTransfersRequest): Promise<GetSubPartnerTransfersResponse>: Get a list of sub-partner transfers.
  • getSubPartnerTransfer(id: string): Promise<SubPartnerTransfer>: Get information about a specific sub-partner transfer.
  • createSubPartnerTransfer(data: CreateSubPartnerTransferRequest): Promise<CreateSubPartnerTransferResponse>: Create a new sub-partner transfer.
  • createSubPartnerPayment(data: CreateSubPartnerPaymentRequest): Promise<CreateSubPartnerPaymentResponse>: Create a new sub-partner payment.
  • getSubPartnerPayments(params: GetSubPartnerPaymentsRequest): Promise<GetSubPartnerPaymentsResponse>: Get a list of sub-partner payments.
  • createSubPartnerDeposit(data: CreateSubPartnerDepositRequest): Promise<CreateSubPartnerDepositResponse>: Create a new sub-partner deposit.
  • createSubPartnerWriteOff(data: CreateSubPartnerWriteOffRequest): Promise<CreateSubPartnerWriteOffResponse>: Create a new sub-partner write-off.

Fiat Payouts

  • getFiatProviders(): Promise<GetFiatProvidersResponse>: Get a list of fiat payout providers.
  • getFiatCurrencies(): Promise<GetFiatCurrenciesResponse>: Get a list of supported fiat currencies.
  • getCryptoCurrencies(): Promise<GetCryptoCurrenciesResponse>: Get a list of supported crypto currencies for fiat payouts.
  • getPaymentMethods(params: GetPaymentMethodsRequest): Promise<GetPaymentMethodsResponse>: Get a list of payment methods.
  • createFiatAccount(data: CreateFiatAccountRequest): Promise<CreateFiatAccountResponse>: Create a new fiat account.
  • getFiatAccounts(params: GetFiatAccountsRequest): Promise<GetFiatAccountsResponse>: Get a list of fiat accounts.
  • requestFiatPayout(data: RequestFiatPayoutRequest): Promise<RequestFiatPayoutResponse>: Request a new fiat payout.
  • getFiatPayouts(params: GetFiatPayoutsRequest): Promise<GetFiatPayoutsResponse>: Get a list of fiat payouts.

Conversion

  • createConversion(data: CreateConversionRequest): Promise<CreateConversionResponse>: Create a new conversion.
  • getConversion(conversionId: string): Promise<Conversion>: Get information about a specific conversion.
  • getConversions(): Promise<GetConversionsResponse>: Get a list of conversions.

Recurring Payments

  • createRecurringPayment(data: CreateRecurringPaymentRequest): Promise<CreateRecurringPaymentResponse>: Create a new recurring payment.
  • getRecurringPayments(subPartnerId: string): Promise<RecurringPayment[]>: Get a list of recurring payments.
  • deleteRecurringPayment(subscriptionId: string): Promise<{ result: string }>: Delete a recurring payment.

Error Handling

The SDK throws the following custom errors:

  • NOWPaymentsApiError: Base error for all API-related issues.
  • AuthenticationError: For API key-related errors.
  • ValidationError: For invalid request data.
  • NotFoundError: For non-existent resources.

You can handle errors like this:

import { NOWPaymentsClient, NOWPaymentsApiError } from 'nowpayments-sdk';

const client = new NOWPaymentsClient('INVALID_KEY');

async function getStatus() {
  try {
    const status = await client.getStatus();
    console.log('API Status:', status);
  } catch (error) {
    if (error instanceof NOWPaymentsApiError) {
      console.error(`API Error: ${error.name} - ${error.message}`);
    } else {
      console.error('Unknown Error:', error);
    }
  }
}

getStatus();

For more detailed information on request and response payloads, please refer to the src/types.ts file.