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

@crypto.com/facilitator-client

v1.0.2

Published

Typescript client for the cronos Facilitator API

Downloads

209

Readme

@crypto.com/facilitator-client

Official Cronos X402 Facilitator SDK

The Crypto.com Facilitator SDK provides a lightweight, strongly typed Node.js/TypeScript client for interacting with the Cronos X402 Facilitator API. It allows developers to easily:

  • Generate EIP-3009 signed payment headers
  • Build X402 Payment Requirements
  • Submit payments for verification and settlement
  • Discover supported networks and capabilities

This SDK enables fully automated off-chain authorization / on-chain execution payments on Cronos Mainnet and Cronos Testnet.

npm License

Features

  • Facilitator API Client /verify, /settle, /supported

  • EIP-3009 Header Generator Produces Base64-encoded X402 payment headers

  • Typed X402 Payment Requirements Fully typed and schema-driven

  • Zero unnecessary dependencies Built around ethers and native Node features

  • Cronos-native Supports Cronos Mainnet and Cronos Testnet

Installation

npm install @crypto.com/facilitator-client
# or
yarn add @crypto.com/facilitator-client

Usage

1. Create a Facilitator Client

The Facilitator base URL is fixed internally and cannot be overridden.

import { Facilitator } from '@crypto.com/facilitator-client';
import { CronosNetwork } from '@crypto.com/facilitator-client';

const facilitator = new Facilitator({
  network: CronosNetwork.CronosTestnet, // or CronosMainnet
});

2. Generate Payment Requirements

const requirements = facilitator.generatePaymentRequirements({
  payTo: '0xRecipientAddress',
  description: 'Payment for Order #123',
  maxAmountRequired: '1000000', // base units
});

console.log(requirements);

3. Generate a Base64 Payment Header (EIP-3009)

import { ethers } from 'ethers';

const signer = new ethers.Wallet(process.env.PRIVATE_KEY!, new ethers.JsonRpcProvider('https://evm-t3.cronos.org'));

const header = await facilitator.generatePaymentHeader({
  to: '0xRecipientAddress',
  value: '1000000', // 1 USDCe (6 decimals)
  signer,
  validBefore: Math.floor(Date.now() / 1000) + 600, // 10 min expiry
});

console.log('header:', header);

4. Verify a Payment Request

const body = facilitator.buildVerifyRequest(header, requirements);

const verifyResponse = await facilitator.verifyPayment(body);
console.log('verify:', verifyResponse);

5. Settle a Verified Payment

const settleResponse = await facilitator.settlePayment(body);
console.log('settled:', settleResponse);

6. Discover Supported Networks & Schemes

const capabilities = await facilitator.getSupported();
console.log(capabilities);

End-to-End Example (Full Flow)

const facilitator = new Facilitator({ network: CronosNetwork.CronosTestnet });

const signer = new ethers.Wallet(PRIVATE_KEY, new ethers.JsonRpcProvider('https://evm-t3.cronos.org'));

const header = await facilitator.generatePaymentHeader({
  to: RECEIVER,
  value: '1000000',
  signer,
});

const requirements = facilitator.generatePaymentRequirements({
  payTo: RECEIVER,
  description: 'Premium API access',
  maxAmountRequired: '1000000',
});

const body = facilitator.buildVerifyRequest(header, requirements);

const verify = await facilitator.verifyPayment(body);

if (verify.isValid) {
  const settle = await facilitator.settlePayment(body);
  console.log('Transaction:', settle.txHash);
}

API Overview

Client

| Method | Description | | ------------------------------------------ | ----------------------------------------------------- | | getSupported() | Returns supported networks, schemes, and capabilities | | verifyPayment(request) | Validates the Base64 header + requirements | | settlePayment(request) | Executes the authorized transfer on-chain | | buildVerifyRequest(header, requirements) | Helper to produce valid X402 bodies |

Utilities

| Function | Description | | -------------------------------------- | ---------------------------------------- | | generatePaymentHeader(options) | Creates Base64 EIP-3009 payment header | | generatePaymentRequirements(options) | Produces typed X402 Payment Requirements |

License

MIT © 2025 Crypto.com