🖼️Widget API
Piteas Widget API is a versatile tool that can be seamlessly integrated into your portal by configuring it to meet your specific needs. It designed to be open for everyone to use and integrate. You can easily integrate it into your portal by making the necessary configurations.
The interface allows users to buy and sell for ERC20 tokens. An iframe integration may be useful if your application provides services around these ERC20 tokens. (For example, users can buy PLS through a Piteas iframe on your site).
iframe vs. custom UI
One benefit of an iframe integration is that the your site will automatically keep up with any improvements/additions to the site. After the initital integration is setup no further work is needed to pull in updates as the exchange site is updated over time.
Example
Swap route for 1000 DAI to PLS
To include a Piteas widget API within your site just add an iframe element within your website code and link to the Piteas frontent.
Query Parameters
The Piteas front-end supports URL query parameters to allow for custom linking to the Piteas frontend. Users and developers can use these query parameters to link to the Piteas frontend with custom prefilled settings.
Each Page has specific available URL parameters that can be set. Global parameters can be used on all pages.
A parameter used on an incorrect page will have no effect on frontend settings. Parameters not set with a URL parameter will be set to standard frontend defaults.
Swap Page
Symbols
ETH or PLS defaults as the input currency. When a different token is selected for either input or output ETH will default as the opposite selected currency. (ETH=PLS) Pre loaded symbols 👇
Constraints
Addresses must be valid ERC20 addresses. Slippage and amount values must be valid numbers accepted by the frontend (or error will prevent from swapping). Slippage can 0, or within the range 10->9999 bips (which converts to 0%, 0.01%->99%)
When selecting PLS as the output currency a user must also choose an inputCurrency that is not PLS (to prevent PLS being populated in both fields)
Setting Amounts
Two parameters, exactField and exactAmount can be used to set specific token amounts to be sold or bought. Both fields must be set in the URL or there will be no effect on the settings.
Global
Theme Options:
Theme can be set as
light
ordark
.
Example Usage:
https://widget.piteas.io/#/swap?theme=light
Final Another Example
Swap route for 1000000 PLS to PHUX
Last updated