usdtkit-sdk
v1.0.0
Published
A TypeScript/Node.js SDK for interacting with **USDT0 (gUSDT)** on **StableChain**, a Layer 1 blockchain purpose-built for stablecoin settlement.
Readme
StableChain gUSDT SDK
A TypeScript/Node.js SDK for interacting with USDT0 (gUSDT) on StableChain, a Layer 1 blockchain purpose-built for stablecoin settlement.
StableChain is designed for predictable, high-performance stablecoin operations, offering:
- USDT-native gas model (transactions are paid in USDT0)
- Sub-second deterministic finality via StableBFT
- EVM compatibility
- Enterprise-grade features such as reserved blockspace and confidential transfers
- Optimizations for high-frequency payment flows
:contentReference[oaicite:1]{index=1}
This SDK provides a lightweight interface to transfer gUSDT, read balances, and prepare payment flows using StableChain's RPC infrastructure.
⚙️ Features
✔ USDT0/gUSDT Transfer
Initiate stablecoin transfers using USDT as both asset and gas fee currency.
✔ Read Balances
Query ERC-20 compliant balanceOf for any StableChain address.
✔ Fully Typed (TypeScript)
Auto-generated declarations for safe usage across backend services.
✔ Ethers v6 Compatible
Uses modern provider and contract patterns.
✔ RPC Plug-and-Play
Works with any StableChain-compatible RPC endpoint.
🧠 StableChain Technical Overview
StableChain is a specialized Layer 1 designed for stablecoin settlement at Internet scale, optimized around three core objectives:
:contentReference[oaicite:2]{index=2}
1. USDT-native settlement
StableChain eliminates volatile gas tokens by using USDT (USDT0) as the gas currency.
Every transfer is executed and paid entirely in USDT.
2. Performance specialization
- Sub-second finality via StableBFT
- Low-latency execution via Stable EVM
- Optimized state handling via StableDB
- High-performance RPC layer with real-time streaming capabilities
:contentReference[oaicite:3]{index=3}
3. Enterprise-grade infrastructure
StableChain provides features typically unavailable in general-purpose blockchains:
- Guaranteed blockspace
- Confidential transfers
- Batch processing for payroll and remittance systems
- Compliance-aligned settlement
:contentReference[oaicite:4]{index=4}
This SDK directly integrates with these architectural principles through the Stable RPC layer.
📦 Installation
(Replace with your actual package name.)
🔧 Basic Usage
import { initStable, USDT } from "stablechain-gusdt-sdk";
const RPC = "https://rpc.testnet.stable.xyz";
// gUSDT contract on Stable Testnet
const USDT_ADDRESS = "0x0000000000000000000000000000000000001000";
// Initialize provider
const provider = initStable(RPC);
// Initialize token interface
const usdt = new USDT(provider, USDT_ADDRESS);
const address = "0x1234...";
const balance = await usdt.balanceOf(address);
console.log("Balance:", balance.toString());
const PRIVATE_KEY = process.env.PRIVATE_KEY!;
const to = "0xRecipientAddress";
// 0.05 gUSDT (assuming 6 decimals = 50,000 units)
const amount = "50000";
const tx = await usdt.transfer(PRIVATE_KEY, to, amount);
console.log("Sent:", tx.hash);
/src
stable.ts → RPC initialization
usdt.ts → ERC-20 interface for USDT0/gUSDT
index.ts → Public exports
/abis/usdt.json → Minimal ERC-20 ABI
export function initStable(rpc: string) {
return new JsonRpcProvider(rpc);
}
provider.on("pending", async hash => {
const tx = await provider.getTransaction(hash);
if (tx?.to?.toLowerCase() === myAddress.toLowerCase()) {
console.log("Incoming payment:", tx.hash);
}
});