0.0.81 • Published 4 months ago

@hungnm192/swaps-test v0.0.81

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

Dex Hunter - Swap Component

How to use library

  • Install package:
    npm i @dexhunterio/swaps
  • Import to your code:
    import Swap from '@dexhunterio/swaps'
    import '@dexhunterio/swaps/lib/assets/style.css'
    ...
  • Use Swap Component:
    function App() {
      return (
        <div>
          <Swap {...settings} />
        </div>
      );
    }

Available props:

PropRequired?TypeDefaultDescription
defaultTokenfalsestring-The default token to be selected.
widthfalsepx|%-The width of the component. Accepts values in pixels or percentage.
heightfalsepx|%-The height of the component. Accepts values in pixels or percentage.
themefalsedark | lightdarkThe theme of the component. Can be either 'dark' or 'light'.
orderTypesfalsearray'SWAP', 'LIMIT'An array of order types supported by the component. Defaults to 'SWAP' and 'LIMIT'.
supportedTokensfalsetokenId[]-An array of token IDs that are supported for searching.
partnerNametruestring-The name of the partner. This is a required field.
partnerCodetruestring-The code of the partner. This is a required field.
colorsfalseobject-Supported colors: mainText, subText, background, containers, buttonText, accent.
classNamefalsestring-Custom CSS class for the component.
stylefalseobject-Inline styles for the component.
onSwapSuccessfalse(data: any) => void-Callback function on successful swap.
onSwapErrorfalse(err: any) => void-Callback function on swap error.
selectedWalletfalseSelectedWallet-The wallet selected by the user. Accepts one of the specified wallet identifiers. Supported wallets: nami, eternl, flint, gerowallet, typhoncip30, nufi, lace, vespr, begin, and yoroi.
inputsfalsestring[]-Input fields for the component.
onWalletConnectfalse(data: any) => void-Callback function when a wallet is connected.
0.0.77

4 months ago

0.0.78

4 months ago

0.0.79

4 months ago

0.0.80

4 months ago

0.0.81

4 months ago

0.0.61

6 months ago

0.0.60

6 months ago

0.0.59

6 months ago

0.0.45

6 months ago

0.0.44

6 months ago

0.0.43

6 months ago