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

paj_ramp

v1.5.1

Published

paj offramp/onramp service

Downloads

411

Readme

PAJ Ramp SDK

A comprehensive SDK for PAJ Ramp onramp and offramp operations with real-time transaction updates using webhooks.

Installation

npm install paj_ramp
yarn add paj_ramp

Getting Started

Initialize SDK (select environment: "staging" | "production")

import { initializeSDK, Environment } from 'paj_ramp';

// Selects the environment you want to work with
initializeSDK(Environment.Production); // or Environment.Staging

Initiate Session

import { initiate } from 'paj_ramp';

// You can get otp by either adding your phone number or email address
// Phone number must start with a country code
const initiated = await initiate(
  '[email protected]' // +2349053231563
  'business_api_key'
  );
// Response: { email?: string, phone?: string}

Verify Session

import { verify } from 'paj_ramp';

// You can get otp by either adding your phone number or email address
// Phone number must start with a country code
const verified = await verify(
  '[email protected]', // or +2349053231563
  'otp',
  {
    uuid: string,
    device: string,
    //optionL ↓↓↓↓↓
    os: string, //IOS
    browser: string, //chrome
    ip: string,
  },
  'business_api_key'
);
/* Response: {
email?: string,
phone?: string,
isActive: string,
expiresAt: string,
token: string 
} */

📚 Examples

Check out our examples directory for complete, runnable examples:

  • Basic Onramp - Simple onramp transaction flow showing how users can buy crypto with fiat
  • Basic Offramp - Simple offramp transaction flow showing how users can sell crypto for fiat
  • Webhook Integration - Express server with webhook handling for real-time order updates

Each example includes its own README with detailed setup instructions. Perfect for understanding how to integrate PAJ Ramp into your application!

cd examples/basic-onramp
npm install
cp .env.example .env
# Edit .env with your credentials
npm start

Utility Endpoints

Handle Rate:

Get All Rate

import { getAllRate } from 'paj_ramp';

const rate = await getAllRate();
/*
Response:
{
    "onRampRate": {
        "baseCurrency": "USD",
        "targetCurrency": "NGN",
        "isActive": true,
        "rate": 1510,
        "type": "onRamp"
    },
    "offRampRate": {
        "baseCurrency": "USD",
        "targetCurrency": "NGN",
        "isActive": true,
        "rate": 1525,
        "type": "offRamp"
    }
}*/

Get Rate by Amount

import { getRateByAmount } from 'paj_ramp';

const rate = await getRateByAmount(50000);
/*
Response:
{
 rate: {
  baseCurrency: string,
  targetCurrency: string,
  rate: number
  },
 amounts: {
  userTax": number,
  merchantTax": number,
  amountUSD": number,
  userAmountFiat": number
  }
}*/

Get Rate by Rate Type

import { getRateByType, RateType } from 'paj_ramp';

const rate = await getRateByType(RateType.offRamp); // or RateType.onRamp

/*
Response:
"offRampRate": {
  "baseCurrency": "USD",
  "targetCurrency": "NGN",
  "isActive": true,
  "rate": 1525,
  "type": "offRamp"
}*/

Get Token Value from Amount and Mint Token

import { getTokenValue } from 'paj_ramp';

const tokenValue = await getTokenValue(50000, 'token_mint_address');
/*
Response:
{
  amount: number,        // requested token amount
  usdcValue: number,     // USDC value of the token amount
  mint: string           // token mint address
}
*/

Handle Banks:

Get Banks

import { getBanks } from 'paj_ramp';

const banks = await getBanks('token');
// Response: [ { id: string, name: string, country: string } ]

Resolve Bank Account

import { resolveBankAccount } from 'paj_ramp';

const resolvedBankAccount = await resolveBankAccount(
  'token',
  'bank_id',
  'account_number'
);
// Response: { accountName: string, accountNumber: string, bank: { id: string, name: string, code: string, country: string } }

Add Bank Account

import { addBankAccount } from 'paj_ramp';

const addedBankAccount = await addBankAccount(
  'token',
  'bank_id',
  'account_number'
);
// Response: { id: string, accountName: string, accountNumber: string, bank: string }

Get Bank Accounts

import { getBankAccounts } from 'paj_ramp';

const accounts = await getBankAccounts('token');
// Response: [ { id: string, accountName: string, accountNumber: string, bank: string } ]

Transaction History:

Get All Transactions

import { getAllTransactions } from 'paj_ramp';

const transactions = await getAllTransactions('token_from_verification');
/* Response: [{
id: string;
address: string;
mint: string;
currency: Currency;
amount: number;
usdcAmount: number;
fiatAmount: number;
sender: string;
receipient: string;
rate: number;
status: TransactionStatus;
transactionType: TransactionType;
createdAt: string | Date;
}]*/

Get Transaction

import { getTransaction } from 'paj_ramp';

const transactions = await getTransaction(
  'token_from_verification',
  'transaction_id'
);
/* Response: {
id: string;
address: string;
mint: string;
currency: Currency;
amount: number;
usdcAmount: number;
fiatAmount: number;
sender: string;
receipint: string;
rate: number;
status: TransactionStatus;
transactionType: TransactionType;
createdAt: string | Date;
}*/

Offramp Webhook (Direct Offramp)

Usage Example

import { createOfframpOrder, Currency } from 'paj_ramp';

const createOrder = await createOfframpOrder(
  {
    bank: 'bank_id',
    accountNumber: 'account_number',
    currency: 'NGN' as Currency, // Currency
    amount: 10000, // amount
    mint: 'token_mint_address',
    webhookURL: 'webhook_url', // https://your-domain.com/webhook
  },
  'token'
);
/* Response: {
id: string,
address: string,
mint: string,
currency: Currency,
amount: number,
fiatAmount: number,
sender: string,
rate: number,
status: TransactionStatus,
transactionType: TransactionType
createdAt: string
}*/

Onramp Webhook: Creates a new onramp order and sends status to the webhook url.

Usage Example

import { createOrder, Currency } from 'paj_ramp';

const order = await createOrder(
  {
    fiatAmount: 10000,
    currency: 'NGN' as Currency,
    recipient: 'wallet_address_here',
    mint: 'token_mint_address_here',
    chain: 'SOLANA', //ethereum, polygon, etc
    webhookURL: 'your_webhook_url', // https://your-domain.com/webhook
  },
  'token_from_verification'
);
// Response: { id: string, accountNumber: string, accountName: string, fiatAmount: number, bank: string }

Webhook Response Data Structure

For both onramp and offramp

{
  id: string;
  address: string;
  signature?: string;
  mint: string;
  currency: Currency; // eg. NGN, USD
  amount: number;
  usdcAmount: number;
  fiatAmount: number;
  sender: string;
  receipient: string;
  rate: number;
  status: TransactionStatus; // eg. INIT, PAID, COMPLETED
  transactionType: TransactionType; // ON_RAMP or OFF_RAMP
}

Other types

import {
  // Chain, // SOLANA, etc
  TransactionStatus, // INIT, etc
  TransactionType, // ON_RAMP, etc
  Currency, // NGN
  Environment,
  RateType,
} from 'paj_ramp';

License

MIT

🧑‍💻 Author

Gospel Chidiebube Chukwu