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

@wonderland/aztec-fee-payment

v4.2.0

Published

A Fee Payment Contract (FPC) for Aztec that enables private transaction fee sponsorship via FeeJuice.

Readme

Aztec Fee Payment Contracts

A Fee Payment Contract (FPC) for Aztec that enables private transaction fee sponsorship via FeeJuice.

Overview

| Contract | Description | Auth model | |----------|-------------|-----------| | PrivateFPC | Fully private. Users bridge FeeJuice from L1; the bridge claim converts to internal FJ balance for fee sponsorship. | Cryptographic bridge proof (no owner, no agent) |

Project Structure

├── src/
│   ├── artifacts/                   # Generated contract bindings
│   ├── nr/                          # Noir smart contracts
│   │   ├── counter_contract/        # Test utility contract
│   │   └── private_contract/        # PrivateFPC
│   └── ts/                          # TypeScript package
│       ├── fee-payment-methods/     # Fee payment method classes
│       ├── utils/                   # Utilities (gas, deploy)
│       └── test/                    # Integration tests
├── target/                          # Compiled contract artifacts
├── benchmarks/                      # Performance benchmarks
└── docs/                            # Product requirements

Setup

Prerequisites

Installation

yarn install

Compile Contracts

# Full rebuild: compile Noir + generate TS bindings
yarn ccc

# Or step by step
aztec compile
aztec codegen target --outdir src/artifacts

Testing

Start the Aztec sandbox:

aztec start --local-network

Run all tests:

yarn test        # Noir unit tests + JS integration tests
yarn test:nr     # Noir unit tests only
yarn test:js     # JS integration tests only

Deployment

PrivateFPC is a fully private contract — it has no public functions and no constructor. This means no on-chain deployment transaction is required. The contract address is computed deterministically from its class hash and a salt, and users interact with it privately by address.

Compute the address

  1. Copy .env.example to .env and set PRIVATE_FPC_SALT:

    cp .env.example .env
  2. Compile the contracts (required on first run):

    yarn ccc
  3. Run the compute script:

    yarn compute

DANGER: The address is derived from compiled bytecode. A different Aztec version produces different bytecode and a different address. Sending funds to the wrong address means unrecoverable loss. Before using this address, verify the target network runs the same Aztec version as the one shown in the script output:

curl -s -X POST <NODE_URL> -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","method":"node_getNodeInfo","id":1,"params":[]}' \
  | jq .result.nodeVersion

Usage

yarn add @defi-wonderland/aztec-fee-payment

See src/ts/README.md for detailed SDK documentation.

import {
  PrivateFPCContract,
  FPCFeePaymentMethod,
  PrivateMintAndPayFeePaymentMethod,
  registerPrivateContract,
} from '@defi-wonderland/aztec-fee-payment';

// Register the PrivateFPC — no deployment transaction needed (fully private contract)
const fpc = await registerPrivateContract(wallet, salt);

// --- L1: deposit to FeeJuicePortal with a claimer-bound secretHash ---
// secretHash = computeSecretHash(poseidon2([salt, claimerAddress], DOM_SEP))
// FeeJuicePortal.depositToAztecPublic(_to=fpc.address, _amount, secretHash)

// --- L2: two-step flow ---
// Step 1: claim FeeJuice on L2 (emits FeeJuice nullifier)
await feeJuice.methods.claim(fpc.address, amount, secret, leafIndex).send();

// Step 2: mint internal FJ balance by proving the bridge claim
await fpc.methods.mint(amount, salt, leafIndex).send();

// User sponsors a transaction from their internal balance
await myContract.methods.doSomething()
  .send({ fee: { paymentMethod: new FPCFeePaymentMethod(fpc.address) } });

// --- Cold-start: claim + mint + pay fee in one transaction ---
await myContract.methods.doSomething()
  .send({
    fee: {
      paymentMethod: new PrivateMintAndPayFeePaymentMethod(
        fpc.address, amount, secret, salt, leafIndex,
      ),
    },
  });

Benchmarks

yarn benchmark

Benchmarks are defined in Nargo.toml under [benchmark] and run against a live local network. Each contract has its own benchmark file in benchmarks/.

License

MIT