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

@hyperionxyz/bridge

v0.0.4

Published

A TypeScript SDK for bridging tokens between Aptos and BSC (Binance Smart Chain) networks using the Hyperion bridge infrastructure.

Readme

@hyperionxyz/bridge

A TypeScript SDK for bridging tokens between Aptos and BSC (Binance Smart Chain) networks using the Hyperion bridge infrastructure.

Features

  • 🌉 Bidirectional token bridging between Aptos and BSC
  • 💰 Quote generation for bridge fees
  • 🔧 Easy-to-use TypeScript API
  • 🛡️ Built-in validation and error handling
  • ⚡ Support for custom tokens and configurations

Installation

pnpm install @hyperionxyz/bridge

Quick Start

import { HyperionBridge, TOKENS } from "@hyperionxyz/bridge";

const bridge = new HyperionBridge();

// Bridge from Aptos to BSC
const quoteBridge = bridge.createQuoteSendPayloadFromAptosToBSC({
  token: TOKENS[0], // RION token
  amount: 100,
  sender: "0x...", // Aptos sender address
  recipient: "0x...", // BSC recipient address
});

// Get quote from Aptos client
const quoteResult = await aptosClient.view({ payload: quoteBridge });

// Create bridge transaction
const bridgePayload = bridge.createBridgePayloadFromAptosToBSC(
  {
    token: TOKENS[0],
    amount: 100,
    sender: "0x...",
    recipient: "0x...",
  },
  quoteResult
);

// Submit transaction
const tx = await wallet.signAndSubmitTransaction({
  data: bridgePayload,
});

API Reference

HyperionBridge Class

The main class for interacting with the Hyperion bridge.

Constructor

const bridge = new HyperionBridge();

Methods

addToken(token: BridgeToken)

Add a custom token to the bridge.

bridge.addToken({
  name: "Custom Token",
  symbol: "CTK",
  chain: {
    aptos: {
      address: "0x...",
      oftContractAddress: "0x...",
      logo: "https://...",
      decimals: 8,
    },
    bsc: {
      address: "0x...",
      decimals: 18,
    },
  },
});
Aptos to BSC Bridge
createQuoteSendPayloadFromAptosToBSC(args: BridgeArgs): InputViewFunctionData

Creates a quote payload for bridging from Aptos to BSC.

Parameters:

  • args.token - The token to bridge
  • args.amount - Amount to bridge
  • args.sender - Aptos sender address
  • args.recipient - BSC recipient address

Returns: View function payload for getting bridge quotes

createBridgePayloadFromAptosToBSC(args: BridgeArgs, quoteResult: any[]): InputGenerateTransactionPayloadData

Creates the actual bridge transaction payload from Aptos to BSC.

Parameters:

  • args - Bridge arguments (same as quote)
  • quoteResult - Result from the quote view function

Returns: Transaction payload for bridge execution

BSC to Aptos Bridge
createQuoteSendPayloadFromBSCToAptos(args: BridgeArgs)

Creates a quote payload for bridging from BSC to Aptos.

Returns: Contract call configuration for BSC quote

createBridgePayloadFromBSCToAptos(args: BridgeArgs, quoteResult: any)

Creates the actual bridge transaction payload from BSC to Aptos.

Parameters:

  • args - Bridge arguments
  • quoteResult - Result from the BSC quote call

Returns: Contract call configuration for BSC bridge execution

Types

BridgeToken

interface BridgeToken {
  name: string;
  symbol: string;
  chain: {
    aptos: {
      address: string;
      oftContractAddress: string;
      logo: string;
      decimals: number;
    };
    bsc: {
      address: string;
      decimals: number;
    };
  };
}

BridgeArgs

type BridgeArgs = {
  token: BridgeToken;
  amount: number;
  sender: string;
  recipient: string;
};

Supported Tokens

The bridge comes with pre-configured support for:

  • RION (Hyperion): Native bridging between Aptos and BSC

Access supported tokens via:

import { TOKENS } from "@hyperionxyz/bridge";
console.log(TOKENS); // Array of supported tokens

Examples

Complete Aptos to BSC Bridge Flow

import { HyperionBridge, TOKENS } from "@hyperionxyz/bridge";
import { AptosConfig, Aptos, Network } from "@aptos-labs/ts-sdk";

const aptosConfig = new AptosConfig({ network: Network.MAINNET });
const aptosClient = new Aptos(aptosConfig);
const bridge = new HyperionBridge();

async function bridgeAptosToBSC() {
  // 1. Create quote payload
  const quotePayload = bridge.createQuoteSendPayloadFromAptosToBSC({
    token: TOKENS[0],
    amount: 100,
    sender: "0x123...", // Your Aptos address
    recipient: "0x456...", // BSC recipient address
  });

  // 2. Get quote
  const quoteResult = await aptosClient.view({ payload: quotePayload });
  console.log("Bridge fee:", quoteResult[0]);

  // 3. Create bridge transaction
  const bridgePayload = bridge.createBridgePayloadFromAptosToBSC(
    {
      token: TOKENS[0],
      amount: 100,
      sender: "0x123...",
      recipient: "0x456...",
    },
    quoteResult
  );

  // 4. Submit transaction (requires wallet integration)
  // const tx = await wallet.signAndSubmitTransaction({
  //   data: bridgePayload,
  // });

  return bridgePayload;
}

Complete BSC to Aptos Bridge Flow

import { HyperionBridge, TOKENS } from "@hyperionxyz/bridge";
import { useReadContract, useWriteContract } from "wagmi";

const bridge = new HyperionBridge();

async function bridgeBSCToAptos() {
  // 1. Create quote payload
  const quoteConfig = bridge.createQuoteSendPayloadFromBSCToAptos({
    token: TOKENS[0],
    amount: 100,
    sender: "0x123...", // BSC sender address
    recipient: "0x456...", // Aptos recipient address
  });

  // 2. Get quote (using wagmi or web3 library)
  const { data: quoteResult } = useReadContract(quoteConfig);

  // 3. Create bridge transaction
  const bridgeConfig = bridge.createBridgePayloadFromBSCToAptos(
    {
      token: TOKENS[0],
      amount: 100,
      sender: "0x123...",
      recipient: "0x456...",
    },
    quoteResult
  );

  // 4. Execute bridge transaction
  const { writeContractAsync } = useWriteContract();
  const tx = await writeContractAsync(bridgeConfig);

  console.log("tx", tx);
}

Dependencies

  • @aptos-labs/ts-sdk: Aptos TypeScript SDK
  • aptos-tool: Aptos utilities
  • bignumber.js: Precision arithmetic
  • buffer: Node.js Buffer polyfill

License

Apache-2.0

Support

For issues and questions, please visit the GitHub repository.