feat: add withdraw functionality and related enums
- Introduced WithdrawMethodEnum and ChainEnum in enum.ts for withdrawal methods and blockchain types. - Updated types.ts to include WithdrawBody type for withdrawal requests. - Created a new useResetRef composable for managing form state resets. - Added a withdraw page with form handling in index.vue, including validation and submission logic. - Integrated the new withdraw functionality into the wallet card component. - Updated the main.ts file to include Pinia for state management. - Created a wallet store to manage user balances. - Modified the deposit page to improve user experience and validation. - Added number pattern validation for input fields. - Updated the router to include a new route for the withdraw page. - Refactored input-label component styles for better layout. - Added a new rules.ts file for future validation rules.
This commit is contained in:
@@ -7,3 +7,15 @@ export enum AssetCodeEnum {
|
||||
USDT = "USDT",
|
||||
OPTS = "OPTS",
|
||||
}
|
||||
|
||||
export enum WithdrawMethodEnum {
|
||||
BANK = "bank",
|
||||
CRYPTO = "crypto",
|
||||
CASH = "cash",
|
||||
}
|
||||
|
||||
export enum ChainEnum {
|
||||
BEP20 = "BEP20",
|
||||
ERC20 = "ERC20",
|
||||
TRC20 = "TRC20",
|
||||
}
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
import type { Treaty } from "@elysiajs/eden";
|
||||
import type { client } from ".";
|
||||
import type { AssetCodeEnum, PaymentChannelEnum } from "./enum";
|
||||
import type { AssetCodeEnum, PaymentChannelEnum, WithdrawMethodEnum } from "./enum";
|
||||
|
||||
export type DepositFiatBody = Parameters<typeof client.api.asset.deposit.fiat.post>[0] & {
|
||||
export type DepositFiatBody = Parameters<typeof client.api.deposit.fiat.post>[0] & {
|
||||
paymentChannel: PaymentChannelEnum;
|
||||
assetCode: AssetCodeEnum;
|
||||
};
|
||||
|
||||
export type DepositFiatData = Treaty.Data<typeof client.api.asset.deposit.fiat.post>;
|
||||
export type DepositFiatData = Treaty.Data<typeof client.api.deposit.fiat.post>;
|
||||
|
||||
export type BalancesData = Treaty.Data<typeof client.api.asset.balances.get>;
|
||||
|
||||
export type WithdrawBody = Omit<Parameters<typeof client.api.asset.withdraw.post>[0], "assetCode" | "withdrawMethod"> & {
|
||||
assetCode: AssetCodeEnum;
|
||||
withdrawMethod: WithdrawMethodEnum;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user