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

@ilalv3/sdk

v0.2.0

Published

ILAL Protocol SDK — session signing and hookData encoding for Uniswap v4 compliance pools

Downloads

234

Readme

@ilalv3/sdk

ILAL Protocol SDK — session signing and hookData encoding for Uniswap v4 compliance pools.

ILAL gates swaps and liquidity operations behind on-chain compliance credentials (CNF tokens). This SDK handles the off-chain signing step: build a short-lived EIP-712 session token, sign it locally, and encode it into the hookData blob that ComplianceHook verifies on every action.

Install

npm install @ilalv3/sdk viem

Quick start

import { createWalletClient, createPublicClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { baseSepolia } from "viem/chains";
import { signSession, encodeHookData, getCredentialStatus } from "@ilalv3/sdk";

const account = privateKeyToAccount("0x...");
const walletClient = createWalletClient({ account, chain: baseSepolia, transport: http() });
const publicClient = createPublicClient({ chain: baseSepolia, transport: http() });

// 1. Check if the user has a valid compliance credential
const status = await getCredentialStatus(publicClient, CNF_ISSUER, account.address);
if (!status.valid) throw new Error("No valid CNF credential — mint or renew first");

// 2. Sign a 10-minute session token (zero gas, fully local)
const session = await signSession(walletClient, {
  user:             account.address,
  authorizedCaller: ILAL_ROUTER,   // only ILALRouter can submit this session
  cnfIssuer:        CNF_ISSUER,
  poolId:           POOL_ID,
  action:           "swap",
  verifyingHook:    COMPLIANCE_HOOK,
  chainId:          BigInt(baseSepolia.id),
});

// 3. Encode into hookData and pass to ILALRouter.swap()
const hookData = encodeHookData(session);

API

signSession(walletClient, params)Promise<SignedSession>

Signs an EIP-712 SessionToken locally. No on-chain call.

| Param | Type | Description | |---|---|---| | user | Address | Wallet that will trade | | authorizedCaller | Address | Contract allowed to submit the session (use ILALRouter address) | | cnfIssuer | Address | The CNFIssuer contract for this pool | | poolId | Hex | Uniswap v4 pool ID (bytes32) | | action | "swap" \| "addLiquidity" \| "removeLiquidity" | Must match the on-chain action | | verifyingHook | Address | ComplianceHook address | | chainId | bigint | Chain ID | | expiresIn? | number | TTL in seconds (default: 600) |

encodeHookData(session)0x${string}

ABI-encodes a SignedSession into the bytes hookData expected by ComplianceHook.

getCredentialStatus(publicClient, cnfIssuer, wallet)Promise<CredentialStatus>

Reads credential state from the CNFIssuer contract.

interface CredentialStatus {
  exists:    boolean;
  valid:     boolean;   // !revoked && expiresAt > now
  tokenId:   bigint;
  expiresAt: bigint;    // Unix timestamp
  revoked:   boolean;
}

Base Sepolia demo deployment

| Contract | Address | |---|---| | CNFIssuer | 0xB13AE2498Df62A85768a4b783109C05fCf5A264a | | ComplianceHook | 0x6C57b50Ef9286b132066012B19b291FB120ACa80 | | ILALRouter | 0xd0aF4D1EFF36CB2a1E88017eA398dCaDe1Ac0040 |

Pool ID: 0x16b3e7a5c52216925f705673b3ab25db5e6025da530cf53b3bcb5affeb18d95f

License

MIT