<!-- 1. Place this script tag on the <head> of your page: -->
<script type="text/javascript" src="https://widgets.rubic.exchange/iframe/bundle.min.js"></script>
<!-- 2. Place this div tag at the location where the Rubic Widget will be: -->
<div id="rubic-widget-root"></div>
<!-- 3. Place this script tag at the bottom of <body>: -->
<script defer type="text/javascript">
// describe widget configuration and saving to a global variable for future use
var configuration = {
from: 'ETH',
to: '0x3330BFb7332cA23cd071631837dC289B09C33333',
fromChain: 'ETH',
toChain: 'ETH',
amount: 1,
iframe: 'flex',
hideSelectionFrom: false,
hideSelectionTo: true,
tokenSearch: true,
rubicLink: true,
theme: 'dark',
background: '#28372e',
injectTokens: {
'eth': [
'0x3330BFb7332cA23cd071631837dC289B09C33333'
]
},
slippagePercent: {
instantTrades: 2,
crossChain: 5
}
}
// prevent accidental changes to the object, for example, when re-creating a widget for another theme
Object.freeze(configuration);
// create widget
rubicWidget.init(configuration);
</script>