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

@dotswap/dex

v0.1.9

Published

DotSwap DEX 命令行工具

Readme

@dotswap/dex

DotSwap DEX command-line tool for managing BTC wallets, querying liquidity pools and account assets, and executing instant swap transactions — all from your terminal. Also runs as an MCP server, enabling direct integration with AI clients like Cursor and Claude Desktop.

Features

Wallet & Account

| Command | Description | |---------|-------------| | dex wallet add | Import a wallet via BIP39 mnemonic or WIF private key, encrypted and stored locally | | dex wallet list | List all saved wallets | | dex wallet show | Show details of a specific wallet | | dex auth login | Select a wallet and configure network, API Host, and X-API-Key (supports --flags and env vars for non-interactive use) | | dex auth status | Show current authentication configuration | | dex auth logout | Clear authentication configuration | | dex account overview | View account asset overview | | dex account balance-stat | View balance history statistics for a specific token |

Trading & Liquidity (Taker)

| Command | Description | |---------|-------------| | dex pool list | List liquidity pools associated with the current address | | dex swap history | View swap history with status filtering and pagination | | dex swap quick | Get a quote and submit a swap transaction in one step |

Market Making (Maker)

| Command | Description | |---------|-------------| | dex liquidity clmm calc | Calculate CLMM parameters and generate a ready-to-run clmm add command | | dex liquidity clmm list | List CLMM liquidity positions; supports --apr 1d\|7d\|30d | | dex liquidity clmm add | Add CLMM liquidity to a price range (use tick indexes from clmm calc) | | dex liquidity clmm remove | Remove CLMM liquidity by percentage | | dex liquidity sided calc | Calculate sided parameters and generate a ready-to-run sided add command (with market price validation) | | dex liquidity sided list | List sided positions (matched + pending) | | dex liquidity sided add | Submit a sided liquidity order (use tick indexes from sided calc) | | dex liquidity sided update | Update a pending sided order | | dex liquidity sided cancel | Cancel a sided order (MATCHING status) | | dex liquidity sided remove | Remove a matched sided position |

AI Integration (MCP)

| Command | Description | |---------|-------------| | dex mcp | Start MCP HTTP server (default port 3000) | | dex mcp --readonly | Start in read-only mode, disabling trade operations | | dex mcp --stdio | Start in stdio mode for Claude Desktop integration |

Supported Platforms

| Platform | Architecture | |----------|-------------| | macOS | Apple Silicon (M1/M2/M3) | | macOS | Intel | | Linux | x64 | | Windows | x64 |

Installation

Requires Node.js >= 14. LTS version recommended.

npm install -g @dotswap/dex

Verify installation:

dex version

Quick Start

A Note on Private Key Security

This tool offers two login methods. Choose based on how much you trust your local environment:

| Method | Best For | Steps | |--------|----------|-------| | Method 1: Import Wallet (recommended) | Trusted local environment, prefer convenience | wallet addauth login | | Method 2: Manual Address Input (no private key) | Concerned about local security, prefer not to store keys in any tool | auth login directly |

Method 1 note: Your private key is AES-encrypted and stored only in a local file — it is never uploaded to any server. The tool does not read your private key during normal operation.


Method 1: Import Wallet (Recommended)

Step 1: Import your wallet

dex wallet add

Supports BIP39 mnemonic and WIF private key import. The key is encrypted and stored locally only — never transmitted to any server.

Step 2: Login

dex auth login

Select a wallet, configure network, API Host, and X-API-Key.


Method 2: Manual Address Input (No Private Key)

If you prefer not to store your private key in any tool, skip wallet add and run:

dex auth login

Without an imported wallet, auth login will prompt you to manually enter the following (all public information — no private key required):

  • BTC address and public key
  • Ordinals address and public key
  • API Host and X-API-Key

Once configured, all query and trading features are fully available.


3. Common Commands

# List liquidity pools
dex pool list

# Account asset overview
dex account overview

# Swap history
dex swap history

# All commands
dex --help

MCP HTTP Server

Start an MCP (Model Context Protocol) HTTP server to enable AI editors like Cursor to access CLI functionality via HTTP.

# Start HTTP server (default port 3000)
dex mcp --port 3000

# Start in read-only mode
dex mcp --port 3000 --readonly

Configure Cursor by adding to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "dotswap-dex": {
      "url": "http://127.0.0.1:3000/streamable-http"
    }
  }
}

See QUICKSTART.md for detailed setup instructions.

Full Documentation

After installation, view the complete guide:

cat $(npm root -g)/@dotswap/dex/QUICKSTART.md

Uninstall

npm uninstall -g @dotswap/dex