Coder Social home page Coder Social logo

fakel / bancor-conversion-widget Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nionis/bancor-conversion-widget

0.0 0.0 0.0 1003 KB

An open sourced Bancor Widget, built with Svelte.

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

License: Apache License 2.0

CSS 0.26% HTML 60.84% JavaScript 38.90%

bancor-conversion-widget's Introduction

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:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.