starknet-js

starknet-js is a skill for Claude Code, Codex from keep-starknet-strange/starknet-agentic. It costs 41 tokens per session (3,427 once invoked), scanned A, original, MIT.

A reference for using starknet.js version 9, a JavaScript library for connecting to Starknet and working with its smart contracts.

In plain words
What is it for?
Use it when building Starknet applications that manage accounts, call contracts, submit transactions, or integrate wallets.
Why use it?
It explains the pieces needed to read blockchain data, sign transactions, estimate fees, connect wallets, and use paymasters.

Skill for Claude CodeCodex

Written for Claude Code and Codex: allowed-tools in frontmatter, but also agents/openai.yaml present.

Part of the starknet-agentic-skills plugin — 19 skills, 2 commands, 1 plugin shipped together

Good fit Use it when building Starknet applications that manage accounts, call contracts, submit transactions, or integrate wallets.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/keep-starknet-strange/starknet-agentic/starknet-js
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 keep-starknet-strange/starknet-agentic --skill starknet-js
Clone the repo
git clone --depth 1 https://github.com/keep-starknet-strange/starknet-agentic

Made for: Claude Code, Codex.

Or install starknet-agentic-skills, the plugin that ships this one along with the rest of its 19 skills, 2 commands, 1 plugin.

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 starknet-js

README.md
[![agentmods](https://agentmods.dev/badge/skills/keep-starknet-strange/starknet-agentic/starknet-js/github.svg)](https://agentmods.dev/skills/keep-starknet-strange/starknet-agentic/starknet-js)
Your own site
<a href="https://agentmods.dev/skills/keep-starknet-strange/starknet-agentic/starknet-js"><img src="https://agentmods.dev/badge/skills/keep-starknet-strange/starknet-agentic/starknet-js/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 starknet-js

Your own site · 80×15
<a href="https://agentmods.dev/skills/keep-starknet-strange/starknet-agentic/starknet-js"><img src="https://agentmods.dev/badge/skills/keep-starknet-strange/starknet-agentic/starknet-js.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,427 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00041 $0.03427
Opus 5 $0.00020 $0.01714
Sonnet 5 $0.00008 $0.00685
Haiku 4.5 $0.00004 $0.00343

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

Security

Grade A, and why

starknet-js scanned grade A with 0 findings 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 10d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/account-example.ts), 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/starknet-js/SKILL.md · 500 lines

How it starts

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

starknet.js v9.x SDK

Related modules: skills catalog.

When to Use

  • Building Starknet apps with provider, account, contract, wallet, or paymaster flows.

When NOT to Use

  • Cairo contract authoring, deployment-only runbooks, or security audits.

Quick Start

npm install starknet

Minimal setup to read from Starknet:

import { RpcProvider, Contract } from 'starknet';

const provider = await RpcProvider.create({ nodeUrl: 'https://rpc.starknet.lava.build' });
const contract = new Contract(abi, contractAddress, provider);
const result = await contract.get_balance();

Core Architecture

Provider -> Account -> Contract
   |          |          |
Network   Identity   Interaction
  • Provider: Read-only network connection (RpcProvider)
  • Account: Extends Provider with signing and transaction capabilities
  • Contract: Type-safe interface to deployed contracts

Use Provider for read operations, Account for write operations.

Provider Setup

import { RpcProvider } from 'starknet';

// Recommended: Auto-detect RPC spec version
const provider = await RpcProvider.create({
  nodeUrl: 'https://rpc.starknet.lava.build'
});

Networks:

  • Mainnet: https://rpc.starknet.lava.build
  • Sepolia: https://rpc.starknet-testnet.lava.build

Key Methods:

const chainId = await provider.getChainId();
const block = await provider.getBlock('latest');
const nonce = await provider.getNonceForAddress(accountAddress);
await provider.waitForTransaction(txHash);

// Read storage directly
const value = await provider.getStorageAt(contractAddress, storageKey);

Account Management

Account Creation (4 Steps)

Step 1: Compute address

import { hash, ec, encode, CallData } from 'starknet';

// IMPORTANT: `stark.randomAddress()` returns an address-like random felt and is NOT a private key.
// Use a real stark curve private key generator.
const privateKey = '0x' + encode.buf2hex(ec.starkCurve.utils.randomPrivateKey());
const publicKey = ec.starkCurve.getStarkKey(privateKey);

// NOTE: account class hashes are network/account-type dependent.
// Treat this as an example only (verify the correct class hash for your setup).
const classHash = '0x540d7f5ec7ecf317e68d48564934cb99259781b1ee3cedbbc37ec5337f8e688'; // example

const constructorCalldata = CallData.compile({ publicKey });
const address = hash.calculateContractAddressFromHash(publicKey, classHash, constructorCalldata, 0);

Read the full file on GitHub · 500 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 500 lines · 41 tokens per session scan A f180f2766f26

Subscribe to this mod's changes

starknet-js is a skill published in the GitHub repository keep-starknet-strange/starknet-agentic (80 stars, last pushed 2d ago), licensed MIT. It adds 41 tokens to every session and 3,427 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

starknet-js

Reference for building Starknet applications using starknet.js v9.x SDK, including contract interaction, account management, transaction handling, fee estimation, wallet integration, and paymaster flows.

internet-court/internet-court-skill · 41 tokens

starknet-wallet

Create and manage Starknet wallets for AI agents. Transfer tokens, check balances, manage session keys, deploy accounts, and interact with smart contracts using native Account Abstraction.

internet-court/internet-court-skill · 39 tokens

starknet-js

Use when writing or debugging JavaScript/TypeScript that interacts with Starknet through the starknet.js SDK — building Call objects or calldata, encoding/decoding Cairo types (felt252, u256, structs, arrays, spans, ByteArray, Option/Result/custom enums), or working with contracts, accounts, providers, transactions…

starknet-io/starknet.js · 79 tokens

nexflow-smf-route-matrix-v1

Compute a priced route matrix for x402-style payments (e.g. USDC on Base) using NexFlow SMF. Use this to compare facilitators before choosing one.

NexFlow-SMF/nexflow-smf-public · 46 tokens

nexflow-smf-list-facilitators-v1

Discover active facilitators for x402 payments from NexFlow SMF. Use to see who can route payments on a given network/asset before quoting or paying.

NexFlow-SMF/nexflow-smf-public · 45 tokens

nexflow-smf-settlement-receipt-v1

Fetch a compact settlement receipt for a previously completed x402 payment from NexFlow SMF for logging, audits, or verification.

NexFlow-SMF/nexflow-smf-public · 38 tokens