@dodoex/api
v3.0.3-bartio.0
Published
DODO API Kit
Downloads
1,314
Readme
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} />;
}