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

@navalabs/uniswap-adapter

v0.9.0

Published

Nava Uniswap adapter — V3/V4 swap primitives, pool discovery, Permit2 helpers, plus MCP and CLI integrations for the Nava SDK.

Readme

@navalabs/uniswap-adapter

Nava Uniswap adapter — V3 / V4 swap primitives, pool discovery, balance reads, Permit2 helpers, plus MCP and CLI integrations for the Nava SDK.

pnpm add @navalabs/uniswap-adapter

This package is a complete install. It ships the nava binary and the nava-mcp server, and depends on @navalabs/sdk for the runtime and the six base verification operations — no second package to add.

Installing other adapters alongside it works the same way. They share one nava and one nava-mcp, and every installed protocol is reachable from whichever copy your package manager links.

Operations

Six, under the same names on both surfaces:

| Operation | Kind | CLI | MCP tool | |---|---|---|---| | get-balance | read | nava uniswap get-balance | uniswap.get-balance | | get-quote | read | nava uniswap get-quote | uniswap.get-quote | | find-all-pools | read | nava uniswap find-all-pools | uniswap.find-all-pools | | execute-swap | build | nava uniswap execute-swap | uniswap.execute-swap | | wrap-eth | build | nava uniswap wrap-eth | uniswap.wrap-eth | | mint-test-tokens | build | nava uniswap mint-test-tokens | uniswap.mint-test-tokens |

Nothing here is a verified-write. Every operation either reads chain state or returns calldata — including execute-swap, which does not broadcast. Guardian verification and submission belong to the calling application, via NavaClient.requestVerification.

wrap-eth prepares a standalone WETH deposit. Never insert it automatically for an ETH swap request; obtain separate authorization and a separate verdict.

Currencies: symbol or contract address

--currency-in / --currency-out (MCP: currencyIn / currencyOut) accept either a token symbol or a token contract address. Symbols resolve from the static registry first, then from published Uniswap token lists. A verified token address is accepted even when it is not listed. Decimals are always read on-chain and must match any claimed list/registry value.

# UNISWAP_CHAIN_ID=137 — the USDC.e/WETH v3 pool on Polygon.
nava uniswap get-quote --protocol v3 --currency-in USDC.e --currency-out WETH --amount-in 1
nava uniswap get-quote --protocol v3 \
  --currency-in 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 \
  --currency-out 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619 \
  --amount-in 1

A listed or configured symbol, or a contract address whose decimals can be verified on-chain, can be quoted and swapped. Amounts are decimal strings in whole token units ("1.5"), never base units.

There is no fallback: an unknown symbol, a stale or conflicting token list, a token-list fetch failure during search, a decimals mismatch, or a factory/pool identity mismatch is an error naming the token, never a guessed value. Recover with find-all-pools. V3 pools for an unregistered pair are discovered with --currency-a / --currency-b.

Always choose v3 or v4 explicitly; both use Universal Router calldata. Every swap remains unsigned calldata for Guardian verification.

TypeScript

import { createPublicClient, http } from 'viem';
import { sepolia } from 'viem/chains';
import { createUniswapTools } from '@navalabs/uniswap-adapter';

const tools = createUniswapTools({
  escrowAddress: '0x...',
  chainId: 11155111,
  publicClient: createPublicClient({ chain: sepolia, transport: http() }),
});

// `execute` is optional on the AI SDK tool type, hence the `?.`.
const quote = await tools.getQuote.execute?.(
  { protocol: 'v3', currencyIn: 'TKA', currencyOut: 'TKB', amountIn: '1.0' },
  { toolCallId: 'cli', messages: [] },
);

| Import | Contents | |---|---| | @navalabs/uniswap-adapter | createUniswapTools, the pure utilities, and the pool/token registries. Start here. | | /tools | createUniswapTools, UniswapToolsConfig, and the six individual create* factories. | | /mcp | createProtocolRegistrarFactory, registerUniswapTools, and the advertised zod schemas — what nava-mcp imports. | | /cli | uniswapCliModule plus the six parse* argv parsers — what the nava bin imports. | | /adapter | Empty. Reserved for a future verified-execution surface; it exports nothing today. Do not import it. |

Pure utilities (prepareSwapCalldata, getQuotes, getBalance, checkBothApprovalLevels, the registries) are re-exported from the root.

Environment

For the CLI and the MCP registrar:

  • UNISWAP_RPC_URL (or RPC_URL) — JSON-RPC endpoint for the active chain.
  • UNISWAP_CHAIN_ID (or CHAIN_ID) — numeric chain id, e.g. 11155111.
  • UNISWAP_WALLET_ADDRESS (or WALLET_ADDRESS) — wallet / escrow address used to construct calldata.
  • UNISWAP_TOKEN_LIST_URLS — optional comma-separated Uniswap token list URLs for symbol discovery. Unset uses https://tokens.uniswap.org.
  • NAVA_API_KEY — required to run nava-mcp.
  • NAVA_BASE_URL — optional Nava API origin. Defaults to https://internal.navalabs.dev/api.

Full parameter reference

Every option, requirement, default, and worked example lives in the bundled Nava skill that ships with @navalabs/sdk, at node_modules/@navalabs/sdk/skills/nava/references/uniswap.md. There is no per-command --help; that file is the parameter reference.

Upstream SDK compatibility

The adapter pins to current Uniswap SDK releases and loads Universal Router planner values through their CommonJS export, because the upstream ESM builds still contain extensionless internal imports that fail under strict Node ESM resolution. @uniswap/v4-sdk sourcemap warnings are harmless — the upstream package ships sourcemaps pointing at missing TypeScript sources.