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

@kasa1/tokenbridge-bw-exchange

v2.3.0

Published

This plugin defines a Bridge trading pair to be used in the Exchange Plugin.

Downloads

8

Readme

TokenBridge Burner Wallet 2 Plugin

This plugin defines a Bridge trading pair to be used in the Exchange Plugin.

Bridge trading pairs and assets supported:

  • ETC - WETC Bridge
  • MOON - xMOON Bridge
  • DAI - qDAI Bridge (For qDAI Bridge, it's necessary to use a custom DAI token from this repo instead of the DAI asset provided by burner-wallet)

It also provides some generic resources that can be used and extended:

  • ERC677Asset - A representation of an Erc677 token.
  • BridgeableERC20Asset - A representation of Erc20 token with a possibility of bridging it via a call to relayTokens.
  • NativeMediatorAsset - Represents a native token that interacts with a Mediator extension.
  • Mediator Pair - Represents an Exchange Pair that interacts with mediators extensions.
  • MediatorErcToNative Pair - Represents a modified Mediator Pair that interacts with a tokenbridge erc-to-native mediators contracts.
  • TokenBridgeGateway - A gateway to operate with ETC, POA Sokol, POA Core and qDAI networks.

Install package

yarn add @poanet/tokenbridge-bw-exchange

Usage

WETCBridge example

In this example, we use TokenBridgeGateway for connecting to the Ethereum Classic and InfuraGateway for connecting to the Ethereum Mainnet.

WETCBridge operates with two assets: WETC (Ethereum Mainnet) and ETC (Ethereum Classic), they should be added in the assets list.

import BurnerCore from '@burner-wallet/core'
import Exchange from '@burner-wallet/exchange'
import { LocalSigner } from '@burner-wallet/core/signers'
import { Etc, Wetc, TokenBridgeGateway, WETCBridge } from '@poanet/tokenbridge-bw-exchange'
import { InfuraGateway } from '@burner-wallet/core/gateways'

const core = new BurnerCore({
  signers: [new LocalSigner()],
  gateways: [new TokenBridgeGateway(), new InfuraGateway(process.env.REACT_APP_INFURA_KEY)],
  assets: [Wetc, Etc]
})

const exchange = new Exchange({
  pairs: [new WETCBridge()]
})

Using several exchanges simultaneously

In this example, we use TokenBridgeGateway for connecting to the qDAI chain, XDaiGatewai for connecting to the xDAI chain and InfuraGateway for connecting to the Ethereum Mainnet and Rinkeby Network.

QDAIBridge operates with two assets: qDAI (qDAI chain) and DAI (Ethereum Mainnet). Note that we use a custom DAI token from the @poanet/tokenbridge-bw-exchange, this is necessary for allowing bridge operations on this token.

MOONBridge operates with two assets: MOON (Rinkeby network) and xMOON (xDAI chain).

All four assets should be added to the assets list.

import BurnerCore from '@burner-wallet/core'
import Exchange from '@burner-wallet/exchange'
import { LocalSigner } from '@burner-wallet/core/signers'
import { InfuraGateway, XDaiGateway } from '@burner-wallet/core/gateways'
import { Dai, qDai, MOON, xMOON, TokenBridgeGateway, QDAIBridge, MOONBridge } from '@poanet/tokenbridge-bw-exchange'

const core = new BurnerCore({
  signers: [new LocalSigner()],
  gateways: [new TokenBridgeGateway(), new XDaiGateway(), new InfuraGateway(process.env.REACT_APP_INFURA_KEY)],
  assets: [Dai, qDai, MOON, xMOON]
})

const exchange = new Exchange({
  pairs: [new QDAIBridge(), new MOONBridge()]
})

This is how the exchange plugin will look like:

exchange-wetc