fakel / bancor-conversion-widget

An open sourced Bancor Widget, built with Svelte.

Home Page:https://bancor-conversion-widget.now.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bancor Conversion Widget

An open sourced widget that uses Bancor's smart contracts to allow a user to convert tokens or ethereum.

Features

  • 🚴 Fast
  • 🔧 Customizable
  • 🙂 Simple usage

Installing and usage:

npm install bancor-conversion-widget --save

in vanilla

<script src="https://unpkg.com/bancor-conversion-widget@latest"></script>

<body onload="render()">
  <script>
    const render = () => {
      // render it
      new BancorConversionWidget({
        target: document.body,
        props: {}
      });
    };
  </script>
</body>

in react

npm install react-svelte --save
import SvelteComponent from "react-svelte";
import BancorConversionWidget from "bancor-conversion-widget";

// render it
<SvelteComponent this={BancorConversionWidget} />;

in svelte

<script>
  import BancorConversionWidget from "bancor-conversion-widget";
</script>

<!-- render it -->
<BancorConversionWidget />

Read a more in-depth integration guide here

Available properties:

Name Description Type Default
tokenSend initial "send" token string "ETH"
tokenReceive initial "receive" token string "BNT"
colors custom colors object src
showRelayTokens show or hide relay tokens boolean false
addresses custom registry addresses object src
affiliate.account affiliate ethereum address string undefined
affiliate.fee affiliate fee percentage (max 3%) number undefined

Live examples:

About

An open sourced Bancor Widget, built with Svelte.

https://bancor-conversion-widget.now.sh/

License:Apache License 2.0


Languages

Language:HTML 60.8%Language:JavaScript 38.9%Language:CSS 0.3%