shogun-sdk
v1.3.53
Published
Shogun SDK - all in one: Money Legos, One Shot, Intents SDK, UI Kit, Turnkey (Passkey/Telegram) with React, Turnkey Library
Maintainers
Readme
Shogun SDK
A comprehensive TypeScript SDK for cross-chain DeFi operations, token swaps, and wallet management.
Quick Start
1. Install the SDK
Choose the installation method that works for your project:
npm
npm install shogun-sdkpnpm
pnpm add shogun-sdkyarn
yarn add shogun-sdk2. Use the SDK
import { LegoClient, useShogunQuote, Button } from 'shogun-sdk';
// Initialize client
const client = new LegoClient({ apiKey: 'YOUR_API_KEY' });
// Use React hooks
function MyComponent() {
const { quote, isLoading } = useShogunQuote();
return <Button>Swap Tokens</Button>;
}3. Explore the Documentation
Each package has detailed documentation and examples. See the links below for specific guides.
Packages Overview
The Shogun SDK is a monorepo containing multiple specialized packages:
Core Packages
| Package | Description | Installation |
|---------|-------------|--------------|
| shogun-sdk | Main SDK package that re-exports all other packages | npm install shogun-sdk |
| @shogun-sdk/money-legos | Core SDK for quotes, fees, balances, and cross-chain swaps | npm install @shogun-sdk/money-legos |
| @shogun-sdk/intents-sdk | Cross-chain intent-based transactions (EVM ↔ Solana ↔ Sui) | npm install @shogun-sdk/intents-sdk |
React Integration
| Package | Description | Installation |
|---------|-------------|--------------|
| @shogun-sdk/one-shot | React hooks and context providers for swap interfaces | npm install @shogun-sdk/one-shot |
| @shogun-sdk/ui-kit | React UI components built on Radix UI with Tailwind CSS | npm install @shogun-sdk/ui-kit |
Authentication & Wallet
| Package | Description | Installation |
|---------|-------------|--------------|
| @shogun-sdk/accounts | Turnkey wallet infrastructure integration (TypeScript) | npm install @shogun-sdk/accounts |
| @shogun-sdk/accounts-react | React components for Turnkey authentication and passkeys | npm install @shogun-sdk/accounts-react |
What Each Package Does
🔧 Core Functionality
- money-legos: The main engine for cross-chain swaps, price quotes, balance checking, and fee calculations
- intents-sdk: Advanced intent-based transactions for complex cross-chain operations
- shogun-sdk: Convenience package that includes everything in one install
⚛️ React Development
- one-shot: Hooks like
useShogunQuote,useTokenBalancesfor building swap UIs - ui-kit: Pre-built components like
Button,Card,Modalfor consistent design
🔐 Wallet & Auth
- turnkey: Server-side wallet creation and management
- turnkey-react: Client-side React components for login, passkeys, and authentication flows
Supported Chains
- EVM Chains: Ethereum, Arbitrum, Optimism, Base, BSC, Bera Chain, Sonic
- Solana: Native Solana support
- Sui: Native Sui blockchain support
Development
# Install dependencies
pnpm install
# Build all packages
pnpm run build
# Run tests
pnpm test
# Lint code
pnpm run lintExamples
Check out the examples directory for complete working examples:
- Web App Example: React app showing token swaps with UI components
Support
License
ISC
