internet-court/internet-court-skill / vendored/starknet/starknet-wallet
starknet-wallet
VerifiedCreate 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.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 1.1 KB |
| SKILL.md | skill md | 14.1 KB |
| agents/openai.yaml | config | 405 B |
| package.json | manifest | 387 B |
| scripts/README.md | markdown | 2.7 KB |
| scripts/check-balance.ts | script | 2.8 KB |
| scripts/check-balances.ts | script | 6.2 KB |
| scripts/rpc-spec-version.ts | script | 336 B |
scripts/README.md
View on GitHub# Starknet Wallet Scripts
Example scripts demonstrating wallet operations on Starknet.
## Setup
```bash
cd skills/starknet-wallet
npm install
```
Create a `.env` file:
```bash
STARKNET_RPC_URL=https://starknet-sepolia.g.alchemy.com/v2/YOUR_KEY
STARKNET_ACCOUNT_ADDRESS=0x...
STARKNET_PRIVATE_KEY=0x...
```
## Available Scripts
### Check Balance (Single Token)
```bash
npm run check-balance
```
Checks the balance of a single token (ETH by default). Uses the MCP server's `starknet_get_balance` tool.
**Usage:**
```typescript
// Edit check-balance.ts to change the token
const token = "ETH"; // or "STRK", "USDC", "USDT", or contract address
```
### Check Multiple Balances (Batch)
```bash
npm run check-balances
```
Efficiently queries multiple token balances in a single RPC call using the BalanceChecker contract.
**Features:**
- Queries up to 200 tokens at once
- Single RPC call (very efficient)
- Automatic fallback to batch RPC if contract unavailable
- Formatted output with token symbols and amounts
**Usage:**
```typescript
// Edit check-balances.ts to customize tokens
const tokens = ["ETH", "STRK", "USDC", "USDT"];
```
## Script Structure
Each script demonstrates:
1. Environment setup and validation
2. Connection to Starknet via RPC
3. Executing operations (balance queries, transfers, etc.)
4. Error handling and result formatting
5. Best practices for working with MCP tools
## Adding New Scripts
To add a new script:
1. Create a new TypeScript file in `scripts/`
2. Add npm script to `package.json`:
```json
{
"scripts": {
"your-script": "tsx scripts/your-script.ts"
}
}
```
3. Follow the pattern from existing scripts
4. Document usage in this README
## Common Patterns
### Token Amount Conversion
```typescript
import { cairo } from "starknet";
// Human readable → Wei (for transfers)
const amountWei = BigInt(1.5 * 10**18); // 1.5 ETH
const uint256Amount = cairo.uint256(amountWei);
// Wei → Human readable (from balance queries)
const balanceBigInt = BigInt(balance.low) + (BigInt(balance.high) << 128n);
const humanReadable = Number(balanceBigInt) / 10**decimals;
```
### Error Handling
```typescript
try {
const result = await operation();
console.log("Success:", result);
} catch (error) {
if (error.message.includes("INSUFFICIENT_BALANCE")) {
console.error("Not enough tokens");
} else if (error.message.includes("INVALID_NONCE")) {
console.error("Nonce mismatch - retry");
} else {
console.error("Error:", error.message);
}
}
```
## References
- [Starknet.js Documentation](https://www.starknetjs.com/)
- [MCP Server Tools](../../packages/starknet-mcp-server/README.md)
- [AVNU SDK](https://docs.avnu.fi/)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |