Swap and Sale Integration
Place this script tag on the <body> of your page:
<script src="https://unpkg.com/@bitoftrade/crypto-trading-widget-sdk/build/index.js"
type="text/javascript"></script>Create a <div> tag where you want to locate the widget:
<div id="widget"></div>Add this to the <script> tag at the bottom of the <body> tag:
<script>
const configuration = {
palletOverrides: {
"primary": "#38D9C0",
"secondary": "#2B363B",
"paper": "#1A1F23",
"text-primary": "#fff",
"text-secondary": "#C5C9C9",
"text-primaryButton": "#fff",
"text-secondaryButton": "#C5C9C9",
"secondaryButton": "#255558",
"success": "#38D9C0",
"error": "#FF6666",
"warning": "#FF7A2A",
},
chainOptions: {
'0x1': {
enabled: true,
defaultTokenAddress: "0x111111111117dc0aa78b770fa6a738034120c302",
},
'0x89': {
enabled: true,
defaultTokenAddress: "0x5ceebb0947d58fabde2fc026ffe4b33ccfe1ba8b",
},
'0xfa': {
enabled: true,
defaultTokenAddress: "0x6a07a792ab2965c72a5b8088d3a069a7ac3a993b",
},
'0x38': {
enabled: true,
defaultTokenAddress: "0x3ee2200efb3400fabb9aacf31297cbdd1d435d47",
},
'0xa86a': {
enabled: true,
defaultTokenAddress: "0x60781c2586d68229fde47564546784ab3faca982",
},
},
widgetType: "swap",
};
CryptoTradingWidget.tradingWidget('widget', configuration);
</script>Here is the full code π
Last updated