
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@duneanalytics/sim-idx
Advanced tools
A TypeScript library for writing Sim IDX apps.
npm install @duneanalytics/sim-idx
# or
yarn add @duneanalytics/sim-idx
# or
pnpm add @duneanalytics/sim-idx
import { create } from '@duneanalytics/sim-idx';
interface Env {
  CUSTOM_VAR: string;
}
const c = create<Env>();
import { db } from '@duneanalytics/sim-idx';
// Get database client from Hono context
const client = db.client(context);
import { address, bytes32, uint256, int256 } from '@duneanalytics/sim-idx';
import { Address, Bytes, Uint, Int } from '@duneanalytics/sim-idx';
// Address type
const walletAddress = address('wallet_address');
// Bytes types (1-32 bytes)
const hash = bytes32('transaction_hash');
const shortData = bytes16('short_data');
// Integer types
const balance = uint256('balance');
const signedValue = int256('signed_value');
The library provides a middleware for authentication.
When a valid Sim IDX API key is submitted in the Authorization header (please see the documentation for authentication options),
your 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.
import { App, middlewares } from '@duneanalytics/sim-idx';
const app = App.create();
app.use('*', middlewares.authentication);
Note: In non-production environments, the authentication middleware will be disabled.
The library expects these environment variables:
DB_CONNECTION_STRING: Your database connection stringNODE_ENV: Set to production for production environments.# Install dependencies
pnpm install
# Run tests
pnpm test
# Build the library
pnpm build
# Lint code
pnpm lint
# Format code
pnpm fix:prettier
First, update package.json with the next version number (and merge that)
Then, create a new tag in the format of v*.*.* (check
https://github.com/duneanalytics/sim-idx-ts/tags for the latest tag) and
increase it accordingly.
Creating a new tag will run a Github action that will build & publish the library to npm.
Create a new release on GitHub with the same version number.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A TypeScript library for writing Sim IDX apps
We found that @duneanalytics/sim-idx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.