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

@m3s/crosschain

v2.2.10

Published

A simplified cross-chain transfer library built on top of LI.FI, enabling token transfers between different blockchain networks with minimal configuration

Readme

@m3s/crosschain

Cross-chain token transfers and swaps across 20+ blockchains. Built on LI.FI with simple, standardized API.

⚠️ Alpha Release: APIs may change. Not production-ready.

Installation

npm install @m3s/crosschain

Quick Start

import { createCrossChain } from '@m3s/crosschain';
import { createWallet } from '@m3s/wallet';

// Setup wallet
const wallet = await createWallet({
  name: 'ethers',
  options: { privateKey: 'YOUR_PRIVATE_KEY' }
});

// Create crosschain adapter
const crosschain = await createCrossChain({
  name: 'lifi',
  version: '1.0.0',
  options: {
    apiKey: process.env.LIFI_API_KEY // Optional for quotes
  }
});

// Get quotes for cross-chain transfer
const quotes = await crosschain.getOperationQuote({
  sourceAsset: {
    chainId: 137,      // Polygon
    address: '0x...', // USDC
    symbol: 'USDC',
    decimals: 6
  },
  destinationAsset: {
    chainId: 10,       // Optimism  
    address: '0x...', // USDC
    symbol: 'USDC',
    decimals: 6
  },
  amount: '100000000', // 100 USDC
  userAddress: await wallet.getAccounts()[0],
  slippageBps: 50      // 0.5%
});

// Execute best quote
const result = await crosschain.executeOperation(quotes[0]);
console.log(`Transfer started: ${result.operationId}`);

// Track status
const status = await crosschain.getOperationStatus(result.operationId);
console.log(`Status: ${status.status}`);

Features

  • 20+ Chains - All major EVM networks supported
  • Route Optimization - Find best paths automatically
  • Gas Estimation - Accurate cost estimates
  • Status Tracking - Real-time operation monitoring
  • LI.FI Integration - Access to 15+ bridge protocols

Supported Networks

| Network | Chain ID | Native Token | |---------|----------|--------------| | Ethereum | 1 | ETH | | Polygon | 137 | MATIC | | Arbitrum | 42161 | ETH | | Optimism | 10 | ETH | | Base | 8453 | ETH | | BNB Chain | 56 | BNB | | Avalanche | 43114 | AVAX |

Examples

Token Swap + Bridge

// MATIC on Polygon → WETH on Arbitrum
const quotes = await crosschain.getOperationQuote({
  sourceAsset: { chainId: 137, address: '0x...', symbol: 'MATIC' },
  destinationAsset: { chainId: 42161, address: '0x...', symbol: 'WETH' },
  amount: ethers.parseEther('100').toString(),
  userAddress: userAddress
});

Advanced Options

// Custom slippage and bridge preferences  
const quotes = await crosschain.getOperationQuote({
  // ... assets ...
  options: {
    slippage: 0.005,           // 0.5%
    allowBridges: ['stargate', 'across'],
    denyExchanges: ['paraswap']
  }
});

Status Monitoring

// Poll for updates
const checkStatus = async (operationId) => {
  const status = await crosschain.getOperationStatus(operationId);
  
  console.log(`Status: ${status.status}`);
  if (status.sourceTx?.hash) {
    console.log(`Source TX: ${status.sourceTx.hash}`);
  }
  if (status.destinationTx?.hash) {
    console.log(`Destination TX: ${status.destinationTx.hash}`);
  }
};

Community Adapters

Extend to more bridges and protocols:

License

MIT