/starknet-agentic-skills:starknet-anonymous-walletfrom starknet-agentic-skills
Creates anonymous Starknet wallets via Typhoon and interacts with Starknet contracts, including reads, writes, preflight simulation, and allowance checks.
Ships in starknet-agentic-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill provides agent-facing scripts for:
references/ (ABI discovery, Typhoon account flow, preflight/fee simulation notes)scripts/create-account.js, scripts/parse-smart.js, scripts/resolve-smart.jsscripts/read-smart.js, scripts/invoke-contract.js, scripts/avnu-swap.jsscripts/read-smart.js (call ERC20 allowance(owner, spender))npm install starknet@^10.8.0 typhoon-sdk@^1.1.13 @andersmyrmel/vard@^1.2.0 @avnu/avnu-sdk@^4.2.0 compromise@^14.14.5 ws@^8.19.0
starknet.js 10 requires Node.js 22+.
These scripts talk to Starknet via JSON-RPC. Configure one of:
STARKNET_RPC_URL in your environment (recommended), ORrpcUrl in the JSON input for scripts that support it.If neither is provided, scripts fall back to Cartridge's keyless public mainnet RPC (spec 0.10, rate limited):
https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10This endpoint has no WebSocket support, so watch-events-smart.js falls back to HTTP polling unless you pass a wsRpcUrl from your own provider.
scripts/avnu-swap.js executes swaps through the AVNU paymaster in default fee mode: gas is paid in an ERC-20 rather than from the account's STRK balance. No paymaster API key is needed; sponsored (dApp-paid) mode is not used.
"gasToken":"STRK" (any verified symbol the paymaster accepts) to override it.quoteToCalls, asks the paymaster for a fee estimate, then runs account.executePaymasterTransaction, which refuses to sign unless the typed data holds exactly those calls plus one gas-token transfer no larger than the estimate's suggested_max_fee_in_gas_token. That cap is reported as maxFeeInGasToken (gas token base units)."maxGasFee":"0.5" (gas token units) to set an independent ceiling; the swap aborts before signing if the paymaster asks for more.STARKNET_RPC_URL: SN_MAIN uses starknet.api.avnu.fi and starknet.paymaster.avnu.fi; SN_SEPOLIA uses sepolia.api.avnu.fi and sepolia.paymaster.avnu.fi. Any other chain ID stops the script with Unsupported Starknet chain ID ... before AVNU is called. Token symbols resolve against that network's list of AVNU-verified tokens (also in parse-smart.js, resolve-smart.js and vesu-pool.js). vesu-pool.js also refuses a pool whose protocols.json network (VESU.pools[name].network, else VESU.network) is not the RPC's (mainnet or sepolia).PAYMASTER_URL overrides the default paymaster. It must be https://, only starknet.paymaster.avnu.fi and sepolia.paymaster.avnu.fi are accepted, and it must match the RPC's network; for example, the Sepolia paymaster with a mainnet RPC fails with Paymaster ... serves SN_SEPOLIA, but the RPC is on SN_MAIN.AVNU returned no verified tokens for SN_SEPOLIA or No quotes available for this swap on SN_SEPOLIA.import { RpcProvider, Account, Contract } from 'starknet';
const provider = new RpcProvider({
nodeUrl: process.env.STARKNET_RPC_URL || 'https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10'
});
// signer can be a private key string or Starknet Signer instance
const account = new Account({
provider,
address: process.env.ACCOUNT_ADDRESS,
signer: process.env.PRIVATE_KEY
});
const contract = new Contract({
abi,
address: contractAddress,
providerOrAccount: account
});
// read
const balance = await contract.call('balance_of', [account.address]);
// write (sign -> send -> wait)
const tx = await contract.invoke('transfer', [to, amount], { waitForTransaction: false });
const receipt = await provider.waitForTransaction(tx.transaction_hash);
Common calls:
provider.getBlock('latest')provider.callContract({ contractAddress, entrypoint, calldata })provider.getClassAt(contractAddress)RPC_UNAVAILABLE → Verify STARKNET_RPC_URL, check network reachability, retry with backoff.INVALID_ADDRESS → Validate 0x... address format and expected network/account.INSUFFICIENT_FUNDS → Check STRK/token balances before write calls; reduce amount or top up.CONTRACT_CALL_FAILURE → Run read/simulate first, log contract/method/calldata, retry only for transient RPC errors.EXEC:node scripts/parse-smart.js '{"prompt":"STRING"}'
OUT (success):
{
"success": true,
"security": {"safe": true},
"tokens": ["ETH","STRK"],
"tokenMap": {"STRK":{"address":"0x...","decimals":18}},
"protocols": ["Ekubo","AVNU"],
"abis": {"Ekubo":["swap"],"AVNU":["swap"]},
"addresses": {"Ekubo":"0x...","AVNU":"0x01"}
}
OUT (no account):
{
"success": true,
"canProceed": false,
"needsAccount": true,
"operationType": "NO_ACCOUNT",
"noAccountGuide": {"steps": [...]},
"nextStep": "CREATE_ACCOUNT_REQUIRED"
}
OUT (account creation intent):
{
"success": true,
"canProceed": false,
"operationType": "CREATE_ACCOUNT_INTENT",
"hasAccount": true|false,
"noAccountGuide": {"steps": [...]},
"nextStep": "ACCOUNT_ALREADY_EXISTS|CREATE_ACCOUNT_REQUIRED"
}
LLM builds:
{
"parsed": {
"operations": [{"action":"swap","protocol":"AVNU","tokenIn":"ETH","tokenOut":"STRK","amount":10}],
"operationType": "WRITE|READ|EVENT_WATCH|CONDITIONAL",
"tokenMap": {...},
"abis": {...},
"addresses": {...}
}
}
EXEC:node scripts/resolve-smart.js '{"parsed":{...}}'
OUT (authorization required):
{
"canProceed": true,
"nextStep": "USER_AUTHORIZATION",
"authorizationDetails": {"prompt":"Authorize? (yes/no)"},
"executionPlan": {"requiresAuthorization": true}
}
RULE:
nextStep == "USER_AUTHORIZATION", ask the user for explicit confirmation.AVNU SDK sequence for WRITE/CONDITIONAL (boilerplate):
RpcProvider + Account).Typical AVNU SDK calls in this skill:
fetchTokens(...)getQuotes(...)quoteToCalls(...), then account.estimatePaymasterTransactionFee(...) and account.executePaymasterTransaction(calls, details, maxFee) (starknet.js checks the paymaster's typed data before signing; avoid avnu-sdk's executeSwap with a paymaster, which signs it unchecked){
"watchers": [{
"action": "swap",
"protocol": "AVNU",
"tokenIn": "STRK",
"tokenOut": "ETH",
"amount": 10,
"condition": {
"eventName": "Swapped",
"protocol": "Ekubo",
"timeConstraint": {"amount":5,"unit":"minutes"}
}
}]
}
TimeConstraint → creates cron job with TTL auto-cleanup.
agents/openai.yaml (opens in a new tab)package.json (opens in a new tab)protocols.json (opens in a new tab)references/argentx-class-hashes.md (opens in a new tab)scripts/_keys.js (opens in a new tab)scripts/_network.js (opens in a new tab)scripts/_rpc.js (opens in a new tab)scripts/_tokens.js (opens in a new tab)scripts/avnu-swap.js (opens in a new tab)scripts/create-account.js (opens in a new tab)scripts/invoke-contract.js (opens in a new tab)scripts/loot-survivor.js (opens in a new tab)scripts/parse-smart.js (opens in a new tab)scripts/read-smart.js (opens in a new tab)scripts/resolve-smart.js (opens in a new tab)scripts/synonyms.js (opens in a new tab)scripts/test-parse.js (opens in a new tab)scripts/vesu-pool.js (opens in a new tab)scripts/watch-events-smart.js (opens in a new tab)skill.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
starknet, anonymous-wallet, typhoon, privacy, contract-interaction
npx claudepluginhub keep-starknet-strange/starknet-agentic --plugin starknet-agentic-skills18 skills in this plugin
/account-abstractionStarknet account abstraction correctness and security guidance for validate/execute paths, nonces, signatures, and session policies./cairo-auditorSecurity audit of Cairo/Starknet code. Trigger on "audit", "check this contract", "review for security". Modes - default (full repo), deep (+ adversarial reasoning), or specific filenames./cairo-contract-authoringCairo smart-contract authoring on Starknet. Trigger on "write a contract", "create a contract", "implement this in Cairo", "add storage/events/interface", "compose components". Guides structure, security patterns, and component wiring./cairo-deployDeployment guidance for Cairo contracts on Starknet covering sncast commands, account setup, declare/deploy workflow, network configuration, and contract verification./cairo-optimizationImproves Cairo performance after correctness is established. Trigger on "optimize", "gas usage", "reduce steps", "profile", "BoundedInt", "storage packing", "benchmark". Guides profiling, arithmetic optimization, and bounded-int hardening./cairo-testingCairo smart-contract testing with snforge. Trigger on "write tests", "add unit tests", "fuzz test", "integration test", "test this contract", "regression test". Guides test strategy, cheatcode usage, and coverage.Other plugins' skills for the same job