44 lines
1.8 KiB
TypeScript
44 lines
1.8 KiB
TypeScript
import type { Treaty } from "@elysiajs/eden";
|
|
import type { client } from ".";
|
|
import type { AssetCodeEnum, PaymentChannelEnum, WithdrawMethodEnum } from "./enum";
|
|
|
|
export type DepositFiatBody = Parameters<typeof client.api.deposit.fiat.post>[0] & {
|
|
paymentChannel: PaymentChannelEnum;
|
|
assetCode: AssetCodeEnum;
|
|
};
|
|
|
|
export type TreatyQuery<T> = T extends (...args: any[]) => any
|
|
? NonNullable<NonNullable<Parameters<T>[0]>["query"]>
|
|
: never;
|
|
|
|
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.withdraw.post>[0], "assetCode" | "withdrawMethod"> & {
|
|
assetCode: AssetCodeEnum;
|
|
withdrawMethod: WithdrawMethodEnum;
|
|
};
|
|
|
|
export type UserProfileData = Treaty.Data<typeof client.api.user.profile.get>["userProfile"];
|
|
|
|
export type UpdateUserProfileBody = TreatyQuery<typeof client.api.user.profile.put>;
|
|
|
|
export type RwaIssuanceProductsData = Treaty.Data<typeof client.api.rwa.issuance.products.bundle.post>;
|
|
|
|
export type RwaIssuanceProductBody = TreatyQuery<typeof client.api.rwa.issuance.products.bundle.post>;
|
|
|
|
export type RwaIssuanceCategoriesData = Treaty.Data<typeof client.api.rwa.issuance.categories.get>;
|
|
|
|
export type BankAccountsData = Treaty.Data<typeof client.api.bank_account.get>;
|
|
|
|
export type BankAccountBody = TreatyQuery<typeof client.api.bank_account.post>;
|
|
|
|
export type BankAccountData = Treaty.Data<typeof client.api.bank_account.post>;
|
|
|
|
export type SupportBanksData = Treaty.Data<typeof client.api.bank_account.banks.get>;
|
|
|
|
export type AvailableSubscriptionData = Treaty.Data<typeof client.api.rwa.subscription.available_editions.get>;
|
|
|
|
export type AvailableSubscriptionBody = TreatyQuery<typeof client.api.rwa.subscription.available_editions.get>;
|