git clone --depth 1 https://github.com/internet-court/internet-court-skill /tmp/near-dapp && cp -r /tmp/near-dapp/vendored/near/near-dapp ~/.claude/skills/near-dappSKILL.md
# NEAR dApp
## Decision Router
Determine which path to follow:
### Path A: New Project
User wants to create a new NEAR dApp from scratch.
1. Read [references/create-near-app.md](references/create-near-app.md)
2. Run scaffolding:
```bash
npx create-near-app@latest
```
Or with arguments:
```bash
npx create-near-app my-app --frontend vite-react --contract rs --install
```
**Framework options:** `vite-react` | `next-app` | `next-page`
**Contract options:** `rs` (Rust) | `ts` (TypeScript)
3. If user needs wallet connection in the scaffolded app, also follow Path B.
### Path B: Existing Project
User wants to add NEAR wallet connection to an existing React app.
1. Read [references/near-connect-hooks.md](references/near-connect-hooks.md) — React hooks API and patterns
2. If user needs low-level wallet API or non-React integration, also read [references/near-connect.md](references/near-connect.md)
**Quick setup:**
```bash
npm install near-connect-hooks @hot-labs/near-connect near-api-js
```
```tsx
// 1. Wrap app root with NearProvider
import { NearProvider } from 'near-connect-hooks';
<NearProvider config={{ network: 'mainnet' }}>
<App />
</NearProvider>
// 2. Use hook in components
import { useNearWallet } from 'near-connect-hooks';
const { signedAccountId, signIn, signOut, viewFunction, callFunction } = useNearWallet();
```
### Path C: Non-React or Vanilla JS
Use `@hot-labs/near-connect` directly without React hooks.
1. Read [references/near-connect.md](references/near-connect.md)
```bash
npm install @hot-labs/near-connect
```
```typescript
import { NearConnector } from "@hot-labs/near-connect";
const connector = new NearConnector({ network: "mainnet" });
connector.on("wallet:signIn", async (t) => {
const wallet = await connector.wallet();
const address = t.accounts[0].accountId;
});
await connector.connect();
```
## Key Patterns
- **Read contract state** (no wallet): `viewFunction({ contractId, method, args })`
- **Write to contract** (wallet required): `callFunction({ contractId, method, args, deposit })`
- **Transfer NEAR**: `transfer({ receiverId, amount })`
- **NEAR ↔ yoctoNEAR**: Use `nearToYocto()` / `yoctoToNear()` from `near-api-js`
- **1 NEAR** = `"1000000000000000000000000"` yoctoNEAR
- **Default gas**: `"30000000000000"` (30 TGas)0G Compute Network guide for decentralized AI inference, fine-tuning, and GPU services. Covers chatbots, image generation, speech-to-text, SDK integration (0g-serving-broker), processResponse API, broker.inference methods, CLI commands (0g-compute-cli), and account management. Use this skill for any 0G compute, 0G AI, or decentralized GPU question.
Give the AI agent its own EVM wallet with admin-controlled policies the agent CANNOT bypass even under prompt injection. Encrypted keystore (AES-256-GCM, scrypt KDF), policy file the agent has no tool to write, deterministic policy gate on every signing operation, optional local HTTP dashboard. Triggers: agent wallet, give the agent a wallet, agent address, fund the agent, agent autonomy, policy gate, kill switch, agent permissions, bounded autonomy, ERC-4337 alternative, session-key alternative.
Crypto wallet operations via the awal CLI — sign in, check balances, send USDC/ETH/POL/SOL, trade tokens, fund the wallet, and use the x402 payment protocol to discover paid services, pay for API calls, monetize an API, or query onchain data. Use whenever the user mentions signing in, login, authentication, wallet status, balance, address, sending money, paying someone, transferring tokens, ENS names, swapping/trading/converting tokens, funding/topping up/onramp, USDC, ETH, POL, SOL, the x402 bazaar, paid APIs, monetizing an endpoint, or querying onchain data on Base.
Help developers write code that interacts with Alkahest escrow contracts using the TypeScript, Rust, or Python SDK
Interact with Alkahest escrow contracts as a buyer, seller, or oracle using the CLI
Use this skill when the user asks to list, create, inspect, update, disable, re-enable, or revoke AltLLM Portal API keys for external agents or applications. Do NOT use for wallet login, billing history, or payment links.
Use this skill when the user asks to log in or out with a wallet session, fetch a wallet sign-in challenge, verify an externally signed challenge, or troubleshoot AltLLM Portal wallet login for the local altllm CLI. Do NOT use for API key management, billing history, or payment links.
Use this skill when the user asks to inspect AltLLM Portal balance, redeem a promo code, review billing transactions, or view usage analytics by period, model, or API key using the local altllm CLI. Do NOT use for API key lifecycle management or payment-link execution.