Skip to main content

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.

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โ€‹

Next Stepsโ€‹