Widget
Getting Started
Demo repository: OpenOcean-Frontend-Examples / Widget_V2-demo
Quick Install
There are three ways you can embed OpenOcean swap widget into your protocols/Apps.
Method #1 - Use <iframe> to inject the OpenOcean widget into your program.
- Input <iframe> to your front-end code.
- Change the iframe src to "https://widget.openocean.finance"
- Refresh the page and check whether the component is installed.
Terminal
HTML
1 <iframe src="https://widget.openocean.finance"></iframe>
Recommendation
We highly recommend using the custom mode to integrate wallets to make sure it works properly. More Details
Method #2 - Install the widget by using the OpenOcean SDK module.
You can check the detail in the SDK section.
Method #3 - Install the widget by using the OpenOcean API.
You can check the detail in the API section.
Referral Fee
Method #1
Add "referral" which is fee charger address as query param in <iframe> request link.
For example:
Terminal
TXT
1 https://widget.openocean.finance?referral=0x3487ef9f9b36547e43268b8f0e2349a226c70b53#/BSC/BNB/BUSD
The default referrer fee is 0%. You could set up the referrer fee via the link here. The default fee share for OpenOcean is 20% from the set referrer fee. You may contact us for any adjustments for the fee share %.