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

dyce

v1.0.1

Published

The official JavaScript library for the Dyce API

Readme

DyceAPI JavaScript API Library

This library provides convenient access to the Dyce API from JavaScript.

Overview

This project aims to revolutionize the way users pay for online services by introducing a cryptocurrency pay-as-you-go pricing model. Many existing subscription models, including tiered subscriptions, can be costly for users who don't fully utilize the service. Our API addresses this issue by leveraging stablecoin technology to enable direct, flexible payments based on actual usage.

Installation

npm install dyce

Dashboard API Documentation

Requests will be sent to AWS API Gateway where they will be handled by serverless lambda functions. This gateway will require the use of an API key which can be acquired by registering for one in the Dyce Dashboard. All requests require an x-api-key header:

{ "x-api-key": string }

Payments Endpoints

get-wallet-address

  • Description: Retrieves the address for a specified wallet.
  • Method: GET
  • Response:

On success:

200 OK
{ "address": string }

On failure:

404 Not Found
{ "message": "API key required/not found" }
401 Unauthorized
{ "message": "No wallet set for API key" }

approve-spending

  • Description: Approves spending from a specified wallet. Used for pay-as-you-go transactions.
  • Method: POST
  • Request Body:
    { "userId": string, "wallet": string- wallet address, "amount": number }
  • Response:

On success:

200 OK
{ "message": "Spending approved" }

On failure:

400 Bad Request
{ "message": "User ID, wallet address, and approve amount required" }
401 Unauthorized
{ "message": "Invalid API key" }

request-payment

  • Description: Requests a payment to a specified address. Regular transaction endpoint.
  • Method: POST
  • Request Body:
    { "userId": string, "amount": number }
  • Response:

On success:

200 OK
{ "message": "Processed payment successfully" }

On failure:

400 Bad Request
{ "message": "User ID and payment amount required/No spending approved/Insufficient spending limit" }
401 Unauthorized
{ "message": "API key required/Invalid" }
404 Not Found
{ "message": "No wallet set for API key" }

/api/permit-spending

  • Description: Submits a signed EIP-2612 permit for a user, allowing spending without requiring a MetaMask popup. Useful for enabling pay-as-you-go transactions programmatically.

  • Method: POST

  • Request Body:

{
  "userId": "string",
  "permit": {
    // EIP-2612 typed data
  },
  "contractAddress": "string"
}
  • Response: On success:
200 OK
{
  "message": "Permit submitted successfully"
}

On failure:

400 Bad Request
{
  "message": "User ID, permit, and contract address required"
}
401 Unauthorized
{
  "message": "API key required/Invalid"
}
404 Not Found
{
  "message": "No wallet set for API key"
}

/api/receive-payment

  • Description: Submits a signed permit to collect payment from a user’s wallet. This completes a pay-as-you-go transaction on-chain using EIP-2612-compatible tokens.

  • Method: POST

  • Request Body:

{
  "permit": {
    // EIP-2612 typed data
  },
  "contractAddress": "string"
}
  • Response: On success:
200 OK
{
  "message": "Payment received successfully"
}

On failure:

400 Bad Request
{
  "message": "Permit and contract address required"
}
401 Unauthorized
{
  "message": "API key required/Invalid"
}
404 Not Found
{
  "message": "No wallet set for API key"
}

Usage Example

import Dyce from "dyce"

const dyce = new Dyce(process.env['DYCE_API_KEY']);

const userId = "user_123"
const amount = 10

// Get payment from user wallet (with approval)
const success = dyce.transferTokens(amount);
if (success) console.log("Executed payment!");
else console.error("Failed to execute payment!");

// Approve amount to be taken from user's wallet
const success = dyce.approveSpending(userId, amount);
if (success) console.log("Approved spending!");
else console.error("Failed to approve spending!");

// Get payment from user wallet (without approval)
const success = dyce.requestPayment(userId, amount);
if (success) console.log("Executed payment!");
else console.error("Failed to execute payment!");