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

@arcade2earn.dev/wormhole-connect

v0.0.5

Published

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

Downloads

7

Readme

Wormhole Connect

Integration does not get easier than this. Wormhole Connect is an easy seamless experience that will help to bring all the functionality of the Wormhole Token Bridge right into your application.

Integrate with script/link tags

We recommend that you configure your own custom RPC endpoints for each used network for the best performance. The default public RPCs may be throttled or rate limited.

Osmosis support is in beta, reach out to a Wormhole contributor for early access.

1. (Optional) Create a JSON config with customized values:

{
  "env": "testnet",
  "networks": ["goerli", "mumbai"],
  "tokens": ["ETH", "WETH", "MATIC", "WMATIC"],
  "mode": "light",
  "customTheme": {} // see src/theme.ts
}

Accepted values

Environment (env): | Mainnet | Testnet | | ---------- | --------- | | mainnet | testnet |

Networks (networks): | Mainnet | Testnet | | ---------- | ------------- | | ethereum | goerli | | polygon | mumbai | | bsc | bsc | | avalanche | fuji | | celo | avalanche | | moonbeam | moonbasealpha | | solana | solana | | sui | sui | | aptos | aptos | | base | basegoerli | | osmosis | osmosis | | evmos | evmos | | kujira | kujira |

Tokens (tokens): | Mainnet | Testnet | | ----------- | -------- | | ETH | ETH | | WETH | WETH | | USDCeth | USDCeth | | WBTC | | | USDT | | | DAI | | | BUSD | | | MATIC | MATIC | | WMATIC | WMATIC | | USDCpolygon | | | BNB | BNB | | WBNB | WBNB | | USDCbnb | | | AVAX | AVAX | | WAVAX | WAVAX | | USDCavax | USDCavax | | FTM | FTM | | WFTM | WFTM | | CELO | CELO | | GLMR | GLMR | | WGLMR | WGLMR | | SOL | WSOL | | SUI | SUI | | USDCsol | | | APT | APT | | ETHarbitrum | ETHarbitrum| | WETHarbitrum | WETHarbitrum| | USDCarbitrum | USDCarbitrum| | ETHoptimism | ETHoptimism| | WETHoptimism | WETHoptimism| | USDCoptimism | USDCoptimism| | ETHbase | ETHbase | | WETHbase | WETHbase |

Routes (routes) | Mainnet | Testnet | | -------- | ---------| | bridge | bridge | | relay | relay | | cctpManual | cctpManual | | cctpRelay | cctpRelay | | cosmosGateway | cosmosGateway |

Mode (mode): | | | | ---- | ----- | | dark | light |

Theme (customTheme)

See theme.ts for examples

2. Add your config

Add a container div with the id wormhole-connect. This is where the bridge will be rendered.

<div id="wormhole-connect" />

If you created a config from step 1, stringify it and assign to the config attribute on the container element.

<div
  id="wormhole-connect"
  config='{"env":"mainnet","tokens":["ETH","WETH","WBTC","USDCeth"]}'
/>

2. Add a script and link tag

<!-- paste below into index.html body -->
<script src="https://www.unpkg.com/@wormhole-foundation/[email protected]/dist/main.js"></script>
<link
  href="https://www.unpkg.com/@wormhole-foundation/[email protected]/dist/main.css"
/>

Note that the wormhole-connect div with your config has to be present before the scripts are loaded. If your application loads it after, you may need to add the scripts like this:

function mount() {
  const script = document.createElement("script");
  script.src =
    "https://www.unpkg.com/@wormhole-foundation/[email protected]/dist/main.js";
  script.async = true;

  const link = document.createElement("link");
  link.href =
    "https://www.unpkg.com/@wormhole-foundation/[email protected]/dist/main.css";

  document.body.appendChild(script);
  document.body.appendChild(link);
}

Integrate with React

import WormholeBridge from "@wormhole-foundation/wormhole-connect";
function App() {
  return <WormholeBridge />;
}

(Optional) Specify supported networks/tokens and custom RPC endpoints. Your users may encounter rate limits using public RPC endpoints if you do not provide your own

import WormholeBridge, {
  WormholeConnectConfig,
} from "@wormhole-foundation/wormhole-connect";
const config: WormholeConnectConfig = {
  env: "mainnet",
  networks: ["ethereum", "polygon", "solana"],
  tokens: ["ETH", "WETH", "MATIC", "WMATIC"],
  rpcs: {
    ethereum: "https://rpc.ankr.com/eth",
    solana: "https://rpc.ankr.com/solana",
  },
};

function App() {
  return <WormholeBridge config={config} />;
}

(Optional) Customize theme

import WormholeBridge, {
  light,
  Theme,
  WormholeConnectConfig,
} from "@wormhole-foundation/wormhole-connect";
import lightblue from "@mui/material/colors/lightBlue";

// alters the `light` theme
const customized: Theme = light;
customized.success = lightblue;
customized.background.default = "transparent";
customized.button.action = "#81c784";
customized.button.actionText = "#000000";

const config: WormholeConnectConfig = {
  mode: "light",
  customTheme: customized,
};

function App() {
  return <WormholeBridge config={config} />;
}

(Optional) Create fully customized theme

import WormholeBridge, {
  Theme,
  OPACITY,
  WormholeConnectConfig,
} from "@wormhole-foundation/wormhole-connect";
import lightblue from "@mui/material/colors/lightBlue";
import grey from "@mui/material/colors/grey";
import green from "@mui/material/colors/green";
import orange from "@mui/material/colors/orange";

const customized: Theme = {
  primary: grey,
  secondary: grey,
  divider: "#ffffff" + OPACITY[20],
  background: {
    default: "#232323",
  },
  text: {
    primary: "#ffffff",
    secondary: grey[500],
  },
  error: red,
  info: lightblue,
  success: green,
  warning: orange,
  button: {
    primary: "#ffffff" + OPACITY[20],
    primaryText: "#ffffff",
    disabled: "#ffffff" + OPACITY[10],
    disabledText: "#ffffff" + OPACITY[40],
    action: orange[300],
    actionText: "#000000",
    hover: "#ffffff" + OPACITY[7],
  },
  options: {
    hover: "#474747",
    select: "#5b5b5b",
  },
  card: {
    background: "#333333",
    secondary: "#474747",
    elevation: "none",
  },
  popover: {
    background: "#1b2033",
    secondary: "#ffffff" + OPACITY[5],
    elevation: "none",
  },
  modal: {
    background: "#474747",
  },
};
const config: WormholeConnectConfig = {
  mode: "dark",
  customTheme: customized,
};

function App() {
  return <WormholeBridge config={config} />;
}