add secret hash field

This commit is contained in:
TheJuze
2024-06-11 16:12:29 +03:00
parent 6017224f4c
commit c07e6727c4
3 changed files with 21 additions and 18 deletions

View File

@@ -3,7 +3,8 @@ import subOrderStatuses from './subOrderStatuses.js';
const orderStatuses = [
...subOrderStatuses,
'ROUTING', // order got sub orders, but not all of them have status ACCEPTED
'TRANSFER' // TX_PENDING > TRANSFER > SETTLED
'TRANSFER', // TX_PENDING > TRANSFER > SETTLED
'REFUNDED' // TX_PENDING > TRANSFER > CANCELED > REFUNDED
] as const;
export default orderStatuses;

View File

@@ -86,6 +86,8 @@ export const fullOrderSchema = z.object({
ro: z.boolean().optional(), // is reversed order
sc: z.string().optional(), // source chain
tc: z.string().optional(), // target chain
ir: z.string().optional(), // is refundable
sh: z.string().optional(), // secret hash
}).transform((val) => ({
...val,
k: 'full' as const,
@@ -109,6 +111,7 @@ export const fullOrderSchema = z.object({
isReversedOrder: o.ro,
sourceChain: o.sc,
targetChain: o.tc,
isRefundable: o.ir,
subOrders: o.c.map((so) => ({
pair: so.P,
exchange: so.e,