Block Components
Withdraw
Block component allowing users to withdraw.
Features
- The component is already integrated with
@orderly.network/hooks
and can be used without any configuration. - The component handles checks on the user’s status, as well as connection to the wallet.
- The component must be used within the
ConnectionProvider
component withinOrderlyAppProvider
.
Usage
Static mode
You can display the Withdraw
component directly in your project:
import { Withdraw } from "@orderly.network/react";
export const App = () => {
return <Withdraw />;
};
Modal mode
You can also choose to displays the withdraw
component through a modal:
import { Withdraw, modal } from "@orderly.network/react";
const { dialog } = modal;
export const App = () => {
return (
<Button
onClick={() => {
dialog({
title: "Withdraw",
content: <Withdraw />
});
}}
>
Open deposit dialog
</Button>
);
};
AssetsProvider
APIs
onOk
- Type:
(data: any) => void
- Required: false
Callback function after the withdrawal is complete, providing the status of the withdrawal request.
onCancel
- Type:
() => void
- Required: false
Callback function after the withdrawal has been canceled.