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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@wonderland/interop

v0.1.1

Published

Complete SDK for blockchain interoperability with cross-chain operations and address utilities

Readme

@wonderland/interop

A TypeScript library for handling interoperable blockchain addresses and cross-chain operations across different networks.

This package combines two powerful functionalities:

  1. Interoperable Addresses: Provides methods to convert between human-readable addresses and their binary string representation, following the ERC-7930 standard. For backward compatibility with existing smart contracts, the package includes utilities to extract individual components (chainId and address) from the binary representation.

  2. Cross-Chain Operations: Enables seamless token transfers and swaps between different blockchain networks through a unified API, supporting various bridge protocols.

graph LR
    A[humanReadable]
    C[binaryRepresentation]
    D[chainId]
    E[address]
    F[Cross-Chain Operations]
    G[Token Transfers]

    A -->|humanReadableToBinary| C
    C -->|binaryToHumanReadable| A
    C -->|getChainId| D
    C -->|getAddress| E
    F -->|Transfer| G

Setup

  1. Install dependencies running pnpm install

Available Scripts

Available scripts that can be run using pnpm:

| Script | Description | | ------------- | ------------------------------------------------------- | | build | Build library using tsc | | check-types | Check types issues using tsc | | clean | Remove dist folder | | lint | Run ESLint to check for coding standards | | lint:fix | Run linter and automatically fix code formatting issues | | format | Check code formatting and style using Prettier | | format:fix | Run formatter and automatically fix issues | | test | Run tests using vitest | | test:cov | Run tests with coverage report |

Usage

Interoperable Addresses

// Using the Provider
import { InteropAddressProvider } from '@wonderland/interop';

const humanReadableAddress = "alice.eth@eip155:1#ABCD1234"
const binaryAddress = InteropAddressProvider.humanReadableToBinary(humanReadableAddress)

// Or just importing the method
import { humanReadableToBinary } from '@wonderland/interop';
const binaryAddress = humanReadableToBinary(humanReadableAddress)

Cross-Chain Operations

import { createCrossChainProvider } from "@wonderland/interop";

// Create a provider for a specific protocol (e.g., Across)
const provider = createCrossChainProvider("across");

// Get a quote for a cross-chain transfer
const quote = await provider.getQuote("crossChainTransfer", {
    inputTokenAddress: "0x...",
    outputTokenAddress: "0x...",
    inputAmount: "1000000000000000000",
    inputChainId: 1,
    outputChainId: 137,
    sender: "0x...",
    recipient: "0x...",
});

// Simulate the transaction
const transactions = await provider.simulateOpen(quote.openParams);

API

Interoperable Addresses

InteropAddressProvider

Available methods:

  • humanReadableToBinary(humanReadableAddress: string)
  • binaryToHumanReadable(binaryAddress: Hex)
  • getChainId(binaryAddress: Hex)
  • getAddress(binaryAddress: Hex)
  • buildFromPayload(payload: InteropAddressFields)
  • computeChecksum(humanReadableAddress: string)

Cross-Chain Operations

CrossChainProviderFactory

The factory provides a standardized way to create and manage cross-chain providers for different protocols.

Available methods:

  • build<Protocol>(protocolName: Protocol, config?: Config, dependencies?: Dependencies): Creates a new provider instance for the specified protocol
  • createCrossChainProvider<Protocol>(protocolName: Protocol, config?: Config, dependencies?: Dependencies): Helper function to create a provider instance

CrossChainExecutor

The executor handles the execution of cross-chain operations, providing a unified interface for different protocols.

Available methods:

  • execute(params: ExecutionParams): Executes a cross-chain operation
  • getQuotes(params: QuoteParams): Gets a quote for a cross-chain operation

Supported protocols:

  • Across Protocol
  • More protocols coming soon...

References