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

@hodlmarkets/sdk

v0.1.4

Published

Solana program SDK for the HODL token launchpad/trading platform

Readme

@hodlmarkets/sdk

TypeScript SDK for the HODL vAMM program on Solana.

Full documentation at docs.hodl.markets

Install

npm install @hodlmarkets/sdk

Peer dependencies:

npm install @coral-xyz/anchor @solana/web3.js @solana/spl-token bn.js

Buy

import { Connection } from '@solana/web3.js'
import BN from 'bn.js'
import { HodlClient, calculateBuyAmount, applySlippage } from '@hodlmarkets/sdk'

const connection = new Connection('https://api.mainnet-beta.solana.com')
const client = new HodlClient({ connection })

const pool = await client.fetchPool(mint)

const solAmount = new BN('100000000') // 0.1 SOL
const expectedTokens = calculateBuyAmount(solAmount, pool.vammRealSol, pool.vammTokens, pool.vammK)
const minTokensOut = applySlippage(expectedTokens, 100) // 1% slippage

const tx = await client.buy({ buyer: wallet.publicKey, mint, solAmount, minTokensOut })
tx.sign([wallet])
const sig = await connection.sendRawTransaction(tx.serialize())

Sell

import { HodlClient, calculateSellAmount, applySlippage, getPoolStatePDA, PROGRAM_ID } from '@hodlmarkets/sdk'

const pool = await client.fetchPool(mint)
const [poolState] = getPoolStatePDA(mint, PROGRAM_ID)
const position = await client.fetchPosition(poolState, wallet.publicKey)

const expectedSol = calculateSellAmount(position.tradableTokens, pool.vammRealSol, pool.vammTokens, pool.vammK)

const tx = await client.sell({
  seller: wallet.publicKey,
  mint,
  tokenAmount: position.tradableTokens,
  minSolOut: applySlippage(expectedSol, 100),
})
tx.sign([wallet])
await connection.sendRawTransaction(tx.serialize())

Create Token

import { Keypair } from '@solana/web3.js'
import BN from 'bn.js'

const mint = Keypair.generate()

const tx = await client.createToken({
  creator: wallet.publicKey,
  mint: mint.publicKey,
  name: 'My Token',
  symbol: 'MTK',
  uri: 'https://arweave.net/metadata.json',
  poolDescription: 'A community token',
  vestDuration: new BN(60), // 1 minute (only 60 or 1800 allowed)
})
tx.sign([wallet, mint]) // both creator and mint must sign
await connection.sendRawTransaction(tx.serialize())

Claim Accrued Tokens

const [poolState] = getPoolStatePDA(mint, PROGRAM_ID)
const tx = await client.claimAccrued({ owner: wallet.publicKey, poolState })
tx.sign([wallet])
await connection.sendRawTransaction(tx.serialize())

Events

// Real-time
const subId = client.subscribeToEvents((event, slot, signature) => {
  if (event.name === 'tokenPurchased') {
    console.log('Buy:', event.data.tokensReceived.toString())
  }
})
await client.unsubscribe(subId)

// Historical
const events = await client.fetchAndParseTransaction(signature)

Error Handling

import { parseHodlError } from '@hodlmarkets/sdk'

try {
  await connection.sendRawTransaction(tx.serialize())
} catch (err) {
  const hodlErr = parseHodlError(err)
  if (hodlErr) console.error(`HODL error ${hodlErr.code}: ${hodlErr.message}`)
}

License

MIT