1inch swap widget
Library for integrating 1inch swap widget
.
See the live example here and the source code here.
Test coverage
Statements | Branches | Functions | Lines |
---|---|---|---|
Installation
Node
npm install @1inch/embedded-widget
Yarn
yarn add @1inch/embedded-widget
Usage
import {setup1inchWidget} from '@1inch/embedded-widget';
setup1inchWidget({
chainId: 137,
sourceTokenSymbol: '1INCH',
destinationTokenSymbol: 'DAI',
hostElement: host,
provider: window.ethereum,
theme: 'light',
sourceTokenAmount: '15'
});