@swingby-protocol/widget
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Small util to load Swingby's swap widget in your app.

Quick start

Installation

yarn add @swingby-protocol/widget @swingby-protocol/sdk

Examples

import { createWidget, openPopup } from '@swingby-protocol/widget';

const widget = createWidget({ mode: 'test', resource: 'swap', size: 'big', bridge: 'btc_erc' });
openPopup({ widget });
import { createWidget, getHtml } from '@swingby-protocol/widget';

const widget = createWidget({ mode: 'test', resource: 'swap', size: 'banner', bridge: 'btc_erc' });
document.querySelector('#my-container').innerHTML = getHtml({ widget });

Widget sizes

⚠️ Note that both the widget and this util use rem units.

Height (assuming 1rem = 16px)
Banner 76px
Small 375px
Big 510px

Package Sidebar

Install

npm i @swingby-protocol/widget

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

34.8 kB

Total Files

26

Last publish

Collaborators

  • agupane
  • notatestuser
  • swingby-ci
  • tarrio
  • syrohei