SDKsTypeScriptOverview

TypeScript SDK

The T402 TypeScript SDK provides comprehensive support for HTTP-native stablecoin payments across multiple blockchains.

v2.0.0 Released - All packages are now published under the @t402 namespace on npm.

Core Packages

PackageVersionDescription
@t402/core2.0.0Protocol types and HTTP utilities
@t402/extensions2.0.0Protocol extensions and helpers

Blockchain Mechanisms

PackageVersionDescription
@t402/evm2.2.0EVM chains (Ethereum, Arbitrum, Base, etc.) with EIP-3009
@t402/svm2.0.0Solana blockchain with SPL token transfers
@t402/ton2.1.0TON blockchain with USDT Jetton support
@t402/tron2.0.0TRON blockchain with TRC-20 USDT

WDK Integration (Tether Wallet Development Kit)

PackageVersionDescription
@t402/wdk2.0.1Tether WDK integration for self-custodial wallets
@t402/wdk-gasless1.0.0Gasless payments via ERC-4337 account abstraction
@t402/wdk-bridge1.0.0Cross-chain bridging via LayerZero OFT
@t402/wdk-multisig1.0.0Safe multi-signature wallet support

HTTP Server Frameworks

FrameworkPackageVersion
Express.js@t402/express2.0.0
Next.js@t402/next2.0.0
Hono@t402/hono2.0.0
Fastify@t402/fastify2.0.0

HTTP Client Libraries

ClientPackageVersion
Fetch API@t402/fetch2.0.0
Axios@t402/axios2.0.0

UI Components

PackageVersionDescription
@t402/paywall2.0.0Universal paywall component (framework-agnostic)
@t402/react2.0.0React hooks and components
@t402/vue2.0.0Vue 3 composables and components

Tools

PackageVersionDescription
@t402/cli2.0.0Command-line tools for testing and development
@t402/mcp1.0.0MCP server for AI agent payments

Quick Install

# Core + EVM (most common)
pnpm add @t402/core @t402/evm
 
# With Express middleware
pnpm add @t402/core @t402/evm @t402/express
 
# Full client setup with fetch wrapper
pnpm add @t402/core @t402/evm @t402/fetch
 
# Multi-chain support
pnpm add @t402/core @t402/evm @t402/svm @t402/ton @t402/tron

Architecture

@t402/core              Base types, HTTP utilities

    ├── @t402/evm       EVM mechanism (EIP-3009, ERC-4337, LayerZero)

    ├── @t402/svm       Solana mechanism (SPL tokens)

    ├── @t402/ton       TON mechanism (Jettons)

    ├── @t402/tron      TRON mechanism (TRC-20)

    └── @t402/wdk       Tether WDK integration

        ├── @t402/wdk-gasless   ERC-4337 gasless payments

        ├── @t402/wdk-bridge    LayerZero cross-chain bridge

        └── @t402/wdk-multisig  Safe multi-sig wallets

Requirements

  • Node.js 18+ or Bun 1.0+
  • TypeScript 5.0+ (recommended)
  • ESM or CommonJS supported