JACK TypeScript SDK
The JACK TypeScript SDK provides a comprehensive, type-safe interface for creating and managing cross-chain intents, tracking execution, and monitoring costs.
Quick Linksโ
Featuresโ
- ๐ Type-Safe: Full TypeScript support with comprehensive type definitions
- ๐ Automatic Retries: Built-in exponential backoff for transient failures
- ๐พ Smart Caching: Optional response caching to reduce API calls
- ๐ Execution Tracking: Real-time polling and event-based status updates
- ๐ Batch Operations: Submit and track multiple intents efficiently
- ๐ก๏ธ Error Handling: Detailed error types with context for debugging
- ๐ฆ Dual Module Support: Works with both ESM and CommonJS
- ๐ Dual Provider Support: LI.FI for DEX aggregation + Yellow Network for state channels
- โก Cross-Chain Routing: Seamless token swaps across Arbitrum, Optimism, Base, and Polygon
Installationโ
npm install @jack-kernel/sdk
Or with pnpm:
pnpm add @jack-kernel/sdk
Basic Usageโ
import { JACK_SDK } from '@jack-kernel/sdk';
// Initialize the SDK
const sdk = new JACK_SDK({
baseUrl: 'https://api.jack.example'
});
// Create intent parameters
const params = {
sourceChain: 'arbitrum',
destinationChain: 'base',
tokenIn: '0xUSDC...',
tokenOut: '0xWETH...',
amountIn: '1000000',
minAmountOut: '42000000000000000',
deadline: Date.now() + 3600000
};
// Get EIP-712 typed data for signing
const typedData = sdk.intents.getTypedData(params);
// Sign with your wallet
const signature = await wallet.signTypedData(typedData);
// Submit the signed intent
const intentId = await sdk.submitIntent(params, signature);
// Wait for settlement
const intent = await sdk.waitForSettlement(intentId);
console.log('Settlement tx:', intent.settlementTx);
Dual Provider Architectureโ
The SDK supports both LI.FI and Yellow Network providers working together:
const sdk = new JACK_SDK({
baseUrl: 'https://api.jack.example',
// LI.FI for cross-chain routing
lifi: {
integrator: 'jackkernel'
},
// Yellow Network for state channels
yellow: {
custodyAddress: '0x...',
adjudicatorAddress: '0x...',
chainId: 1,
walletClient: myWalletClient
}
});
Version Historyโ
v1.2.2 (Latest)โ
- Updated documentation with correct links
- Added community links (Discord, X)
- Documented dual provider architecture
v1.2.1โ
- Complete LI.FI SDK integration
- Settlement adapter contracts
- Contract documentation
- Social links across all apps
v1.1.0โ
- Yellow Network integration
- State channel management
- ERC-7824 support
Supportโ
- NPM Package: @jack-kernel/sdk
- Repository: GitHub
- Issues: GitHub Issues
- Discord: Join our community
- X (Twitter): @Jack_kernel
Next Stepsโ
- Installation & Setup - Get started with the SDK