@gardenfi/core 0.2.0-beta.63 → 0.2.0-beta.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Garden } from './lib/garden/garden';
|
|
2
|
-
export type { IGardenJS, SwapParams, GardenEvents, IOrderExecutorCache, OrderCacheValue, EventCallback, } from './lib/garden/garden.types';
|
|
2
|
+
export type { IGardenJS, SwapParams, GardenEvents, IOrderExecutorCache, OrderCacheValue, EventCallback, OrderWithStatus, } from './lib/garden/garden.types';
|
|
3
3
|
export { OrderActions, TimeLocks } from './lib/garden/garden.types';
|
|
4
4
|
export { BlockNumberFetcher } from './lib/garden/blockNumber';
|
|
5
5
|
export type { IBlockNumberFetcher, Network } from './lib/garden/blockNumber';
|
|
@@ -51,4 +51,5 @@ export declare class Garden implements IGardenJS {
|
|
|
51
51
|
on<E extends keyof GardenEvents>(event: E, cb: GardenEvents[E]): void;
|
|
52
52
|
off<E extends keyof GardenEvents>(event: E, cb: GardenEvents[E]): void;
|
|
53
53
|
private fetchCurrentBlockNumbers;
|
|
54
|
+
private assignOrderStatus;
|
|
54
55
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AsyncResult } from '@catalogfi/utils';
|
|
2
2
|
import { Asset, MatchedOrder } from '@gardenfi/orderbook';
|
|
3
|
+
import { OrderStatus } from '../status';
|
|
3
4
|
|
|
4
5
|
export type SwapParams = {
|
|
5
6
|
/**
|
|
@@ -44,10 +45,13 @@ export declare enum TimeLocks {
|
|
|
44
45
|
evm = 14400,
|
|
45
46
|
btc = 288
|
|
46
47
|
}
|
|
48
|
+
export type OrderWithStatus = MatchedOrder & {
|
|
49
|
+
status: OrderStatus;
|
|
50
|
+
};
|
|
47
51
|
export type GardenEvents = {
|
|
48
52
|
error: (order: MatchedOrder, error: string) => void;
|
|
49
53
|
success: (order: MatchedOrder, action: OrderActions, result: string) => void;
|
|
50
|
-
onPendingOrdersChanged: (orders:
|
|
54
|
+
onPendingOrdersChanged: (orders: OrderWithStatus[]) => void;
|
|
51
55
|
log: (id: string, message: string) => void;
|
|
52
56
|
};
|
|
53
57
|
export type EventCallback = (...args: any[]) => void;
|
|
@@ -26,5 +26,11 @@ export declare const ParseSwapStatus: (swap: Swap, currentBlockNumber: number) =
|
|
|
26
26
|
* @returns {OrderActions} The action to be performed on the order
|
|
27
27
|
*/
|
|
28
28
|
export declare const parseAction: (order: MatchedOrder, sourceChainCurrentBlockNumber: number, destChainCurrentBlockNumber: number) => OrderActions;
|
|
29
|
+
/**
|
|
30
|
+
* Parse the action to be performed on the order based on the order status.
|
|
31
|
+
* @param status Order status
|
|
32
|
+
* @returns {OrderActions} The action to be performed on the order
|
|
33
|
+
*/
|
|
34
|
+
export declare const parseActionFromStatus: (status: OrderStatus) => OrderActions;
|
|
29
35
|
export declare const isExpired: (unixTime: number, tillHours?: number) => boolean;
|
|
30
36
|
export declare const filterDeadlineExpiredOrders: (orders: MatchedOrder[]) => MatchedOrder[];
|