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

@moneymq/sdk

v0.9.4

Published

MoneyMQ SDK for accepting stablecoin payments

Readme

@moneymq/sdk

Core SDK for the MoneyMQ payment platform. Accept stablecoin payments with a Stripe-like API.

Installation

npm install @moneymq/sdk
# or
pnpm add @moneymq/sdk
# or
yarn add @moneymq/sdk

Quick Start

import { MoneyMQ } from '@moneymq/sdk';

const moneymq = new MoneyMQ({
  endpoint: 'http://localhost:8488',
});

// Create a product
const product = await moneymq.catalog.create({
  name: 'Pro Plan',
  description: 'Full access to all features',
});

// Create a price
const price = await moneymq.catalog.prices.create({
  product: product.id,
  currency: 'USDC',
  amount: 1000,
  type: 'one_time',
});

// Create a checkout session
const session = await moneymq.payment.checkout.create({
  lineItems: [{ price: price.id, quantity: 1 }],
  successUrl: 'https://example.com/success',
  cancelUrl: 'https://example.com/cancel',
});

Configuration

const moneymq = new MoneyMQ({
  // Required: MoneyMQ API endpoint
  endpoint: 'http://localhost:8488',

  // Optional: Secret key for authenticated requests
  secret: process.env.MONEYMQ_SECRET,

  // Optional: Request timeout in milliseconds (default: 30000)
  timeout: 30000,
});

API Reference

Catalog

Products

// List all products
const { data, hasMore } = await moneymq.catalog.list();

// With filters
const { data, hasMore } = await moneymq.catalog.list({
  active: true,
  limit: 10,
});

// Create a product
const product = await moneymq.catalog.create({
  name: 'Pro Plan',
  description: 'Full access',
  active: true,
  metadata: { tier: 'premium' },
});

// Retrieve a product
const product = await moneymq.catalog.retrieve('prod_123');

// Update a product
const updated = await moneymq.catalog.update('prod_123', {
  name: 'Enterprise Plan',
});

// Delete a product
await moneymq.catalog.delete('prod_123');

Prices

// Create a one-time price
const price = await moneymq.catalog.prices.create({
  product: 'prod_123',
  currency: 'USDC',
  amount: 1000,
  type: 'one_time',
});

// Create a recurring price
const subscription = await moneymq.catalog.prices.create({
  product: 'prod_123',
  currency: 'USDC',
  amount: 9900,
  type: 'recurring',
  recurring: {
    interval: 'month',
    intervalCount: 1,
  },
});

// Retrieve a price
const price = await moneymq.catalog.prices.retrieve('price_123');

// List prices
const { data } = await moneymq.catalog.prices.list({
  product: 'prod_123',
  active: true,
});

Payment

Checkout Sessions

// Create a checkout session
const session = await moneymq.payment.checkout.create({
  lineItems: [
    { price: 'price_123', quantity: 1 },
  ],
  successUrl: 'https://example.com/success?session_id={CHECKOUT_SESSION_ID}',
  cancelUrl: 'https://example.com/cancel',
  customer: 'cus_123', // Optional
  customerEmail: '[email protected]', // Optional
  metadata: { orderId: '12345' },
});

// Retrieve a session
const session = await moneymq.payment.checkout.retrieve('cs_123');

Payment Links

// Create a payment link
const link = await moneymq.payment.links.create({
  lineItems: [{ price: 'price_123', quantity: 1 }],
  expiresAt: new Date('2025-12-31'),
});

// Retrieve a link
const link = await moneymq.payment.links.retrieve('plink_123');

// Deactivate a link
await moneymq.payment.links.deactivate('plink_123');

Customers

// Create a customer
const customer = await moneymq.payment.customers.create({
  email: '[email protected]',
  name: 'John Doe',
  metadata: { userId: '123' },
});

// Retrieve with expanded fields
const customer = await moneymq.payment.customers.retrieve('cus_123', {
  expand: ['payments', 'subscriptions'],
});

// Update a customer
await moneymq.payment.customers.update('cus_123', {
  name: 'Jane Doe',
});

// List customers
const { data } = await moneymq.payment.customers.list({
  email: '[email protected]',
});

Payments

// Retrieve a payment
const payment = await moneymq.payment.retrieve('pay_123');

// List payments
const { data } = await moneymq.payment.list({
  customerId: 'cus_123',
  status: 'completed',
  limit: 20,
});

Payouts

// Create a payout
const payout = await moneymq.payment.payouts.create({
  amount: 100000,
  currency: 'USDC',
  destination: 'wallet_address',
});

// Get payout settings
const settings = await moneymq.payment.payouts.settings.retrieve();

// Update payout settings
await moneymq.payment.payouts.settings.update({
  schedule: 'daily',
  minimumAmount: 10000,
});

Error Handling

import { MoneyMQ, MoneyMQError } from '@moneymq/sdk';

try {
  await moneymq.catalog.retrieve('invalid_id');
} catch (error) {
  if (error instanceof MoneyMQError) {
    console.error('Status:', error.statusCode);
    console.error('Message:', error.message);
    console.error('Raw:', error.raw);
  }
}

TypeScript Support

This package includes full TypeScript definitions. All types are exported:

import type {
  MoneyMQConfig,
  Product,
  ProductCreateParams,
  Price,
  PriceCreateParams,
  CheckoutSession,
  CheckoutCreateParams,
  PaymentLink,
  Customer,
  Payment,
  Payout,
} from '@moneymq/sdk';

License

MIT