midnight-api

midnight-api is a skill for Claude Code, Codex from mzf11125/midnight_agent_skills. It costs 104 tokens per session (3,786 once invoked), scanned A, original, MIT.

An API integration guide for Midnight Network, a blockchain platform for privacy-preserving applications. It covers the TypeScript packages used to connect wallets, run contracts, create zero-knowledge proofs, and submit blockchain transactions.

In plain words
What is it for?
Use it when building a Midnight application that connects to a wallet, executes contracts, generates or verifies proofs, manages keys, or transfers tokens.
Why use it?
It brings the separate interfaces for wallets, applications, proofs, and transactions into one development reference.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building a Midnight application that connects to a wallet, executes contracts, generates or verifies proofs, manages keys, or transfers tokens.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mzf11125/midnight_agent_skills/midnight-api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mzf11125/midnight_agent_skills --skill midnight-api
Clone the repo
git clone --depth 1 https://github.com/mzf11125/midnight_agent_skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for midnight-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/mzf11125/midnight_agent_skills/midnight-api/github.svg)](https://agentmods.dev/skills/mzf11125/midnight_agent_skills/midnight-api)
Your own site
<a href="https://agentmods.dev/skills/mzf11125/midnight_agent_skills/midnight-api"><img src="https://agentmods.dev/badge/skills/mzf11125/midnight_agent_skills/midnight-api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for midnight-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/mzf11125/midnight_agent_skills/midnight-api"><img src="https://agentmods.dev/badge/skills/mzf11125/midnight_agent_skills/midnight-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,786 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00104 $0.03786
Opus 5 $0.00052 $0.01893
Sonnet 5 $0.00021 $0.00757
Haiku 4.5 $0.00010 $0.00379

Measured 9d ago against content hash b8554eeb5f80, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

midnight-api scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/deploy-contract.py, scripts/generate-api-client.py, scripts/init-dapp-project.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const state = await LedgerState.fetch(contractAddress);
midnight-api/SKILL.md · 590 lines

How it starts

The opening of the file, as written. The whole thing — 590 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Midnight API Integration (v8.0+)

Complete guide to integrating Midnight Network APIs for building privacy-preserving decentralized applications.

API Ecosystem Overview

Midnight provides multiple specialized APIs:

API Package Version Purpose
Midnight.js @midnight-ntwrk/midnight-js 4.0.4 Complete TypeScript SDK
Compact Runtime @midnight-ntwrk/compact-runtime 0.16.0 Execute contracts, generate ZK proofs
DApp Connector @midnight-ntwrk/dapp-connector-api 4.0.1 Connect to wallets
Ledger @midnight/ledger 8.0.3 Blockchain transactions
Wallet SDK @midnight-ntwrk/wallet-sdk-facade 3.0.0 Unified wallet operations, key management, transfers
Wallet API Various Latest Wallet operations

Quick Start

Install Dependencies

npm install @midnight-ntwrk/midnight-js
npm install @midnight-ntwrk/dapp-connector-api
npm install @midnight-ntwrk/compact-runtime
npm install @midnight/ledger
npm install @midnight-ntwrk/wallet-sdk-facade

Basic DApp Setup

import { MidnightProvider } from '@midnight-ntwrk/midnight-js';
import { DAppConnector } from '@midnight-ntwrk/dapp-connector-api';

// Connect to Midnight
const connect = async () => {
  // Check for injected wallet
  if (typeof window !== 'undefined' && window.midnight) {
    const provider = new MidnightProvider(window.midnight);
    await provider.ready;
    return provider;
  }
  throw new Error('Midnight wallet not found');
};

Core APIs

1. Midnight.js SDK (v4.0.4)

Complete JavaScript/TypeScript SDK for building DApps.

import { 
  MidnightProvider,    // Main provider
  Wallet,             // Wallet connection
  Contract,           // Contract instance
  Transaction,        // Transaction builder
  findById,           // Indexer queries
} from '@midnight-ntwrk/midnight-js';

// Network configuration (REQUIRED)
const network = 'preprod'; // or 'testnet-02', 'mainnet'

// Initialize provider
const provider = await MidnightProvider.fetch({ network });

// Connect wallet
const wallet = await provider.wallet();
// Or use DApp connector
const connector = new DAppConnector();
await connector.ready;

Read the full file on GitHub · 590 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 590 lines · 104 tokens per session scan A b8554eeb5f80

Subscribe to this mod's changes

midnight-api is a skill published in the GitHub repository mzf11125/midnight_agent_skills (6 stars, last pushed 2mo ago), licensed MIT. It adds 104 tokens to every session and 3,786 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

subgraph-development-guide

Guide to building blockchain data indexes with The Graph — subgraph architecture, schema design, mapping handlers, deployment, and querying. Covers GraphQL APIs for DEX data, token transfers, and DeFi protocol events. Use when explaining blockchain indexing or building custom data pipelines.

nirholas/three.ws · 59 tokens

chainlink-oracle-guide

How Chainlink oracle price feeds work — architecture, reading feeds on-chain, available pairs, the aggregator model, and oracle security. Covers how DeFi protocols (Aave, Sperax, Compound) rely on Chainlink for accurate pricing. Use when explaining oracles, price feeds, or DeFi infrastructure.

nirholas/three.ws · 68 tokens

web3auth-integration-guide

Guide to integrating Web3Auth for social login in Web3 dApps. Covers email, Google, Apple, Discord, and Twitter login flows. MPC key management, session handling, RainbowKit integration, and migration from traditional wallet-only flows. Zero-friction onboarding.

nirholas/three.ws · 60 tokens

migrate-to-portal

Migrate an existing Squid SDK indexer (EVM or Solana) off the v2 gateway and onto the Portal data source. Covers the package swap (@subsquid/evm-processor → @subsquid/evm-stream + @subsquid/evm-objects + @subsquid/batch-processor for EVM; @subsquid/solana-stream@^0.x → ^1.x for Solana), the API/type shape changes, and…

subsquid-labs/portal-mcp-server · 200 tokens

portal

Query blockchain data across 130+ networks with SQD Portal, including EVM, Solana, Substrate, Bitcoin, Tron, and Hyperliquid, and choose the right execution path: Portal MCP for bounded answers, Portal Stream API/curl for raw exports, or Pipes/Squid for durable pipelines.

subsquid-labs/portal-mcp-server · 64 tokens

quicknode-skill

Quicknode blockchain infrastructure for 80+ chains: Core RPC API, Streams, Webhooks, Blazar WSS, Solana gRPC, HyperCore gRPC, SQL Explorer, Metaplex DAS API, Blockbook, Ordinals & Runes API, Swap API, x402, MPP, Agent Subscriptions, CLI, and MCP. Use for any Quicknode product, blockchain data access, or wallet-paid…

quiknode-labs/blockchain-skills · 93 tokens