{"id":29125726,"url":"https://github.com/duneanalytics/sim-idx-ts","last_synced_at":"2026-03-16T04:03:48.826Z","repository":{"id":300739737,"uuid":"1005513459","full_name":"duneanalytics/sim-idx-ts","owner":"duneanalytics","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-23T11:14:23.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-23T11:19:55.306Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duneanalytics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-20T10:48:09.000Z","updated_at":"2025-06-23T11:14:27.000Z","dependencies_parsed_at":"2025-06-23T11:30:05.330Z","dependency_job_id":null,"html_url":"https://github.com/duneanalytics/sim-idx-ts","commit_stats":null,"previous_names":["duneanalytics/sim-idx-ts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/duneanalytics/sim-idx-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fsim-idx-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fsim-idx-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fsim-idx-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fsim-idx-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duneanalytics","download_url":"https://codeload.github.com/duneanalytics/sim-idx-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fsim-idx-ts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262034617,"owners_count":23248321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-29T22:02:45.895Z","updated_at":"2026-03-16T04:03:48.821Z","avatar_url":"https://github.com/duneanalytics.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @duneanalytics/sim-idx\n\n[![npm version](https://badge.fury.io/js/%40duneanalytics%2Fsim-idx.svg)](https://badge.fury.io/js/%40duneanalytics%2Fsim-idx)\n[![npm downloads](https://img.shields.io/npm/dm/@duneanalytics/sim-idx)](https://www.npmjs.com/package/@duneanalytics/sim-idx)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Tests](https://github.com/duneanalytics/sim-idx-ts/actions/workflows/on-pull-request.yml/badge.svg)](https://github.com/duneanalytics/sim-idx-ts/actions/workflows/on-pull-request.yml)\n[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat-square\u0026logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n\n\nA TypeScript library for writing Sim IDX apps.\n\n## Installation\n\n```bash\nnpm install @duneanalytics/sim-idx\n# or\nyarn add @duneanalytics/sim-idx\n# or\npnpm add @duneanalytics/sim-idx\n```\n## API Reference\n\n### App Creation\n\n```typescript\nimport { create } from '@duneanalytics/sim-idx';\n\ninterface Env {\n  CUSTOM_VAR: string;\n}\n\nconst c = create\u003cEnv\u003e();\n```\n\n### Database Client\n\n```typescript\nimport { db } from '@duneanalytics/sim-idx';\n\n// Get database client from Hono context\nconst client = db.client(context);\n```\n\n### Blockchain Types\n\n```typescript\nimport { address, bytes32, uint256, int256 } from '@duneanalytics/sim-idx';\nimport { Address, Bytes, Uint, Int } from '@duneanalytics/sim-idx';\n\n// Address type\nconst walletAddress = address('wallet_address');\n\n// Bytes types (1-32 bytes)\nconst hash = bytes32('transaction_hash');\nconst shortData = bytes16('short_data');\n\n// Integer types\nconst balance = uint256('balance');\nconst signedValue = int256('signed_value');\n```\n\n## Middlewares\n\nThe library provides a middleware for authentication.\n\nWhen a valid Sim IDX API key is submitted in the `Authorization` header (please see [the documentation for authentication options](https://docs.sim.dune.com/idx/authentication#api)),\nyour API will receive the API key name in the `X-IDX-AUTHENTICATED-API-KEY-NAME` header. The authentication middleware uses this header to decide if a request is authenticated or not.\n\n```typescript\nimport { App, middlewares } from '@duneanalytics/sim-idx';\n\nconst app = App.create();\napp.use('*', middlewares.authentication);\n```\n\n*Note: In non-production environments, the authentication middleware will be disabled.*\n\n## Environment Variables\n\nThe library expects these environment variables:\n\n- `DB_CONNECTION_STRING`: Your database connection string\n- `NODE_ENV`: Set to `production` for production environments.\n\n## Development\n\n```bash\n# Install dependencies\npnpm install\n\n# Run tests\npnpm test\n\n# Build the library\npnpm build\n\n# Lint code\npnpm lint\n\n# Format code\npnpm fix:prettier\n```\n\n## Deploying\n\n1. First, update `package.json` with the next version number (and merge that)\n1. Then, create a new tag in the format of `v*.*.*` (check\n   https://github.com/duneanalytics/sim-idx-ts/tags for the latest tag) and\n   increase it accordingly.\n\n   Creating a new tag will run a Github action that will build \u0026 publish the\n   library to npm.\n1. Create a new release on GitHub with the same version number.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- 📖 [Documentation](https://github.com/duneanalytics/sim-idx-ts#readme)\n- 🐛 [Report a bug](https://github.com/duneanalytics/sim-idx-ts/issues)\n- 💬 [Discussions](https://github.com/duneanalytics/sim-idx-ts/discussions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduneanalytics%2Fsim-idx-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduneanalytics%2Fsim-idx-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduneanalytics%2Fsim-idx-ts/lists"}