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

thaifi-wallet-cli

v0.6.0

Published

ThaiFi Wallet CLI for AI agents — pair with wallet.thaifi.com, sign with on-chain access keys (spending limits enforced on-chain), x402/MPP payments

Readme

ThaiFi Wallet CLI (thaifi)

Command-line wallet for AI agents on the ThaiFi chain (chain 17) — pairs with wallet.thaifi.com and signs with an on-chain access key whose spending limit is enforced by the chain itself (AccountKeychain precompile, TIP-1011).

Agent setup guide for AI agents: https://wallet.thaifi.com/SKILL.md

How it works

~/.thaifi/store.json (agent P256 key, chmod 600)
        │  1. thaifi login → POST /api/agent/pair/start {keyId, name}
        ▼
wallet.thaifi.com/pair?id=…&code=…   ← user approves (passkey / PIN)
        │  2. web sends authorizeKey(keyId, P256, expiry, limits) on-chain
        ▼
access key authorized on-chain → the CLI signs transactions directly,
spending up to the limit per token, fees (gas) paid in pathUSD.
  • Non-custodial: the private key never leaves the machine; the web wallet never sees it.
  • One wallet per account: revoking an app on the web cuts access immediately.
  • Limits are on-chain, per token: SpendingLimitExceeded when exceeded; keys expire.
  • Supported tokens (TIP-20, 6 decimals): pathUSD (gas), THCFI, THCOC.

Install / run

npm install
npx tsx src/index.ts --help        # dev
npm run build && node dist/index.js # compiled

Set THAIFI_WALLET_URL / THAIFI_RPC_URL to target other deployments.

Commands

| Command | Description | |---|---| | login [--no-browser] | Pair with the web wallet (approval URL for headless machines) | | whoami | Account, agent key, balances, remaining spend limits | | tokens | List supported TIP-20 tokens (symbol, decimals, address) | | balance [--token <symbol\|addr>] | Balances (default: all supported tokens) | | transfer <to> <amount> [--token <symbol\|addr>] | Send tokens (default: pathUSD; limit enforced on-chain) | | fund [--no-browser] | Show the deposit address and open the web Deposit page | | deposit --amount <THB> [--token THCFI\|THCOC] [--ref <id>] [--no-open] [--json] | PromptPay QR top-up (1 THB = 1 token): order a QR, show it for a human to scan, poll until the tokens are minted | | request <url> [-X -H -d --json --dry-run --max-spend] | HTTP with automatic x402/MPP payment and ThaiFiAgent identity auth (401/403 answered by signing the challenge) | | services [--search q] | Discover services from the MPP registry (THAIFI_MPP_REGISTRY) | | logout | Remove the local key (revoke on-chain from the web wallet) |

--token accepts a symbol (case-insensitive) or a contract address; unknown addresses are treated as custom TIP-20s (6 decimals).

Deposit (PromptPay top-up)

thaifi deposit --amount 50 orders a PromptPay QR for the paired wallet and waits until the tokens are minted (1 THB = 1 token). There is no API key: the backend verifies on-chain (AccountKeychain precompile, TIP-1011) that the agent's access key belongs to a wallet and credits THAT wallet — the recipient never comes from the CLI.

$ thaifi deposit --amount 50
PromptPay deposit — 50.00 THB -> THCFI (1 THB = 1 token)
Credited wallet: 0x…
<terminal QR block>
QR_FILE=~/.thaifi/qr-<referenceNo>.png
REFERENCE=<referenceNo>
AMOUNT=50.00 THB -> THCFI
RESUME=thaifi deposit --ref <referenceNo>
STATUS=pending  (scan the QR to pay)
STATUS=delivered
TX=0x…  Explorer: https://exp.thaifi.com/tx/0x…
  • The QR is saved to ~/.thaifi/qr-<referenceNo>.png (chmod 600), rendered as terminal blocks, and opened in the default viewer (disable with --no-open).
  • Orders expire after 15 minutes; paying late still delivers. Resume watching any order with --ref <referenceNo> — the status response includes the QR again, so a restarted CLI can re-display it.
  • Limits: 6–10,000 THB per order, 50,000 THB per wallet per 24h, 5 pending orders per wallet. --json prints machine-readable output.
  • Requires an approved pairing (thaifi login); a revoked/expired key fails with 401 on-chain verification.

Security notes

  • The recovery password / passphrase is never involved here — the agent key is authorized by the account owner via the web wallet.
  • Losing the machine = losing the agent key: re-pair a new key from the web wallet and revoke the old one under Authorized Apps.