An open sourced widget that uses Bancor's smart contracts to allow a user to convert tokens or ethereum.
- 🚴 Fast
- 🔧 Customizable
- 🙂 Simple usage
npm install bancor-conversion-widget --save
<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>
npm install react-svelte --save
import SvelteComponent from "react-svelte";
import BancorConversionWidget from "bancor-conversion-widget";
// render it
<SvelteComponent this={BancorConversionWidget} />;
<script>
import BancorConversionWidget from "bancor-conversion-widget";
</script>
<!-- render it -->
<BancorConversionWidget />
Read a more in-depth integration guide here
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 |
onChange | event triggered on token change | function |
undefined |