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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bnb-chain/canonical-bridge-widget

v0.5.2

Published

canonical bridge widget

Downloads

3,626

Readme

BNB Chain Canonical Bridge Widget

A React.js widget that facilitates seamless token transfers across different blockchain networks using various bridge protocols.

Overview

A React.js widget enables users to transfer assets across multiple blockchains directly. It supports a variety of blockchains, leveraging modern bridge protocols (e.g., LayerZero, cBridge, deBridge...) to perform cross-chain transactions in a secure and efficient manner.

Features

  • Multiple blockchains support: Transfer tokens between multiple networks.
  • Bridge Integration: Built on LayerZero or similar bridging protocols.
  • Customizable theme: Configure colors to match your application's look and feel.
  • Configurable tokens and networks: Easily configure support network and tokens.
  • Multi-language support: Easily configure multiple languages to match the user's local language.

Quick Start

npm install @bnb-chain/canonical-bridge-widget viem@^2

Usage

Import the widget providers into your React application and start using it by providing the necessary configs.

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import {
  CanonicalBridgeProvider,
  ICanonicalBridgeConfig,
  TransferWidget,
} from '@bnb-chain/canonical-bridge-widget';

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      refetchOnReconnect: true,
      refetchOnWindowFocus: false,
      retry: 2,
    },
  },
});

const config: ICanonicalBridgeConfig = {
  appName: env.APP_NAME,
  assetPrefix: env.ASSET_PREFIX,
  appearance: {
    bridgeTitle: 'Widget Title',
    mode: 'dark',
    theme: {
      dark: dark,
      light: light,
    },
    locale: 'en',
    messages,
  },
  wallet: {
    walletConnectProjectId: env.WALLET_CONNECT_PROJECT_ID,
  },
  http: {
    refetchingInterval: 30 * 1000, // 30s
    apiTimeOut: 60 * 1000, // 60s
    deBridgeAccessToken: '', // optional deBridge referral code https://app.debridge.finance/refer
    serverEndpoint: env.SERVER_ENDPOINT,
  },
};

export default function App() {
  const transferConfig = useTransferConfig();

  return (
    <ThemeProvider>
      <QueryClientProvider client={queryClient}>
        <CanonicalBridgeProvider config={config} transferConfig={transferConfig} chains={chains}>
          <Layout>
            <TransferWidget />
          </Layout>
        </CanonicalBridgeProvider>
      </QueryClientProvider>
    </ThemeProvider>
  );
}

For more details, please see the example here. here

License

The contents of this repo are made available under the MIT License.