npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lukas-protocol/sdk

v0.2.22

Published

TypeScript SDK for interacting with the Lukas Protocol smart contracts

Readme

Lukas SDK

A comprehensive TypeScript SDK for interacting with the Lukas Protocol smart contracts.

🚀 Quick Setup

Installation

npm install @lukas-protocol/sdk
# or
yarn add @lukas-protocol/sdk
# or
pnpm add @lukas-protocol/sdk

Basic Usage

import { LukasSDK } from '@lukas-protocol/sdk';

// Initialize the SDK (read-only mode)
const sdk = new LukasSDK({
  network: {
    chainId: 80002, // Polygon Amoy testnet
    name: 'amoy',
  },
});

// Get token information
const tokenInfo = await sdk.getContractManager().getTokenInfo();
console.log('Token:', tokenInfo);

// Check network info
const networkInfo = sdk.getNetworkInfo();
console.log('Network:', networkInfo);

With Wallet Provider

import { LukasSDK } from '@lukas-protocol/sdk';
import { BrowserProvider } from 'ethers';

// Connect with MetaMask or other wallet
const provider = new BrowserProvider(window.ethereum);

const sdk = new LukasSDK({
  network: {
    chainId: 80002,
    name: 'amoy',
  },
  provider,
});

// Now you can perform write operations
const signer = sdk.getSigner();
if (signer) {
  // Transfer tokens, approve, etc.
}

React Integration

import { useLukasSDK } from '@lukas-protocol/sdk/react';

function MyComponent() {
  const { sdk, isConnected } = useLukasSDK();
  
  // Use SDK in your component
  const handleGetBalance = async () => {
    const balance = await sdk.getContractManager().getBalance(address);
    console.log('Balance:', balance);
  };
  
  return <button onClick={handleGetBalance}>Get Balance</button>;
}

📚 Features

  • 🔒 Type Safe: Full TypeScript support with comprehensive type definitions
  • 🌐 Multi-Network: Support for mainnet, testnets, and custom networks
  • 🔄 Network Switching: Automatic network detection and switching
  • 💰 Token Operations: Transfer, approve, and manage LUKAS tokens
  • 📊 Oracle Data: Access real-time price and peg information
  • 🏦 Vault Operations: Interact with the stabilization vault
  • 💧 Liquidity Management: Add and remove liquidity from pools
  • ⚛️ React Integration: Built-in React hooks for easy integration
  • 🔄 Automatic Retries: Built-in retry logic with exponential backoff
  • 📝 Comprehensive Logging: Detailed logging and error handling
  • Property-Based Testing: Thoroughly tested with property-based tests

🔧 Configuration

Network Configuration

const sdk = new LukasSDK({
  network: {
    chainId: 80002,
    name: 'amoy',
    rpcUrl: 'https://rpc-amoy.polygon.technology', // Optional
    blockExplorer: 'https://amoy.polygonscan.com', // Optional
  },
  options: {
    enableCaching: true,
    cacheTimeout: 30000, // 30 seconds
    retryAttempts: 3,
    retryDelay: 1000,
    logLevel: 'info',
  },
});

Custom Contract Addresses

const sdk = new LukasSDK({
  network: {
    chainId: 80002,
    name: 'amoy',
  },
  contracts: {
    lukasToken: '0x...',
    stabilizerVault: '0x...',
    latAmBasketIndex: '0x...',
    lukasHook: '0x...',
    usdc: '0x...',
  },
});

📖 Core Concepts

Network Management

The SDK supports multiple networks and automatic network switching:

// Switch networks
await sdk.switchNetwork(1); // Switch to mainnet

// Auto-detect provider network
const networkInfo = await sdk.autoDetectNetwork();

// Monitor network changes
sdk.onNetworkChange((networkInfo) => {
  console.log('Network changed:', networkInfo);
});

// Start automatic monitoring
sdk.startNetworkMonitoring();

Contract Manager

Access smart contracts through the Contract Manager:

const contractManager = sdk.getContractManager();

// Get token information
const tokenInfo = await contractManager.getTokenInfo();

// Get balances
const balance = await contractManager.getBalance(address);

// Get contract instances
const lukasToken = contractManager.getLukasToken();
const vault = contractManager.getStabilizerVault();

Read-Only vs Write Operations

The SDK automatically detects if a signer is available:

// Check if in read-only mode
if (sdk.isReadOnly()) {
  console.log('Read-only mode - connect a wallet for write operations');
}

// Require signer for write operations
try {
  const signer = sdk.requireSigner();
  // Perform write operations
} catch (error) {
  console.error('Signer required:', error);
}

🌐 Supported Networks

  • Polygon Amoy Testnet (chainId: 80002) - Default testnet
  • Custom Networks - Configure your own network and contract addresses

📦 Package Structure

@lukas-protocol/sdk
├── core/           # Core SDK functionality
├── services/       # Service interfaces
├── types/          # TypeScript type definitions
├── errors/         # Error handling
├── utils/          # Utility functions
└── react/          # React integration (optional)

🔗 Links

🤝 Contributing

This package is part of the Lukas Protocol monorepo. See the main README for development instructions.

📄 License

MIT