# Near Kit

TypeScript library for NEAR Protocol blockchain interaction.

- Repository: https://github.com/internet-court/internet-court-skill (7050 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-10-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add internet-court/internet-court-skill --skill near-kit -g -a claude-code -y`
Codex: `npx skills add internet-court/internet-court-skill --skill near-kit -g -a codex -y`
Cursor: `npx skills add internet-court/internet-court-skill --skill near-kit -g -a cursor -y`
Gemini CLI: `npx skills add internet-court/internet-court-skill --skill near-kit -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add internet-court/internet-court-skill`

## Description

TypeScript library for NEAR Protocol blockchain interaction. Use this skill when writing code that interacts with NEAR Protocol, including viewing contract data, calling contract methods, sending NEAR tokens, building transactions, creating type-safe contract wrappers, integrating wallets (Wallet Selector, HOT Connect), React hooks and providers (@near-kit/react), managing keys, testing with sandbox, meta-transactions (NEP-366), and message signing (NEP-413).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# near-kit

A TypeScript library for NEAR Protocol with an intuitive, fetch-like API.

## Quick Start

```typescript
import { Near } from "near-kit";

// Read-only (no key needed)
const near = new Near({ network: "testnet" });
const data = await near.view("contract.near", "get_data", { key: "value" });

// With signing capability
const near = new Near({
  network: "testnet",
  privateKey: "ed25519:...",
  defaultSignerId: "alice.testnet",
});
await near.call("contract.near", "method", { arg: "value" });
await near.send("bob.testnet", "1 NEAR");
```

## Import Cheatsheet

```typescript
// Core
import { Near } from "near-kit";

// Keys
import { generateKey, parseSeedPhrase, generateSeedPhrase } from "near-kit";
import { RotatingKeyStore, InMemoryKeyStore } from "near-kit";
import { FileKeyStore } from "near-kit/keys/file";
import { NativeKeyStore } from "near-kit/keys/native";

// Wallet adapters
import { fromHotConnect, fromWalletSelector } from "near-kit";

// NEP-413 verification
import { verifyNep413Signature } from "near-kit";

// Utilities
import { Amount, Gas, isValidAccountId } from "near-kit";
```

## Core Operations

### View Methods (Read-Only, Free)

```typescript
const result = await near.view("contract.near", "get_data", { key: "value" });
const balance = await near.getBalance("alice.near");
const exists = await near.accountExists("alice.near");
```

### Call Methods (Requires Signing)

```typescript
await near.call(
  "contract.near",
  "method",
  { arg: "value" },
  { gas: "30 Tgas", attachedDeposit: "1 NEAR" },
);
```

### Send NEAR Tokens

```typescript
await near.send("bob.near", "5 NEAR");
```

## Type-Safe Contracts

```typescript
import type { Contract } from "near-kit";

type MyContract = Contract<{
  view: {
    get_balance: (args: { account_id: string }) => Promise<string>;
  };
  call: {
    transfer: (args: { to: string; amount: string }) => Promise<void>;
  };
}>;

const contract = near.contract<MyContract>("token.near");

The rest: https://github.com/internet-court/internet-court-skill/blob/HEAD/vendored/near/near-kit/SKILL.md
