Lxly.js

Production-ready JavaScript SDK for building cross-chain applications with Agglayer's Unified Bridge

Overview

Lxly.js is the official JavaScript SDK for interacting with Agglayer's Unified Bridge. It provides a simple, intuitive API that abstracts the complexity of cross-chain operations, making it easy for developers to build sophisticated multi-chain applications without deep knowledge of bridge internals.

Key Benefits:

  • Simple Integration: Easy-to-use APIs that abstract complex bridge operations
  • Production Ready: Battle-tested in production environments with comprehensive error handling
  • TypeScript Support: Full TypeScript definitions for better development experience
  • Flexible Configuration: Support for custom networks and advanced configurations

What You Can Build

With Lxly.js, you can create powerful cross-chain applications:

  • Cross-Chain DeFi: Build lending protocols, DEXes, and yield farming applications that work across multiple chains
  • Multi-Chain Gaming: Create games where assets and progress seamlessly move between different blockchain networks
  • Unified Wallets: Develop wallet applications that provide seamless cross-chain asset management
  • Enterprise Solutions: Build scalable applications that leverage the best features of multiple blockchain networks

Getting Started

Ready to start building with Lxly.js?

Installation

Install and configure Lxly.js in your project with npm or yarn.

Learn more →

Client Initialization

Configure and initialize the Lxly.js client for your networks and providers.

Learn more →

Bridge Operations

Master the three core cross-chain operations:

Bridge Asset

Transfer ERC20 tokens and ETH between chains with comprehensive examples and best practices.

Learn more →

Bridge Message

Execute smart contract calls across chains and enable cross-chain communication.

Learn more →

Bridge-and-Call

Advanced atomic operations combining asset transfers with contract execution.

Learn more →

Reference

API Reference

Complete API documentation with all methods, parameters, and return types.

Learn more →

Why Lxly.js?

Developer Experience

  • Intuitive APIs: Simple, chainable methods that feel natural to JavaScript developers
  • Comprehensive Documentation: Detailed guides, examples, and API references
  • TypeScript Support: Full type definitions for better development experience and fewer bugs
  • Rich Error Handling: Detailed error messages and recovery guidance

Production Ready

  • Battle Tested: Used in production applications handling real value transfers
  • Robust Error Handling: Comprehensive error recovery and retry mechanisms
  • Performance Optimized: Efficient proof generation and transaction batching
  • Security Focused: Built-in security best practices and validation

Flexible Integration

  • Multiple Providers: Support for Web3.js, Ethers.js, and custom providers
  • Custom Networks: Easy integration with custom blockchain networks
  • Modular Architecture: Use only the components you need in your application
  • Framework Agnostic: Works with React, Vue, Angular, Node.js, and vanilla JavaScript

Quick Example

Here's how simple it is to bridge assets with Lxly.js:

import { LxLyClient, use } from '@maticnetwork/lxlyjs';
import { Web3ClientPlugin } from '@maticnetwork/maticjs-web3';

// Initialize the client
use(Web3ClientPlugin);
const client = new LxLyClient();

await client.init({
  network: 'testnet',
  providers: {
    0: { provider: ethereumProvider, configuration: { bridgeAddress: '0x...' } },
    1: { provider: polygonProvider, configuration: { bridgeAddress: '0x...' } }
  }
});

// Bridge 100 tokens from Ethereum to Polygon
const token = client.erc20('0xTokenAddress', 0);
const result = await token.bridgeAsset('100', '0xRecipientAddress', 1);

// Claim tokens on destination chain
const claimResult = await token.claimAsset(bridgeTransactionHash, 0);
Edit on GitHub

Last updated on