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

arcpaykit

v0.3.0

Published

Official ArcPay JavaScript SDK for accepting stablecoin payments

Readme

arcpaykit

Official ArcPay JavaScript/TypeScript SDK for accepting stablecoin payments.

npm version License: MIT

Installation

npm install arcpaykit

Quick Start

Get started in 5 minutes:

import { ArcPay } from "arcpaykit";

const arcpay = new ArcPay("your-api-key");

// Verify API connectivity
const ping = await arcpay.ping();
console.log(ping.status); // "ok"

// Create a payment (happy path - recommended)
const payment = await arcpay.payments.create({
  amount: "100.00",
  currency: "USDC",
  description: "Payment for order #123",
  customerEmail: "[email protected]"
});

// Redirect customer to checkout
console.log(payment.checkout_url); // https://arcpay.systems/checkout/pay_...

// That's it! ArcPay handles:
// - Merchant wallet (uses your default)
// - Test/live mode (inferred from API key)
// - Payment chain (inferred automatically)
// - Settlement currency (defaults to USDC)

No need to configure:

  • ❌ Merchant wallet (uses your default)
  • ❌ Test/live mode (inferred from API key: sk_arc_test_ vs sk_arc_live_)
  • ❌ Payment chain ID (inferred automatically)
  • ❌ Settlement currency (defaults to USDC)

For advanced use cases, see payments.createAdvanced() below.

API Reference

ArcPay

Main SDK class.

Constructor

new ArcPay(apiKey: string, baseUrl?: string)
  • apiKey: Your ArcPay API key
  • baseUrl: Optional base URL (defaults to https://arcpay.systems)

ping()

Verify API connectivity.

const result = await arcpay.ping();
// { status: "ok", timestamp: "2024-01-02T10:00:00.000Z" }

Payments

create(data: SimpleCreatePaymentRequest): Promise<CreatePaymentResponse>

Create a new payment (happy path - recommended for most users).

Most users should use this method. It only requires essential fields. All advanced fields are inferred automatically.

Request:

{
  amount: string;              // Required: Payment amount (e.g., "100.00")
  currency?: string;          // Optional: Payment currency (default: "USDC")
  description?: string;       // Optional: Payment description
  customerEmail?: string;     // Optional: Customer email
}

Example:

const payment = await arcpay.payments.create({
  amount: "100.00",
  currency: "USDC",
  description: "Order #123",
  customerEmail: "[email protected]"
});

createAdvanced(data: CreatePaymentRequest): Promise<CreatePaymentResponse>

Create a new payment with full control (advanced users only).

Most users should use payments.create() instead. This method allows full control over all payment parameters.

Request:

{
  amount: string;                    // Required: Payment amount
  merchantWallet?: string;            // Optional: Merchant wallet (uses default if not provided)
  currency?: string;                 // Optional: Payment currency (default: "USDC")
  settlementCurrency?: "USDC" | "EURC"; // Optional: Settlement currency (default: "USDC")
  paymentAsset?: string;              // Optional: Specific asset identifier
  paymentChainId?: number;           // Optional: Chain ID for payment
  conversionPath?: string;            // Optional: Conversion path JSON
  estimatedFees?: string;            // Optional: Estimated fees
  description?: string;              // Optional: Payment description
  customerEmail?: string;            // Optional: Customer email
  expiresInMinutes?: number;         // Optional: Expiration time in minutes
  isTest?: boolean;                  // Optional: Test mode flag (inferred from API key if not provided)
  gasSponsored?: boolean;            // Optional: Gas sponsorship preference
}

Response:

{
  id: string;
  status: string;
  checkout_url: string;
  amount: number;
  currency: string;
  merchantWallet: string;
  expiresAt: string;
  createdAt: string;
}

retrieve(id: string): Promise<Payment>

Retrieve a payment by ID.

submitTx(data: ConfirmPaymentRequest): Promise<ConfirmPaymentResponse>

Submit a transaction hash for a payment.

Request:

{
  paymentId: string;        // Required
  txHash: string;           // Required: Transaction hash
  payerWallet: string;      // Required: Payer wallet address
  customerEmail?: string;   // Optional
  customerName?: string;    // Optional
  gasSponsored?: boolean;  // Optional
}

confirm(data: ConfirmPaymentRequest): Promise<ConfirmPaymentResponse>

Confirm a payment (legacy endpoint).

fail(data: FailPaymentRequest): Promise<FailPaymentResponse>

Mark a payment as failed.

Request:

{
  paymentId: string;  // Required
  reason?: string;    // Optional failure reason
}

expire(data: ExpirePaymentRequest): Promise<ExpirePaymentResponse>

Expire a payment.

Request:

{
  paymentId: string;  // Required
}

Examples

Create and Track a Payment

import { ArcPay } from "arcpaykit";

const arcpay = new ArcPay(process.env.ARCPAY_API_KEY!);

// Verify connectivity first
const ping = await arcpay.ping();
if (ping.status !== "ok") {
  throw new Error("Cannot connect to ArcPay API");
}

// Create payment (simple - recommended)
const payment = await arcpay.payments.create({
  amount: "50.00",
  currency: "USDC",
  description: "Monthly subscription",
  customerEmail: "[email protected]"
});

console.log(`Payment created: ${payment.id}`);
console.log(`Checkout URL: ${payment.checkout_url}`);

// Redirect customer
window.location.href = payment.checkout_url;

// Later, check payment status
const status = await arcpay.payments.retrieve(payment.id);
console.log(`Payment status: ${status.status}`);

Advanced Payment Creation

For full control over payment parameters:

const payment = await arcpay.payments.createAdvanced({
  amount: "50.00",
  merchantWallet: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  currency: "USDC",
  settlementCurrency: "EURC",
  paymentAsset: "USDC_BASE",
  paymentChainId: 8453,
  description: "Monthly subscription",
  customerEmail: "[email protected]",
  expiresInMinutes: 30,
  isTest: false,
  gasSponsored: true
});

Using Custom Base URL

const arcpay = new ArcPay(
  "your-api-key",
  "https://staging.arcpay.systems"
);

Error Handling

The SDK throws errors for failed requests:

try {
  const payment = await arcpay.payments.create({...});
} catch (error) {
  console.error("Payment creation failed:", error.message);
}

REST API

The SDK is a thin wrapper around the ArcPay REST API. You can also use the REST API directly if needed. See the ArcPay API documentation for more details.

Support

License

MIT