# HyperDEX Widget Integration

### HypeDEX widget code for iframe integration

Copy paste the widget code to your website \<body> or app.

```
<iframe
      style="box-shadow: 0px 10px 16px rgba(0, 0, 0, 0.08); background: #fff; border-radius: 8px; min-width: 400px; max-width: 430px"
      frameborder="0"
      width="100%"
      height="552px"
      src="https://widget.plasma-bank.com/"
    >
 </iframe>
```

### HyperDEX widget code for Button integration

Copy paste the widget code to your website \<body> or app.

With Button "Swap":

```
<link rel="stylesheet" href="https://widget.plasma-bank.com/modalWidget/style.css" />
<script async src="https://widget.plasma-bank.com/modalWidget/script.js"></script>
	
<button class="hyperdex-widget__swap-btn" onclick="showIframe()">
<img class="hyperdex-widget__swap-icon" src="https://widget.plasma-bank.com/images/two-white-arrows.svg" alt="" />
      Swap
</button>
<div id="hyperdex-widget" class="hyperdex-widget">
<iframe
        frameborder="0"
        width="100%"
        height="100%"
        src="https://widget.plasma-bank.com/?closeBtn=1"
      >
</iframe>
<div class="hyperdex-widget__close-area" onclick="closeIframe()"></div>
</div>
```

### Widget Customization and Fee setup

Optional parameters of the DEX widget

`r= string` - referral address for fees from each Swap

`chainId= string` - Network Id (Ethereum: **1**; Polygon: **137**; BNB chain: **56**; Avalanche: **43114**; Fantom: **250**; Celo: **42220**; Optimism: **10** )

`fromTokenId= string` - Token Contract Address

`toTokenId= string` - Token Contract Address

`darkTheme= boolean` - theme mode (1 - dark mode, 0 - light mode)&#x20;

`closeBtn= boolean` - close button for iframe (1 - yes, 0 - no, modal window)

To call the Tab just use its name (Swap, Bridge, Portfolio) in the URL ([https://widget.plasma.finance/bridge](https://widget.plasma.finance/bridge?darkTheme=1))

Example of parameters in the src link:

```
// Example 1
https://widget.plasma.finance/?closeBtn=1&darkTheme=1

// Example 2
https://widget.plasma.finance/?chainId=56&toTokenId=0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d&fromTokenId=0xfb288d60D3b66F9c3e231a9a39Ed3f158a4269aA

// Example 3
https://widget.plasma.finance/?chainId=56&r=0xba579c9b6a7b178edbcdc158b8eae260491871c8
```

### Widget Integration Example

Iframe <https://plasma.finance/widg>\
SWAP button <https://plasma.finance/widg2>
