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

seeker-iou

v0.2.0

Published

TypeScript SDK for seeker-iou on-chain vault and settlement protocol

Readme

seeker-iou SDK

TypeScript SDK for the seeker-iou on-chain vault and settlement protocol.

Installation

bun add seeker-iou

API Reference

Seeker Device Verification (via seeker-sdk)

import {
  verifySeekerForVault,
  isSeeker,
  resolveRecipientDisplay,
  resolveSkrDomain,
  reverseResolveSkr,
} from "seeker-iou";

// Verify SGT ownership before vault creation (returns SGT mint PublicKey)
const sgtMint = await verifySeekerForVault(connection, walletAddress);

// Simple boolean check
if (await isSeeker(connection, walletAddress)) { /* ... */ }

// Resolve recipient to human-readable .skr domain
const display = await resolveRecipientDisplay(connection, recipientAddress);
// "chai-vendor.skr" or null

// Forward/reverse .skr domain resolution
const owner = await resolveSkrDomain(connection, "chai-vendor.skr");
const domain = await reverseResolveSkr(connection, walletAddress);

IOU Creation

import { createIOUMessage, parseIOUMessage } from "seeker-iou";

// Serialize an IOU message (217 bytes, Borsh format)
const message = createIOUMessage({
  vault,           // PublicKey - sender's vault PDA
  sender,          // PublicKey - sender's wallet
  recipient,       // PublicKey - recipient's wallet
  tokenMint,       // PublicKey - SPL token mint
  amount: 1000n,   // bigint - raw amount in smallest unit
  nonce: 1,        // number - sequential, starts at 1
  sgtMint,         // PublicKey - sender's SGT mint
  expiry: 0,       // optional unix timestamp (0 = no expiry)
  memo: "coffee",  // optional string (max 32 bytes UTF-8)
});

// Deserialize back
const iou = parseIOUMessage(message);

NFC Encoding

import { encodeNFCPayload, decodeNFCPayload, validateNFCPayload } from "seeker-iou";

// Encode for NFC transfer (NDEF format)
const nfcBytes = encodeNFCPayload({ message, signature });

// Decode received NFC data
const { message, signature } = decodeNFCPayload(nfcBytes);

// Validate with full error reporting
const result = validateNFCPayload(nfcBytes);
// { valid: boolean, iou: IOUParams | null, signature: Uint8Array | null, error: string | null }

Signature Verification

import { verifySignature } from "seeker-iou";

const isValid = verifySignature(message, signature, senderPublicKey);

Vault Instructions

import {
  createVaultInstruction,
  createDepositInstruction,
  createDeactivateVaultInstruction,
  createReactivateVaultInstruction,
  createWithdrawInstruction,
} from "seeker-iou";

const ix = await createVaultInstruction({ owner, tokenMint, sgtMint, sgtTokenAccount });
const depositIx = await createDepositInstruction({ owner, vault, tokenMint, amount: 1000000n });
const deactivateIx = await createDeactivateVaultInstruction({ owner, vault });
const reactivateIx = await createReactivateVaultInstruction({ owner, vault });
const withdrawIx = await createWithdrawInstruction({ owner, vault, tokenMint });

Settlement Instructions

import {
  createSettleIOUInstruction,
  createBatchSettleInstructions,
  chunkSettlementTransactions,
} from "seeker-iou";

// Single IOU - returns [Ed25519Ix, SettleIx]
const [ed25519Ix, settleIx] = await createSettleIOUInstruction({
  settler, vault, recipient, tokenMint,
  iouMessage, signature, nonce, sgtMint, senderPublicKey,
});

// Batch - returns all instruction pairs
const allIxs = await createBatchSettleInstructions({ settler, ious: [...] });

// Split into transaction-sized batches (~2 IOUs per tx)
const txs = chunkSettlementTransactions(allIxs, feePayer);

Reputation

import { getReputation, calculateTrustScore, getSettlementHistory } from "seeker-iou";

const rep = await getReputation(connection, sgtMint);
const score = calculateTrustScore(rep); // 0.0 to 1.0
const history = await getSettlementHistory(connection, vault);

Local State Management

import {
  trackIssuedIOU,
  getLocalAvailableBalance,
  serializeLocalState,
  deserializeLocalState,
} from "seeker-iou";

let state = { vaultAddress, tokenMint, depositedAmount: 1000n, spentAmount: 0n, currentNonce: 0, pendingIOUs: [] };

state = trackIssuedIOU(state, { recipient, amount: 100n, nonce: 1, message, signature, createdAt: Date.now(), settled: false });

const available = getLocalAvailableBalance(state); // 900n

// Persist to device storage
const bytes = serializeLocalState(state);
const restored = deserializeLocalState(bytes);

PDA Derivation

import { deriveVaultPda, deriveSettlementRecordPda, deriveReputationPda } from "seeker-iou";

const [vaultPda, bump] = deriveVaultPda(owner, tokenMint);
const [recordPda] = deriveSettlementRecordPda(vault, nonce);
const [repPda] = deriveReputationPda(sgtMint);

License

MIT