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

src-token

v1.0.1

Published

This project implements a custom SPL Token using **Token-2022** with advanced features like **transfer hooks** for transfer restrictions, taxes, burns, and more. It includes multiple Solana programs written using the **Anchor framework**.

Readme

📘 SRC Token on Solana (Token-2022 + Transfer Hook)

This project implements a custom SPL Token using Token-2022 with advanced features like transfer hooks for transfer restrictions, taxes, burns, and more. It includes multiple Solana programs written using the Anchor framework.


📦 Prerequisites

🛠️ 1. Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup install stable

📁 2. Install Solana CLI

sh -c "$(curl -sSfL https://release.solana.com/v1.18.4/install)"

Add Solana CLI to your PATH:

export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
solana --version

🔧 3. Install Anchor

cargo install --git https://github.com/coral-xyz/anchor anchor-cli --tag v0.29.0
anchor --version

🧶 4. Install Node.js + Yarn

brew install node
npm install -g yarn

📁 Project Structure

src_token/
│
├── programs/
│   ├── src_token/         # Main token logic (mint management, DAO, unlocks)
│   └── transfer_hook/     # Hook logic for transfer interception (e.g., tax)
│
├── sdk/                   # TypeScript SDK for interacting with the program
├── idl/                   # Anchor-generated IDLs
├── migrations/            # Anchor migrations
└── Anchor.toml            # Anchor configuration

🚀 Build & Deploy

⚙️ Set Cluster

solana config set --url https://api.devnet.solana.com

Or for localnet:

solana-test-validator
solana config set --url http://127.0.0.1:8899

🔐 Setup Wallet

Note : airdrop is only for non-mainnet

solana-keygen new --outfile ~/.config/solana/id.json
solana airdrop 2

🔨 Build Contracts

anchor build

This compiles all programs and generates their keypairs in target/deploy/ and IDLs in target/idl/.


📬 Get Program Addresses

After build, extract your program addresses:

solana address -k target/deploy/src_token-keypair.json
solana address -k target/deploy/transfer_hook-keypair.json

Then update declare_id! in each program’s lib.rs:

programs/src_token/src/lib.rs

declare_id!("YourGeneratedSrcTokenProgramID");

programs/transfer_hook/src/lib.rs

declare_id!("YourGeneratedTransferHookProgramID");

This step is required before you run anchor deploy.


🔧 Update Anchor.toml Before Deploying

Before deploying, update your Anchor.toml with cluster (mainnet, devnet, localnet, testnet) and programs addresses:

[programs.devnet]
src_token = "YourGeneratedSrcTokenProgramID"
transfer_hook = "YourGeneratedTransferHookProgramID"

[provider]
cluster = "devnet"
wallet = "~/.config/solana/id.json"

📤 Deploy Programs

anchor deploy -p transfer_hook
anchor deploy -p src_token

💸 Deployment Cost Estimate

| Operation | Estimated Cost (SOL) | |----------------------------------|--------------------------| | DAO program | ~2.2749 | | Transfer hook program | ~1.4000 | | Mint Account (Token-2022) | ~0.0025 | | Associated Token Accounts (x3) | ~0.0075 | | TransferHook Init + Mint | ~0.0015 – 0.0020 | | UnlockManager Account | ~0.0020 | | Total | ~3.6839 – 3.6844 SOL |


⚙️ Config Example

Update scripts/config.ts


💡 Run initialization (creates token + initializes DAO, Unlock Plans and other configurations)

pnpm initialize

💡 Create Meteora one-sided liquidity pool

Follow the set-up quide

https://docs.meteora.ag/token-launch-pools/steps-to-create-a-pool-for-a-token-launch/create-dlmm-launch-pool

  • It supports 2022 spl token standart.
  • Base token - should be SRCoin.
  • Quote token can be SOL or USDC only.
  • After successful pool creation, owner can add as much liquidity as he wants.

Note: also two-sided pool can be created https://app.meteora.ag/pools/create

🧪 Testing

Rust Tests

anchor test

📦 Publishing SDK (optional)

cd sdk
pnpm publish --access public --no-git-checks

🧼 Troubleshooting

If the program deployment was interrupted (e.g., due to a dropped connection or CLI crash), your SOL may be locked in a program buffer account. To recover it:

  1. Run the following command to locate the buffer account:
    solana program show --programs
    
  2. Look for an entry with a program address and a corresponding buffer account.
  3. If the program was not finalized (i.e., program not deployed or buffer not closed), you can recover the SOL using:
    solana program close <BUFFER_ADDRESS>
    Replace <BUFFER_ADDRESS> with the actual buffer address shown.
  4. This will return the unused SOL back to your wallet. After that try again. With this approach you can close any of your existing programs.

🛠️ Tools Used