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

injectos-injective-sdk

v0.1.0

Published

The InjectOS Injective SDK is the standalone blockchain communication layer for InjectOS.

Readme

InjectOS Injective SDK

The InjectOS Injective SDK is the standalone blockchain communication layer for InjectOS.

It is built as a lightweight TypeScript package that turns Injective EVM into an AI-native execution runtime for the InjectOS workflow:

User Prompt -> Intent Parsing -> Safety Verification -> Transaction Preview -> Human Approval -> Injective Execution -> Execution Monitoring -> Completion Status

This package is designed for the InjectOS command center, backend orchestration services, future automation workers, and any application that needs a safe, realtime, frontend-friendly Injective integration.

Repository: https://github.com/rohan911438/Inject-OS

Product Goals

  • Make Injective EVM feel like the core transport layer of an AI operating system.
  • Keep blockchain communication modular, typed, and easy to reason about.
  • Expose wallet, simulation, execution, safety, event, and analytics primitives in one place.
  • Support a mission-control style frontend where workflow state updates in realtime.
  • Stay hackathon-friendly and Remix-compatible while remaining easy to extend later.

What This SDK Does

  • Detects MetaMask or any injected EIP-1193 wallet.
  • Switches users to Injective EVM Testnet when they are on the wrong chain.
  • Wraps the deployed InjectOS contracts with ethers.js helpers.
  • Generates deterministic execution previews for SAFE and OPTIMIZED modes.
  • Submits and reads safety analysis onchain.
  • Listens to workflow events and synchronizes execution state.
  • Collects ecosystem metrics from Injective-compatible RPC endpoints.
  • Exposes a clean API that can be consumed from a frontend dashboard or backend orchestration engine.

Workflow Coverage

The SDK is centered on the exact InjectOS pipeline:

  1. User prompt enters the command center.
  2. Intent is parsed into an execution plan.
  3. Safety logic scores the request and verifies the route.
  4. A transaction preview is generated with output, slippage, and gas context.
  5. The human operator approves or rejects the action.
  6. The execution transaction is sent through Injective EVM.
  7. Smart contract events stream back into the UI.
  8. The workflow is marked completed or failed with a synchronized state snapshot.

Package Layout

src/lib/injective/
  constants.ts   - chain config, contract addresses, workflow enums
  provider.ts    - ethers.js provider helpers and network switching
  wallet.ts      - MetaMask connection and status detection
  contracts.ts   - InjectOS contract ABIs and contract wrappers
  execution.ts   - execution state store and state synchronization helpers
  safety.ts      - local safety analysis and onchain safety submission
  events.ts      - contract event listeners and realtime workflow updates
  simulation.ts  - preview generation and SAFE/OPTIMIZED simulation helpers
  analytics.ts   - network health, activity, and ecosystem metrics helpers

Contract Addresses

The SDK is preconfigured with the current Remix deployments:

  • InjectOSEvents - 0x33491e1b1fbD9F1d757a0ABd1a2930D189d4990E
  • InjectOSExecution - 0x975839Ce675306f2329c526F70c64D803828E9D9
  • InjectOSStorage - 0xff0Ea64C7B7046929CAcDFeDd32D0d4208F00266
  • InjectOSSafety - 0xd7412cB8b75A45fe5aD6bF9Ca5500811BA3B3e97

InjectOSInterfaces.sol is source-only and is not deployed by itself.

Injective EVM Configuration

The SDK uses the following Injective EVM defaults:

  • Chain name: Injective EVM Testnet
  • Chain ID: 2525
  • RPC: https://mainnet.rpc.inevm.com/http
  • Explorer: https://inevm.calderaexplorer.xyz

These values live in src/lib/injective/constants.ts.

Install

npm install

Build

npm run build

Usage Example

import {
  connectMetaMaskToInjective,
  getBrowserProvider,
  getExecutionContract,
  simulateSwapPreview,
  executionStore
} from "./src/index.js";

const wallet = await connectMetaMaskToInjective();
const provider = getBrowserProvider();
const signer = await provider.getSigner();
const executionContract = getExecutionContract(signer);

const preview = simulateSwapPreview(1000n, "SAFE");
console.log(preview.summary);

const state = executionStore.getState();
console.log(state.workflowState);

Key Capabilities

  • wallet.ts handles wallet discovery, chain switching, and connection state.
  • provider.ts standardizes read/write access through ethers.js.
  • contracts.ts keeps the contract ABI surface aligned with the deployed Solidity workflow.
  • simulation.ts generates deterministic previews that match the InjectOS UX rules.
  • safety.ts mirrors the local safety policy used by the broader InjectOS product.
  • events.ts converts blockchain events into immediate workflow updates.
  • execution.ts acts as the workflow state machine for frontend synchronization.
  • analytics.ts exposes network and activity telemetry for dashboard widgets.

Frontend Integration Notes

The SDK is intentionally frontend-friendly:

  • Use it from React pages, Zustand stores, or framework-agnostic services.
  • Use the execution store to keep UI state synchronized with blockchain state.
  • Use event listeners to drive realtime dashboard animations and workflow badges.
  • Use preview helpers before any signature request reaches MetaMask.

Safety Behavior

The local safety layer follows the InjectOS policy:

  • confidence score must be at least 80
  • slippage must be 5 or less
  • ambiguity must be false

SAFE mode and OPTIMIZED mode are simulated as follows:

  • SAFE: 10 USDT = 0.1 INJ
  • OPTIMIZED: 10 USDT = 0.2 INJ

Notes

  • The SDK is intentionally modular and easy to expand.
  • It uses ethers.js for all Injective EVM communication.
  • It is safe to point the constants file at a different Injective RPC if the deployment target changes.
  • The package is designed to be readable first and protocol-complete second, which fits the InjectOS hackathon MVP goal.