0.0.1 • Published 5 months ago

@dodoex/api v0.0.1

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
5 months ago

API

DODO Service API

HOW TO USE

import { SwapWidgetApi } from '@dodoex/api';
import { SwapWidget } from '@dodoex/widgets';

const dodoService = new SwapWidgetApi();
const apikey = ""
const projectId = "";

export default function Swap() {
  React.useEffect(() => {
    if (projectId && apiKey) {
      const dodoService = new SwapWidgetApi();
      dodoService
        .getConfigSwapWidgetProps(projectId, apiKey)
        .then(({ swapWidgetProps }) => {
          setConfig(swapWidgetProps);
        });
    }
  }, [projectId, apiKey]);

  return <SwapWidget {...config} apikey={apiKey} />;
}
0.0.1

5 months ago