Skip to content

XY-Finance/xy-finance-widget

Repository files navigation

XY-Finance-widget

alt text

Get Started

  1. Paste this code as high in the <head> of the page as possible
<script defer type="text/javascript" src="https://widget.xy.finance/js/bundle.min.js"></script> 
  1. Paste this <div> tag to the place where you need widget to display in body
<div id="xy-finance-widget-root"></div>
  1. Paste this <script> in the bottom of body
<script defer>
  setTimeout(() => {
    // set default config
    const config = {
      fromTokenAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
      sourceChainId: '1',
      toTokenAddress: '0x77777777772cf0455fB38eE0e75f38034dFa50DE',
      targetChainId: '1',
      amount: 1,
      slippage: '1',
      orientation: 'portrait',
      theme: 'dark',
      lockmode: 'none',
      pagecolor: null
    }

    // use widget
    xyFinaceWidget.init(config);
  }, 2000)
</script>

Configuration

Key Type Default
fromTokenAddress String '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
sourceChainId String '1'
toTokenAddress String '0x77777777772cf0455fB38eE0e75f38034dFa50DE'
targetChainId String '1'
amount Number 1
slippage String '1'
orientation portrait or landscape For now, only support portrait portrait
theme dark or light dark
lockmode none or both or fromToken or toToken none
pagecolor String or null Only use HexColor without # null

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published