1.9.0 • Published 10 months ago

@superswap-ink/widget v1.9.0

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

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.

ParamTypeDefault
widthnumber480
inputTokenstringNATIVE
outputTokenstringundefiend
amountstringundefiend
darkModeboolundefined
slippagenumber0.5
hideBridgeboolundefined
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

10 months ago

1.8.5-beta.0

10 months ago

1.8.9

10 months ago

1.8.8

10 months ago

1.8.7

10 months ago

1.8.6

10 months ago

1.8.5

10 months ago

1.8.4

10 months ago

1.8.3

10 months ago

1.8.2

10 months ago

1.8.1

10 months ago

1.8.0

10 months ago

1.7.0

10 months ago

1.6.0

10 months ago

1.5.0

10 months ago

1.4.0

10 months ago

1.3.0

10 months ago

1.2.0

10 months ago

1.1.0

10 months ago

1.0.0

10 months ago