1.9.0 • Published 5 months ago
@superswap-ink/widget v1.9.0
Getting Started with the Widget
This guide walks you through the steps to embed the swap widget in your website in 2 minutes — whether your site is already a decentralized application (dApp) or not.
With the swap widget, your users can swap your token or any ink ERC-20 tokens on Superswap without leaving your site!
Installing the Widgets Library
To get started, install the widgets library using npm or Yarn.
npm install --save @superswap-ink/widget
Adding the Widget to Your App
Next, embed the React component in your application.
import { SwapWidget } from '@superswap-ink/widget'
import '@superswap-ink/widget/dist/style.css'
function App() {
<div>
<SwapWidget />
</div>
}
Customizing the Widget
You can set optional parameters to tailor the appearance and functionality of the widget to fit your dApp.
Param | Type | Default |
---|---|---|
width | number | 480 |
inputToken | string | NATIVE |
outputToken | string | undefiend |
amount | string | undefiend |
darkMode | bool | undefined |
slippage | number | 0.5 |
hideBridge | bool | undefined |
import { SwapWidget } from '@superswap-ink/widget'
import '@superswap-ink/widget/dist/style.css'
function App() {
<div>
<SwapWidget
width={500}
inputToken={"NATIVE"}
outputToken={"0xD642B49d10cc6e1BC1c6945725667c35e0875f22"}
amount={"100"}
slippage={10}
darkMode={true}
/>
</div>
}
1.9.0
5 months ago
1.8.5-beta.0
5 months ago
1.8.9
5 months ago
1.8.8
5 months ago
1.8.7
5 months ago
1.8.6
5 months ago
1.8.5
5 months ago
1.8.4
5 months ago
1.8.3
5 months ago
1.8.2
5 months ago
1.8.1
5 months ago
1.8.0
5 months ago
1.7.0
5 months ago
1.6.0
5 months ago
1.5.0
5 months ago
1.4.0
5 months ago
1.3.0
5 months ago
1.2.0
5 months ago
1.1.0
5 months ago
1.0.0
5 months ago