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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@wirexapp/wirex-pay-sdk

v1.0.0

Published

Wirex SDK for interacting with the API

Readme

WirexPay SDK

This SDK provides an easy interface to interact with the Wirex Pay API, including features like user management, card operations, transactions, wallet management, and action confirmation. The SDK also supports real-time WebSocket updates for changes such as balance or transaction updates.


Table of Contents


Installation

Install the SDK via npm:

npm install wirex-pay-sdk

Setup and Initialization

To begin using the SDK, import the WirexPay class and initialize it with the necessary configuration options.

Configuration Interface

export interface IConfig {
  token: string;              // API token for authentication (required)
  subscribeToSocket?: boolean; // Enable WebSocket subscription (optional)
  socketUrl?: string;          // WebSocket server URL (optional)
  apiUrl?: string;             // API base URL (optional)
}

Initializing WirexPay SDK

import { WirexPay } from 'wirex-pay-sdk';

const config = {
  token: 'your-user-specific-token',
  subscribeToSocket: true, // Enable real-time updates via WebSocket
};

WirexPay.init(config);

Services

UserService

The UserService provides methods to manage users, such as updating phone numbers, and fetching user information.

Methods:

  • getUserInfo(): Fetch user information.
  • updatePhoneNumber(request: UpdatePhoneNumberRequest): Update phone number.
  • confirmPhoneNumber(request: ConfirmPhoneNumberRequest): Confirm phone number.
  • getVerificationLink(): Get verification link.
  • getUserAccessToken(): Generate an access token.
  • subscribeToUserChange(callback): Subscribe to user change events.

Usage Examples:

Retrieving user info

WirexPay.user.getUserInfo()
  .then(response => console.log('User info:', response))
  .catch(error => console.error('Error:', error));

**Subscribing to User Changes **

WirexPay.user.subscribeToUserChange((userData) => {
  console.log('User data changed:', userData);
});

CardService

The CardService allows you to manage cards, including blocking, unblocking, activating, and setting limits.

Methods:

  • getCards(page: number, size: number): List all cards.
  • createPlasticCard(request: CreatePlasticCardRequest): Issue a new plastic card.
  • activateCard(cardId, request: ActivateCardRequest): Activate a card.
  • blockCard(cardId): Block a card.
  • unblockCard(cardId): Unblock a card.
  • closeCard(cardId): Close a card.
  • setCardLimit(cardId, request: SetCardLimitRequest): Set card spending limit.
  • setActiveBalance(cardId, tokenSymbol): Set active balance for card.
  • getCardCvv(cardId, actionToken): Retrieve card CVV.
  • getCardPin(cardId, actionToken): Retrieve card PIN.
  • subscribeToCardsChange(callback): Subscribe to cards change events.

Usage Examples:

Fetching cards

WirexPay.card.getCards(1, 10)
  .then(response => console.log('Cards list:', response))
  .catch(error => console.error('Error:', error));

Setting Card Spending Limit

WirexPay.card.setCardLimit('card123', { limit: 5000 })
  .then(() => console.log('Limit set successfully'))
  .catch(error => console.error('Error setting limit:', error));

Subscribing to Cards Changes

WirexPay.card.subscribeToCardsChange((userData) => {
  console.log('User data changed:', userData);
});

TransactionService

The TransactionService handles transaction history and real-time updates for card transactions.

Methods:

  • getCardTransactions(page: number, size: number): Fetch card transactions.
  • subscribeToTransactionChanges(callback): Subscribe to transaction change events.

Usage Examples:

Fetching Card Transactions

WirexPay.transaction.getCardTransactions(1, 10)
  .then(response => console.log('Transactions:', response))
  .catch(error => console.error('Error fetching transactions:', error));

Subscribing to Transaction Changes

WirexPay.transaction.subscribeToTransactionChanges((transaction) => {
  console.log('Transaction changed:', transaction);
});

WalletService

The WalletService manages wallet balances and provides real-time updates for balance changes.

Methods:

  • getWallet(): Retrieve wallet information.
  • subscribeToBalanceChanges(callback): Subscribe to balance change events.

Usage Examples:

Fetching wallet information

WirexPay.wallet.getWallet()
  .then(response => console.log('Wallet info:', response))
  .catch(error => console.error('Error fetching transactions:', error));

Subscribing to Wallet Balance Changes

WirexPay.wallet.subscribeToBalanceChanges((wallet) => {
  console.log('Wallet balance changed:', wallet);
});

ActionConfirmationService

The ActionConfirmationService manages SMS confirmations for various user actions.

Methods:

  • createSmsConfirmation(request: CreateSmsConfirmationRequest): Start an SMS confirmation session.
  • completeSmsConfirmation(request: CompleteSmsConfirmationRequest): Verify an OTP code and complete the session.

Usage Examples:

Completing SMS confirmation

WirexPay.actionConfirmation.completeSmsConfirmation({ code: '123456', session_id: 'some-id' })
  .then(response => console.log('SMS confirmation token:', response))
  .catch(error => console.error('Error fetching transactions:', error));