iFrame Alternative
Overview
KyberSwap provides an iFrame option for integrators that require swap functionality to be embedded directly into their website or dApp.
Note on integrations: clientID and domain whitelisting
In order to ensure the security of user's fund when interacting with the KyberSwap iFrame, KyberSwap requires integrator domains to be whitelisted. By doing so, integrators can protect their users from cross-domain attacks.
Please contact our Head of BD tram@kyber.network
, if you would like to get your domain whitelisted. Upon whitelisting, you will then be provided with the base domain for iFrame integration.
To accompany the domain, KyberSwap also implements a clientId
field that enables us to continuously improve the KyberSwap Widget by understanding how swaps are being utilized. As a developer integrating with our widget, please add your clientID (i.e. company name) to the clientId
field to enable us to serve you better.
Parameters
Params | Required | Description |
---|---|---|
clientId | Yes | ID of the client integrating the iFrame. |
chainId | No | The chainId for the transaction. Full list can be found here. |
inputCurrency | Yes | The token that the user is selling. |
outputCurrency | Yes | The token that the user is buying. |
features | No | Token swap mode(s) to enable in iFrame. Separated by |
tab | No | Token swap mode to be loaded when iFrame is first loaded. |
feeReceiver | Optional | Address to receive fee (if |
feeAmount | Optional | Fee amount to be collected
If |
isInBps | Optional | If true, fee is taken in BPS |
chargeFeeBy | Optional | Indicates whether fee is charged by input token |
Adding the iFrame to your site
Sample code:
Last updated