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

ttxd-alpha

v2.2.0

Published

An SDK for building applications on top of V2,V3 and Solana exchanges

Downloads

73

Readme

TTXD-Alpha SDK

npm version npm bundle size (scoped version)

The latest version of the SDK is used in production in the DEX Interfaces, but it is considered Alpha testing software and may contain bugs or change significantly between patch versions.

Features

  • Multi-chain & multi-DEX support: Currently supports Ethereum, BNB Chain, Polygon, and Base, with more chains coming soon.
  • Modular architecture: Add additional DEXes and blockchains without refactoring core logic.
  • Lightweight: Designed for high performance, the SDK offers minimal overhead.

Learn more about these features and how to use them in our Medium article:
📚 Read our Ultimate Guide to Cross-Chain to learn about:

This ttxd-alpha SDK provides a unified way to interact with Uniswap V2, Uniswap V3, PancakeSwap, QuickSwap, SushiSwap, and Raydium V2 exchanges across multiple blockchains. With simple functions, you can swap tokens and manage liquidity seamlessly across Ethereum, BSC, Polygon, Base, and Solana.


Installation

Make sure you have Node.js installed. To install the SDK, run:

npm install ttxd-alpha

Examples of Using the SDK

1. V2 Exchanges: Uniswap V2

This example demonstrates a swap on Uniswap V2, but the same code works for other V2 exchanges by simply changing the exchange name and chainId.


import { swapV2 } from 'ttxd-alpha';

const provider = new ethers.providers.JsonRpcProvider('RPC URL'); // JsonRpcProvider instance
const signer = new ethers.Wallet('YOUR_PRIVATE_KEY', provider); // Wallet instance

(async () => {
    await swapV2({
        chainId: ChainId.Base,        // Chain ID
        exchange: "uniswapv2",       // Exchange name
        token1: new Token(),         // Token to swap from
        token2: new Token(),         // Token to swap to
        amount: '1000000',           // 1 USDC (raw amount)
        provider,                    // Blockchain provider
        signer,                      // Transaction signer
        gasLimit,                    // Optional gas limit (default: 300,000)
        maxFeePerGas,                // Optional max fee per gas (default: Dynamic per chain)
        maxPriorityFeePerGas,        // Optional max priority fee per gas (default: Dynamic per chain)
    });
})();

Supported V2 Exchanges

| Exchange | Supported Networks | |-----------------|-----------------------------------| | "uniswapv2" | Ethereum, BSC, Polygon, Base | | "pancakeswapv2" | Ethereum, BSC, Base | | "quickswapv2" | Polygon | | "sushiswapv2" | Ethereum, BSC, Polygon |

2. V3 Exchanges: Uniswap V3

The following example demonstrates a swap using Uniswap V3. Similarly, it works for other V3 exchanges with minor changes.

import { swapV3 } from 'ttxd-alpha';

const provider = new ethers.providers.JsonRpcProvider('RPC URL'); // JsonRpcProvider instance
const signer = new ethers.Wallet('YOUR_PRIVATE_KEY', provider); // Wallet instance

(async () => {
    await swapV3({
      chainId: ChainId.BASE,        // Chain ID
        exchange: "uniswapv3",       // Exchange name
        tokenIn: new Token(),        // Token to swap from
        tokenOut: new Token(),       // Token to swap to
        fee: 500,                    // Pool fee (default: 0.05%)
        amountIn: '1000000',         // 1 USDC (raw amount)
        provider,                    // Blockchain provider
        signer,                      // Transaction signer
        gasLimit,                    // Optional gas limit (default: 300,000)
        maxFeePerGas,                // Optional max fee per gas (default: Dynamic per chain)
        maxPriorityFeePerGas,        // Optional max priority fee per gas (default: Dynamic per chain)
    });
})();

Supported V3 Exchanges

| Exchange | Supported Networks | |-----------------|-----------------------------------| | "uniswapv3" | Ethereum, BSC, Polygon, Base | | "pancakeswapv3" | BSC, Base |

3. Solana : Raydium V2

This example demonstrates a swap using Raydium V2 on Solana. Raydium works with Pool IDs, so you must provide a specific pool ID and amount for the swap.


import { swapRaydium } from 'ttxd-alpha';

(async () => {
        const result = await swapRaydium({
            poolId: 'AMM POOL_ID',                  // Example pool ID
            amountIn: 0.005,                        // Amount in SOL
            privateKey: 'YOUR_PRIVATE_KEY',         // Wallet private key
            slippage: 0.01,                         // Optional | Default: 0.05 (5%)
            rpcUrl: 'https://api.mainnet-beta.solana.com', // Optional: Custom RPC URL | Default: Mainnet
            poolType: "amm",                        // Pool type: "amm" for AMM, "clmm" for CLMM
            priorityFeeSol: 0.0001,                 // Optional: Priority fee in SOL
            tipFeeSol: 0.00005                      // Optional: Tip fee in SOL
        });

        console.log(`Swap successful! Transaction ID: ${result.txId}`);
})();

Supported Solana Exchanges "raydiumv2" - Solana

New Feature: Swap Across Different Pool Types

  • AMM (Automated Market Maker)
  • CLMM (Concentrated Liquidity Market Maker)

License

This project is licensed under the MIT License.