{"_id":"dome-to-pmxt","name":"dome-to-pmxt","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"dome-to-pmxt","version":"1.0.0","description":"Automatic codemod to migrate DomeAPI code to pmxt (TypeScript and Python)","main":"index.js","type":"module","bin":{"dome-to-pmxt":"index.js"},"engines":{"node":">=18"},"keywords":["domeapi","pmxt","codemod","migration","polymarket","kalshi"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/pmxt-io/pmxt.git","directory":"tools/dome-to-pmxt"},"homepage":"https://github.com/pmxt-io/pmxt/tree/main/tools/dome-to-pmxt","_id":"dome-to-pmxt@1.0.0","gitHead":"3c986663b267c2907582dc253bea5298dc31f072","bugs":{"url":"https://github.com/pmxt-io/pmxt/issues"},"_nodeVersion":"24.10.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-Eyl9TkEsVLNNKmjEysst6ij7E9ajRHNm0qVTXqgheqhspd4dDKBB7qFINXa0cdmIjYyMr98FuI6QSutLizWJnw==","shasum":"a6abf416d3bcb094db9da7460ac7b43043830fac","tarball":"https://registry.npmjs.org/dome-to-pmxt/-/dome-to-pmxt-1.0.0.tgz","fileCount":3,"unpackedSize":12188,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD43Uwe3usYtq6fzPmJmgJJbmgs79/Km4GJlOnfcYAWrAIgdhuX7AMUCF46AkryRXkT9jRWEO2I1GQ+FOnRa4ZcSIk="}]},"_npmUser":{"name":"realfishsam","email":"samuel.tinnerholm@gmail.com"},"directories":{},"maintainers":[{"name":"realfishsam","email":"samuel.tinnerholm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dome-to-pmxt_1.0.0_1771667491705_0.3386568452120877"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-21T09:51:31.704Z","1.0.0":"2026-02-21T09:51:31.850Z","modified":"2026-02-21T09:51:32.131Z"},"maintainers":[{"name":"realfishsam","email":"samuel.tinnerholm@gmail.com"}],"description":"Automatic codemod to migrate DomeAPI code to pmxt (TypeScript and Python)","homepage":"https://github.com/pmxt-io/pmxt/tree/main/tools/dome-to-pmxt","keywords":["domeapi","pmxt","codemod","migration","polymarket","kalshi"],"repository":{"type":"git","url":"git+https://github.com/pmxt-io/pmxt.git","directory":"tools/dome-to-pmxt"},"bugs":{"url":"https://github.com/pmxt-io/pmxt/issues"},"license":"MIT","readme":"# dome-to-pmxt\n\nAutomatic codemod to migrate DomeAPI code to pmxt. Supports both **TypeScript/JavaScript** and **Python**.\n\n## Why?\n\nDomeAPI is being sunset. This tool helps you automatically migrate your codebase to **pmxt**, which supports both Polymarket and Kalshi with a unified API.\n\n## Installation\n\n```bash\nnpm install -g dome-to-pmxt\n# or\nnpx dome-to-pmxt\n```\n\n## Usage\n\n```bash\n# Transform a single file\ndome-to-pmxt ./src/my-file.ts\n\n# Transform a directory (recursively)\ndome-to-pmxt ./src\n\n# Transform both TS and Python files in a project\ndome-to-pmxt ./\n```\n\n### Supported file types:\n- **TypeScript/JavaScript:** `.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`, `.cjs`\n- **Python:** `.py`\n\n### Skipped directories:\n`node_modules`, `.git`, `dist`, `build`, `__pycache__`, `.venv`, `venv`, `.next`, `coverage`\n\n## What it migrates\n\n### TypeScript/JavaScript\n\n- Import statements: `@dome-api/sdk` → `pmxtjs`\n- Constructor: `new DomeClient({...})` → `new pmxt.Polymarket()`\n- Methods: `dome.polymarket.markets.getMarkets()` → `poly.fetchMarkets()`\n- Parameters: `pagination_key` → `offset`, `token_id` → `outcomeId`, `status: 'open'` → `status: 'active'`\n- Timestamps: `start_ts`, `end_ts` → `start`, `end` (with TODOs for manual adjustment)\n\n### Python\n\nSame transforms for Python imports and method calls.\n\n## What needs manual work\n\nThe codemod adds `/* TODO(dome-to-pmxt): ... */` comments (JS) or `# TODO(dome-to-pmxt): ...` (Python) where semantic changes require manual review:\n\n1. **Response shapes differ** — DomeAPI wraps markets in `{markets: [...]}`, pmxt returns arrays directly\n2. **Price extraction** — DomeAPI has `getMarketPrice()` returning a price object; pmxt prices are in `market.outcomes[i].price`\n3. **Pagination** — DomeAPI uses cursor-based (`pagination_key`), pmxt uses offset-based (`offset`)\n4. **Timestamp handling** — DomeAPI expects unix seconds, pmxt expects `Date` objects\n\nSee [`../../docs/MIGRATE_FROM_DOMEAPI.md`](../../docs/MIGRATE_FROM_DOMEAPI.md) for detailed migration guide and examples.\n\n## Example\n\n**Before (DomeAPI):**\n```typescript\nimport { DomeClient } from '@dome-api/sdk';\n\nconst dome = new DomeClient({ apiKey: 'your-key' });\n\nasync function main() {\n  const markets = await dome.polymarket.markets.getMarkets({\n    status: 'open',\n    limit: 10\n  });\n  console.log(markets.markets.length);\n}\n```\n\n**After running codemod:**\n```typescript\nimport pmxt from 'pmxtjs';\n\nconst dome = /* TODO(dome-to-pmxt): new pmxt.Polymarket() or new pmxt.Kalshi() */ new pmxt.Polymarket();\n\nasync function main() {\n  const markets = await poly.fetchMarkets({\n    status: 'active',\n    limit: 10\n  });\n  console.log(markets.length); // TODO: pmxt returns array directly\n}\n```\n\n## Limitations\n\n- The codemod handles common patterns but may miss edge cases\n- Always review the transformed code and search for `TODO(dome-to-pmxt)` comments\n- Test thoroughly against your actual API calls\n- For complex migrations, refer to the full [migration guide](../../docs/MIGRATE_FROM_DOMEAPI.md)\n\n## Next steps\n\n1. Run the codemod on your project\n2. Search for `TODO(dome-to-pmxt)` comments and fix them\n3. Install `pmxt`: `npm install pmxtjs` (or `pip install pmxt`)\n4. Update your code to handle the new API shapes and authentication (pmxt handles auth via environment variables)\n5. Test with real API calls\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-2765abbb53342613d631c072293c71a2"}