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

dome-to-pmxt

v1.0.0

Published

Automatic codemod to migrate DomeAPI code to pmxt (TypeScript and Python)

Downloads

98

Readme

dome-to-pmxt

Automatic codemod to migrate DomeAPI code to pmxt. Supports both TypeScript/JavaScript and Python.

Why?

DomeAPI is being sunset. This tool helps you automatically migrate your codebase to pmxt, which supports both Polymarket and Kalshi with a unified API.

Installation

npm install -g dome-to-pmxt
# or
npx dome-to-pmxt

Usage

# Transform a single file
dome-to-pmxt ./src/my-file.ts

# Transform a directory (recursively)
dome-to-pmxt ./src

# Transform both TS and Python files in a project
dome-to-pmxt ./

Supported file types:

  • TypeScript/JavaScript: .ts, .tsx, .js, .jsx, .mjs, .cjs
  • Python: .py

Skipped directories:

node_modules, .git, dist, build, __pycache__, .venv, venv, .next, coverage

What it migrates

TypeScript/JavaScript

  • Import statements: @dome-api/sdkpmxtjs
  • Constructor: new DomeClient({...})new pmxt.Polymarket()
  • Methods: dome.polymarket.markets.getMarkets()poly.fetchMarkets()
  • Parameters: pagination_keyoffset, token_idoutcomeId, status: 'open'status: 'active'
  • Timestamps: start_ts, end_tsstart, end (with TODOs for manual adjustment)

Python

Same transforms for Python imports and method calls.

What needs manual work

The codemod adds /* TODO(dome-to-pmxt): ... */ comments (JS) or # TODO(dome-to-pmxt): ... (Python) where semantic changes require manual review:

  1. Response shapes differ — DomeAPI wraps markets in {markets: [...]}, pmxt returns arrays directly
  2. Price extraction — DomeAPI has getMarketPrice() returning a price object; pmxt prices are in market.outcomes[i].price
  3. Pagination — DomeAPI uses cursor-based (pagination_key), pmxt uses offset-based (offset)
  4. Timestamp handling — DomeAPI expects unix seconds, pmxt expects Date objects

See ../../docs/MIGRATE_FROM_DOMEAPI.md for detailed migration guide and examples.

Example

Before (DomeAPI):

import { DomeClient } from '@dome-api/sdk';

const dome = new DomeClient({ apiKey: 'your-key' });

async function main() {
  const markets = await dome.polymarket.markets.getMarkets({
    status: 'open',
    limit: 10
  });
  console.log(markets.markets.length);
}

After running codemod:

import pmxt from 'pmxtjs';

const dome = /* TODO(dome-to-pmxt): new pmxt.Polymarket() or new pmxt.Kalshi() */ new pmxt.Polymarket();

async function main() {
  const markets = await poly.fetchMarkets({
    status: 'active',
    limit: 10
  });
  console.log(markets.length); // TODO: pmxt returns array directly
}

Limitations

  • The codemod handles common patterns but may miss edge cases
  • Always review the transformed code and search for TODO(dome-to-pmxt) comments
  • Test thoroughly against your actual API calls
  • For complex migrations, refer to the full migration guide

Next steps

  1. Run the codemod on your project
  2. Search for TODO(dome-to-pmxt) comments and fix them
  3. Install pmxt: npm install pmxtjs (or pip install pmxt)
  4. Update your code to handle the new API shapes and authentication (pmxt handles auth via environment variables)
  5. Test with real API calls

License

MIT