sui-ts-sdklisted
Install: claude install-skill widnyana/eyay-toolkits
# Sui TypeScript SDK Skill
Write TypeScript code that interacts with the Sui blockchain using the `@mysten/sui` SDK (v2+). Follow these rules precisely. This skill covers PTB (Programmable Transaction Block) construction, client setup, transaction execution, and on-chain queries. These patterns apply equally in backend scripts and frontend apps. For frontend development, use the **sui-frontend** skill first (or alongside this one) for dApp Kit setup, wallet connection, and React integration — then apply the PTB and client patterns from this skill.
---
## 1. Package & Imports
The SDK package is `@mysten/sui`. The old package name `@mysten/sui.js` was renamed at v1.0 and must not be used.
```bash
# ✅
npm install @mysten/sui
# ❌ Deprecated package name — will not receive updates
npm install @mysten/sui.js
```
All imports use subpath exports from `@mysten/sui`:
```typescript
// ✅ Correct subpath imports
import { Transaction } from '@mysten/sui/transactions';
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
import { SuiGrpcClient } from '@mysten/sui/grpc';
// ❌ Old package name
import { TransactionBlock } from '@mysten/sui.js';
// ❌ Importing from package root
import { Transaction } from '@mysten/sui';
```
---
## 2. Client Setup
The SDK provides three client types. **Use `SuiGrpcClient` for new code** — it is the recommended client with the best performance. The JSON-RPC API is deprecated.
```typescript
// ✅ Recommended — gRPC client (best performance,