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

@wzrd_sol/sdk

v0.1.2

Published

TypeScript SDK for the WZRD Liquid Attention Protocol — deposit, settle, claim on Solana

Readme

@wzrd_sol/sdk

TypeScript SDK for the Liquid Attention Protocol on Solana.

Builds deposit_market, settle_market, and claim_global transaction instructions that wallets sign directly — no server signing needed.

Install

npm install @wzrd_sol/sdk @solana/web3.js

Example Scripts

From the repo root:

npm run build --workspace=sdk
npm run typecheck:examples --workspace=sdk

Runnable examples:

  • npm run example:deposit --workspace=sdk
  • npm run example:claim --workspace=sdk

Both examples expect:

  • SOLANA_RPC_URL
  • WZRD_KEYPAIR_PATH

The deposit example also expects:

  • WZRD_MARKET_ID
  • WZRD_DEPOSIT_USDC

Quick Reference

PDA Derivation

import {
  getProtocolStatePDA,
  getMarketVaultPDA,
  getUserPositionPDA,
  getGlobalRootConfigPDA,
  getClaimStatePDA,
  PROGRAM_ID,
} from '@wzrd_sol/sdk';

const protocolState = getProtocolStatePDA();
const marketVault = getMarketVaultPDA(protocolState, 6); // market ID 6
const position = getUserPositionPDA(marketVault, walletPubkey);

Deposit USDC → Receive vLOFI

import { Connection, Keypair, VersionedTransaction, TransactionMessage } from '@solana/web3.js';
import { createDepositMarketIx } from '@wzrd_sol/sdk';

const connection = new Connection('https://api.mainnet-beta.solana.com');
const wallet = Keypair.fromSecretKey(/* your key */);

// Build instructions for a 1 USDC deposit into market 6
const ixs = await createDepositMarketIx(connection, wallet.publicKey, 6, 1_000_000n);

const { blockhash } = await connection.getLatestBlockhash();
const message = new TransactionMessage({
  payerKey: wallet.publicKey,
  recentBlockhash: blockhash,
  instructions: ixs,
}).compileToV0Message();

const tx = new VersionedTransaction(message);
tx.sign([wallet]);
const sig = await connection.sendTransaction(tx);
console.log('Deposit tx:', sig);

Claim CCM via Merkle Proof

import { createClaimGlobalIx } from '@wzrd_sol/sdk';

// Fetch proof from the server API
const res = await fetch(`https://api.twzrd.xyz/v1/claims/${wallet.publicKey.toBase58()}`);
const { root_seq, cumulative_total, proof } = await res.json();

const ixs = await createClaimGlobalIx(
  connection,
  wallet.publicKey,
  root_seq,
  BigInt(cumulative_total),
  proof, // hex-encoded [u8; 32] nodes
);

// Build, sign, send as above

Settle a Matured Position

import { createSettleMarketIx } from '@wzrd_sol/sdk';

const ixs = await createSettleMarketIx(connection, wallet.publicKey, 6);
// Build, sign, send as above

settle_market returns USDC from reserve and burns vLOFI. It does not mint CCM; CCM is claimed via merkle proof (claim_global / claim_global_v2).

Read On-Chain State

import { fetchMarketVault, fetchOnChainPosition, fetchTokenBalance } from '@wzrd_sol/sdk';

const vault = await fetchMarketVault(connection, 6);
console.log('Total deposited:', vault?.totalDeposited);

const pos = await fetchOnChainPosition(connection, wallet.publicKey, 6);
console.log('My deposit:', pos?.depositedAmount, 'Multiplier:', pos?.attentionMultiplierBps);

Exports

Constants

| Export | Description | |--------|-------------| | PROGRAM_ID | Mainnet program ID (GnGz...) | | DEVNET_PROGRAM_ID | Devnet program ID (GmGX...) | | TOKEN_PROGRAM_ID | SPL Token program | | TOKEN_2022_PROGRAM_ID | Token-2022 program (CCM uses this) |

PDA Derivation

| Function | Seeds | |----------|-------| | getProtocolStatePDA() | ["protocol_state"] | | getMarketVaultPDA(protocolState, marketId) | ["market_vault", protocolState, marketId] | | getUserPositionPDA(marketVault, user) | ["market_position", marketVault, user] | | getGlobalRootConfigPDA(ccmMint) | ["global_root", ccmMint] | | getClaimStatePDA(ccmMint, claimer) | ["claim_global", ccmMint, claimer] |

Instruction Builders

| Function | On-chain instruction | |----------|---------------------| | createDepositMarketIx(conn, user, marketId, amount) | deposit_market | | createSettleMarketIx(conn, user, marketId) | settle_market | | createClaimGlobalIx(conn, claimer, rootSeq, total, proof) | claim_global | | createInitializeMarketVaultIx(admin, marketId, ...) | initialize_market_vault |

Account Parsers

| Function | Account type | |----------|-------------| | parseMarketVault(data) | MarketVault | | parseProtocolState(data) | ProtocolState | | parseUserMarketPosition(data) | UserMarketPosition | | fetchMarketVault(conn, marketId) | Fetch + parse | | fetchOnChainPosition(conn, user, marketId) | Fetch + parse | | fetchTokenBalance(conn, ata) | Raw token balance |

Key Addresses

| Asset | Mint | Token Program | |-------|------|---------------| | USDC | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v | SPL Token | | vLOFI | E9Kt33axpCy3ve2PCY9BSrbPhcR9wdDsWQECAahzw2dS | SPL Token | | CCM | Dxk8mAb3C7AM8JN6tAJfVuSja5yidhZM5sEKW3SRX2BM | Token-2022 |