fix schemas

This commit is contained in:
Kirill Litvinov
2024-05-13 17:21:51 +03:00
parent 71ba0ca5fc
commit 275547340e
5 changed files with 6 additions and 13 deletions

View File

@@ -52,13 +52,11 @@ const swapInfoBase = z.object({
autoSlippage: z.number().optional(),
});
const swapInfoByAmountIn = swapInfoBase.extend({
const swapInfoSchema = swapInfoBase.extend({
availableAmountOut: z.null(),
availableAmountIn: z.number(),
marketAmountOut: z.number().nullable(),
marketAmountIn: z.null(),
});
const swapInfoSchema = swapInfoByAmountIn;
export default swapInfoSchema;

View File

@@ -51,12 +51,9 @@ const swapInfoSchemaBase = baseMessageSchema.extend({
sl: z.number().optional(),
});
const swapInfoSchemaByAmountIn = swapInfoSchemaBase.extend({
const swapInfoSchema = swapInfoSchemaBase.extend({
mo: z.number().optional(), // market amount out
aa: z.number(), // available amount in
});
const swapInfoSchema = swapInfoSchemaByAmountIn;
export default swapInfoSchema;

View File

@@ -213,13 +213,11 @@ export type SwapInfoBase = {
autoSlippage: number | undefined
}
export type SwapInfoByAmountIn = SwapInfoBase & {
export type SwapInfo = SwapInfoBase & {
availableAmountIn?: number | undefined
marketAmountOut?: number | undefined
}
export type SwapInfo = SwapInfoByAmountIn;
export enum HistoryTransactionStatus {
PENDING = 'Pending',
DONE = 'Done',