@orderly.network/hooks 1.1.5-rc.0 → 1.1.6
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/esm/dataProvider.d.ts +4 -3
- package/esm/dataProvider.d.ts.map +1 -1
- package/esm/dataProvider.js +5 -0
- package/esm/index.d.ts +4 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -0
- package/esm/orderly/useMarketsStream.d.ts.map +1 -1
- package/esm/orderly/useMarketsStream.js +1 -0
- package/esm/orderly/useMaxQty.d.ts.map +1 -1
- package/esm/orderly/useMaxQty.js +14 -27
- package/esm/orderly/useOrderEntry.js +19 -6
- package/esm/orderly/useOrderStream.d.ts +10 -1
- package/esm/orderly/useOrderStream.d.ts.map +1 -1
- package/esm/orderly/useOrderStream.js +29 -26
- package/esm/orderly/useOrderbookStream.d.ts.map +1 -1
- package/esm/orderly/useOrderbookStream.js +20 -13
- package/esm/orderly/usePositionStream.js +1 -1
- package/esm/orderly/usePrivateDataObserver.d.ts.map +1 -1
- package/esm/orderly/usePrivateDataObserver.js +62 -42
- package/esm/services/painter/backgroundPaint.d.ts +4 -4
- package/esm/services/painter/basePaint.d.ts +17 -8
- package/esm/services/painter/basePaint.d.ts.map +1 -1
- package/esm/services/painter/dataPaint.d.ts +4 -3
- package/esm/services/painter/dataPaint.d.ts.map +1 -1
- package/esm/services/painter/dataPaint.js +72 -35
- package/esm/services/painter/layout.config.d.ts +2 -2
- package/esm/services/painter/layout.config.d.ts.map +1 -1
- package/esm/services/painter/layout.config.js +13 -8
- package/esm/services/painter/painter.d.ts +6 -4
- package/esm/services/painter/painter.d.ts.map +1 -1
- package/esm/services/painter/painter.js +4 -4
- package/esm/unuse/apiPrefixMiddleware.d.ts.map +1 -1
- package/esm/unuse/apiPrefixMiddleware.js +0 -2
- package/esm/useLocalStorage.d.ts.map +1 -1
- package/esm/useLocalStorage.js +2 -4
- package/esm/useMutation.d.ts +4 -1
- package/esm/useMutation.d.ts.map +1 -1
- package/esm/useMutation.js +29 -2
- package/esm/usePoster.d.ts +30 -4
- package/esm/usePoster.d.ts.map +1 -1
- package/esm/usePoster.js +95 -24
- package/esm/utils/dev.d.ts +2 -0
- package/esm/utils/dev.d.ts.map +1 -0
- package/esm/utils/dev.js +18 -0
- package/esm/utils/swr.d.ts +10 -0
- package/esm/utils/swr.d.ts.map +1 -0
- package/esm/utils/swr.js +195 -0
- package/esm/version.d.ts +1 -1
- package/esm/version.d.ts.map +1 -1
- package/esm/version.js +2 -2
- package/lib/dataProvider.d.ts +4 -3
- package/lib/dataProvider.d.ts.map +1 -1
- package/lib/dataProvider.js +5 -0
- package/lib/index.d.ts +4 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -1
- package/lib/orderly/useMarketsStream.d.ts.map +1 -1
- package/lib/orderly/useMarketsStream.js +1 -0
- package/lib/orderly/useMaxQty.d.ts.map +1 -1
- package/lib/orderly/useMaxQty.js +14 -27
- package/lib/orderly/useOrderEntry.js +16 -3
- package/lib/orderly/useOrderStream.d.ts +10 -1
- package/lib/orderly/useOrderStream.d.ts.map +1 -1
- package/lib/orderly/useOrderStream.js +29 -26
- package/lib/orderly/useOrderbookStream.d.ts.map +1 -1
- package/lib/orderly/useOrderbookStream.js +20 -13
- package/lib/orderly/usePositionStream.js +1 -1
- package/lib/orderly/usePrivateDataObserver.d.ts.map +1 -1
- package/lib/orderly/usePrivateDataObserver.js +61 -41
- package/lib/services/painter/backgroundPaint.d.ts +4 -4
- package/lib/services/painter/basePaint.d.ts +17 -8
- package/lib/services/painter/basePaint.d.ts.map +1 -1
- package/lib/services/painter/dataPaint.d.ts +4 -3
- package/lib/services/painter/dataPaint.d.ts.map +1 -1
- package/lib/services/painter/dataPaint.js +72 -35
- package/lib/services/painter/layout.config.d.ts +2 -2
- package/lib/services/painter/layout.config.d.ts.map +1 -1
- package/lib/services/painter/layout.config.js +14 -9
- package/lib/services/painter/painter.d.ts +6 -4
- package/lib/services/painter/painter.d.ts.map +1 -1
- package/lib/services/painter/painter.js +4 -4
- package/lib/unuse/apiPrefixMiddleware.d.ts.map +1 -1
- package/lib/unuse/apiPrefixMiddleware.js +0 -2
- package/lib/useLocalStorage.d.ts.map +1 -1
- package/lib/useLocalStorage.js +2 -4
- package/lib/useMutation.d.ts +4 -1
- package/lib/useMutation.d.ts.map +1 -1
- package/lib/useMutation.js +29 -2
- package/lib/usePoster.d.ts +30 -4
- package/lib/usePoster.d.ts.map +1 -1
- package/lib/usePoster.js +93 -22
- package/lib/utils/dev.d.ts +2 -0
- package/lib/utils/dev.d.ts.map +1 -0
- package/lib/utils/dev.js +20 -0
- package/lib/utils/swr.d.ts +10 -0
- package/lib/utils/swr.d.ts.map +1 -0
- package/lib/utils/swr.js +200 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.d.ts.map +1 -1
- package/lib/version.js +2 -2
- package/package.json +8 -8
package/esm/dataProvider.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
2
|
export type getKeyFunction = (index: number, prevData: any) => string | null;
|
|
3
|
-
interface
|
|
3
|
+
interface DataCenterContextState {
|
|
4
4
|
regesterKeyHandler: (key: string, handler: getKeyFunction) => void;
|
|
5
|
+
unregisterKeyHandler: (key: string) => void;
|
|
5
6
|
}
|
|
6
|
-
export declare const DataCenterContext: import("react").Context<
|
|
7
|
-
export declare const useDataCenterContext: () =>
|
|
7
|
+
export declare const DataCenterContext: import("react").Context<DataCenterContextState>;
|
|
8
|
+
export declare const useDataCenterContext: () => DataCenterContextState;
|
|
8
9
|
export declare const DataCenterProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=dataProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataProvider.d.ts","sourceRoot":"","sources":["../src/dataProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAqC,MAAM,OAAO,CAAC;AAI7E,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,MAAM,GAAG,IAAI,CAAC;AAE7E,UAAU,sBAAsB;IAK9B,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"dataProvider.d.ts","sourceRoot":"","sources":["../src/dataProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAqC,MAAM,OAAO,CAAC;AAI7E,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,MAAM,GAAG,IAAI,CAAC;AAE7E,UAAU,sBAAsB;IAK9B,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IACnE,oBAAoB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,iBAAiB,iDAE7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,8BAAsC,CAAC;AAExE,eAAO,MAAM,kBAAkB,iBAAkB,iBAAiB,mDAqCjE,CAAC"}
|
package/esm/dataProvider.js
CHANGED
|
@@ -23,7 +23,12 @@ export const DataCenterProvider = ({ children }) => {
|
|
|
23
23
|
return null;
|
|
24
24
|
return (_jsx(DataCenterContext.Provider, { value: {
|
|
25
25
|
regesterKeyHandler: (key, fun) => {
|
|
26
|
+
console.log("regesterKeyHandler", key);
|
|
26
27
|
getKeyHandlerMapRef.current.set(key, fun);
|
|
27
28
|
},
|
|
29
|
+
unregisterKeyHandler: (key) => {
|
|
30
|
+
console.log("unregisterKeyHandler", key);
|
|
31
|
+
getKeyHandlerMapRef.current.delete(key);
|
|
32
|
+
},
|
|
28
33
|
}, children: children }));
|
|
29
34
|
};
|
package/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "./utils/dev";
|
|
1
2
|
export { default as version } from "./version";
|
|
2
3
|
export { useQuery } from "./useQuery";
|
|
3
4
|
export { useLazyQuery } from "./useLazyQuery";
|
|
@@ -26,7 +27,9 @@ import useSWR, { type SWRConfiguration, SWRConfig } from "swr";
|
|
|
26
27
|
export { useSWR, SWRConfig, type SWRConfiguration };
|
|
27
28
|
export * from "use-debounce";
|
|
28
29
|
export { useMediaQuery } from "./useMediaQuery";
|
|
29
|
-
export { usePoster
|
|
30
|
+
export { usePoster } from "./usePoster";
|
|
31
|
+
export { DefaultLayoutConfig } from "./services/painter/layout.config";
|
|
32
|
+
export type { PosterLayoutConfig, DrawOptions, } from "./services/painter/basePaint";
|
|
30
33
|
export * from "./orderly/orderlyHooks";
|
|
31
34
|
export { cleanStringStyle } from "./utils/orderEntryHelper";
|
|
32
35
|
export type { WalletAdapter } from "@orderly.network/core";
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EACL,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAElC,cAAc,wBAAwB,CAAC;AAEvC,OAAO,MAAM,EAAE,EAAE,KAAK,gBAAgB,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,CAAC;AAEpD,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,YAAY,EACV,kBAAkB,EAClB,WAAW,GACZ,MAAM,8BAA8B,CAAC;AAEtC,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
|
package/esm/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "./utils/dev";
|
|
1
2
|
export { default as version } from "./version";
|
|
2
3
|
export { useQuery } from "./useQuery";
|
|
3
4
|
export { useLazyQuery } from "./useLazyQuery";
|
|
@@ -26,5 +27,6 @@ export { useSWR, SWRConfig };
|
|
|
26
27
|
export * from "use-debounce";
|
|
27
28
|
export { useMediaQuery } from "./useMediaQuery";
|
|
28
29
|
export { usePoster } from "./usePoster";
|
|
30
|
+
export { DefaultLayoutConfig } from "./services/painter/layout.config";
|
|
29
31
|
export * from "./orderly/orderlyHooks";
|
|
30
32
|
export { cleanStringStyle } from "./utils/orderEntryHelper";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMarketsStream.d.ts","sourceRoot":"","sources":["../../src/orderly/useMarketsStream.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,eAAO,MAAM,gBAAgB;;
|
|
1
|
+
{"version":3,"file":"useMarketsStream.d.ts","sourceRoot":"","sources":["../../src/orderly/useMarketsStream.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,eAAO,MAAM,gBAAgB;;CA6D5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMaxQty.d.ts","sourceRoot":"","sources":["../../src/orderly/useMaxQty.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"useMaxQty.d.ts","sourceRoot":"","sources":["../../src/orderly/useMaxQty.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAe,MAAM,wBAAwB,CAAC;AAe1E,eAAO,MAAM,SAAS,WACZ,MAAM,QACR,SAAS,eACH,OAAO,WA2HpB,CAAC"}
|
package/esm/orderly/useMaxQty.js
CHANGED
|
@@ -17,32 +17,6 @@ export const useMaxQty = (symbol, side, reduceOnly = false) => {
|
|
|
17
17
|
const { totalCollateral } = useCollateral();
|
|
18
18
|
const { data: markPrices } = useMarkPricesStream();
|
|
19
19
|
const [orders] = useOrderStream({ status: OrderStatus.NEW });
|
|
20
|
-
// const {
|
|
21
|
-
// data: orders,
|
|
22
|
-
// error,
|
|
23
|
-
// mutate: updateOrder,
|
|
24
|
-
// } = usePrivateQuery<API.Order[]>(`/v1/orders?status=NEW&size=99`, {
|
|
25
|
-
// formatter: (data) => data.rows,
|
|
26
|
-
// onError: (err) => { },
|
|
27
|
-
// });
|
|
28
|
-
// const ws = useWS();
|
|
29
|
-
// useEffect(() => {
|
|
30
|
-
// const unsubscribe = ws.privateSubscribe(
|
|
31
|
-
// {
|
|
32
|
-
// id: "executionreport_orders",
|
|
33
|
-
// event: "subscribe",
|
|
34
|
-
// topic: "executionreport",
|
|
35
|
-
// ts: Date.now(),
|
|
36
|
-
// },
|
|
37
|
-
// {
|
|
38
|
-
// onMessage: (data: any) => {
|
|
39
|
-
// console.log("refresh orders", data);
|
|
40
|
-
// updateOrder();
|
|
41
|
-
// },
|
|
42
|
-
// }
|
|
43
|
-
// );
|
|
44
|
-
// return () => unsubscribe();
|
|
45
|
-
// }, []);
|
|
46
20
|
const maxQty = useMemo(() => {
|
|
47
21
|
if (!symbol)
|
|
48
22
|
return 0;
|
|
@@ -91,7 +65,7 @@ export const useMaxQty = (symbol, side, reduceOnly = false) => {
|
|
|
91
65
|
baseMaxQty: getSymbolInfo("base_max"),
|
|
92
66
|
totalCollateral,
|
|
93
67
|
maxLeverage: accountInfo.max_leverage,
|
|
94
|
-
takerFeeRate: accountInfo.
|
|
68
|
+
takerFeeRate: accountInfo.futures_taker_fee_rate,
|
|
95
69
|
baseIMR: getSymbolInfo("base_imr"),
|
|
96
70
|
otherIMs,
|
|
97
71
|
positionQty,
|
|
@@ -110,5 +84,18 @@ export const useMaxQty = (symbol, side, reduceOnly = false) => {
|
|
|
110
84
|
totalCollateral,
|
|
111
85
|
reduceOnly,
|
|
112
86
|
]);
|
|
87
|
+
// debugPrint({
|
|
88
|
+
// maxQty,
|
|
89
|
+
// totalCollateral,
|
|
90
|
+
// side,
|
|
91
|
+
// // reduceOnly,
|
|
92
|
+
// orders: orders?.map((o) => o.quantity),
|
|
93
|
+
// // positionsData,
|
|
94
|
+
// // markPrices,
|
|
95
|
+
// // accountInfo,
|
|
96
|
+
// // symbolInfo,
|
|
97
|
+
// // symbol,
|
|
98
|
+
// });
|
|
99
|
+
// console.log("maxQty", maxQty);
|
|
113
100
|
return Math.max(maxQty, 0);
|
|
114
101
|
};
|
|
@@ -9,7 +9,7 @@ import { useCollateral } from "./useCollateral";
|
|
|
9
9
|
import { useMaxQty } from "./useMaxQty";
|
|
10
10
|
import { OrderFactory, availableOrderTypes } from "../utils/createOrder";
|
|
11
11
|
import { useMarkPrice } from "./useMarkPrice";
|
|
12
|
-
import { order } from "@orderly.network/perp";
|
|
12
|
+
import { order as orderUtils } from "@orderly.network/perp";
|
|
13
13
|
import { useEventEmitter } from "../useEventEmitter";
|
|
14
14
|
import { useDebouncedCallback } from "use-debounce";
|
|
15
15
|
export function useOrderEntry(symbolOrOrder, sideOrOptions, reduceOnly, options) {
|
|
@@ -182,7 +182,7 @@ export function useOrderEntry(symbolOrOrder, sideOrOptions, reduceOnly, options)
|
|
|
182
182
|
]);
|
|
183
183
|
const isStopOrder = parsedData?.order_type === OrderType.STOP_LIMIT ||
|
|
184
184
|
parsedData?.order_type === OrderType.STOP_MARKET;
|
|
185
|
-
const [doCreateOrder, {
|
|
185
|
+
const [doCreateOrder, { isMutating }] = useMutation(isStopOrder ? "/v1/algo/order" : "/v1/order");
|
|
186
186
|
// const maxQty = 3;
|
|
187
187
|
const createOrder = (values) => {
|
|
188
188
|
if (!values.symbol) {
|
|
@@ -233,9 +233,16 @@ export function useOrderEntry(symbolOrOrder, sideOrOptions, reduceOnly, options)
|
|
|
233
233
|
// ...omit(["order_price"], values),
|
|
234
234
|
...data,
|
|
235
235
|
})).then((res) => {
|
|
236
|
-
|
|
236
|
+
console.log("--------------------res::::", res);
|
|
237
237
|
// resolve(res);
|
|
238
238
|
if (res.success) {
|
|
239
|
+
// TODO: remove when the WS service is fixed
|
|
240
|
+
if (Array.isArray(res.data.rows)) {
|
|
241
|
+
ee.emit("algoOrder:cache", {
|
|
242
|
+
...res.data.rows[0],
|
|
243
|
+
trigger_price: data.trigger_price,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
239
246
|
resolve(res.data);
|
|
240
247
|
}
|
|
241
248
|
else {
|
|
@@ -348,7 +355,7 @@ export function useOrderEntry(symbolOrOrder, sideOrOptions, reduceOnly, options)
|
|
|
348
355
|
}
|
|
349
356
|
ee.on("orderbook:update", onOrderbookUpdate);
|
|
350
357
|
return () => {
|
|
351
|
-
ee.off("
|
|
358
|
+
ee.off("orderbook:update", onOrderbookUpdate);
|
|
352
359
|
};
|
|
353
360
|
}, [optionsValue?.watchOrderbook]);
|
|
354
361
|
useEffect(() => {
|
|
@@ -424,13 +431,19 @@ export function useOrderEntry(symbolOrOrder, sideOrOptions, reduceOnly, options)
|
|
|
424
431
|
const { price, quantity } = result;
|
|
425
432
|
if (!price || !quantity)
|
|
426
433
|
return null;
|
|
427
|
-
const
|
|
434
|
+
const orderFee = orderUtils.orderFee({
|
|
435
|
+
qty: quantity,
|
|
436
|
+
price,
|
|
437
|
+
futuresTakeFeeRate: Number(accountInfo["futures_taker_fee_rate"]) / 10000,
|
|
438
|
+
});
|
|
439
|
+
const liqPrice = orderUtils.estLiqPrice({
|
|
428
440
|
markPrice,
|
|
429
441
|
baseIMR,
|
|
430
442
|
baseMMR,
|
|
431
443
|
totalCollateral,
|
|
432
444
|
positions,
|
|
433
445
|
IMR_Factor: accountInfo["imr_factor"][symbol],
|
|
446
|
+
orderFee,
|
|
434
447
|
newOrder: {
|
|
435
448
|
qty: quantity,
|
|
436
449
|
price,
|
|
@@ -458,7 +471,7 @@ export function useOrderEntry(symbolOrOrder, sideOrOptions, reduceOnly, options)
|
|
|
458
471
|
const result = getPriceAndQty(formattedOrder);
|
|
459
472
|
if (result === null || !result.price || !result.quantity)
|
|
460
473
|
return null;
|
|
461
|
-
const leverage =
|
|
474
|
+
const leverage = orderUtils.estLeverage({
|
|
462
475
|
totalCollateral,
|
|
463
476
|
positions,
|
|
464
477
|
newOrder: {
|
|
@@ -11,7 +11,16 @@ type Params = {
|
|
|
11
11
|
size?: number;
|
|
12
12
|
side?: OrderSide;
|
|
13
13
|
};
|
|
14
|
-
export declare const useOrderStream: (params: Params
|
|
14
|
+
export declare const useOrderStream: (params: Params, options?: {
|
|
15
|
+
/**
|
|
16
|
+
* Keep the state update alive
|
|
17
|
+
*/
|
|
18
|
+
keeplive?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Stop the state update when the component unmount
|
|
21
|
+
*/
|
|
22
|
+
stopOnUnmount?: boolean;
|
|
23
|
+
}) => readonly [any[] | null, {
|
|
15
24
|
readonly total: any;
|
|
16
25
|
readonly isLoading: boolean;
|
|
17
26
|
readonly refresh: import("swr/_internal").KeyedMutator<any[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOrderStream.d.ts","sourceRoot":"","sources":["../../src/orderly/useOrderStream.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EAEZ,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"useOrderStream.d.ts","sourceRoot":"","sources":["../../src/orderly/useOrderStream.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EAEZ,MAAM,wBAAwB,CAAC;AAUhC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAC9B;AAID,KAAK,MAAM,GAAG;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,cAAc,WAIjB,MAAM,YAEJ;IACR;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;;;;;;oCA+GyC,MAAM,SAAS,WAAW;oCA8D1B,MAAM,WAAW,MAAM;wCAvDnB,MAAM,SAAS,WAAW;wCA8D1B,MAAM,WAAW,MAAM;;;;;;;;;;;;;EAkCtE,CAAC"}
|
|
@@ -5,40 +5,32 @@ import { useMarkPricesStream } from "./useMarkPricesStream";
|
|
|
5
5
|
import { useMutation } from "../useMutation";
|
|
6
6
|
import version from "../version";
|
|
7
7
|
import { useDataCenterContext } from "../dataProvider";
|
|
8
|
-
|
|
8
|
+
import { generateKeyFun } from "../utils/swr";
|
|
9
|
+
import { useEventEmitter } from "../useEventEmitter";
|
|
10
|
+
export const useOrderStream = (
|
|
11
|
+
/**
|
|
12
|
+
* Orders query params
|
|
13
|
+
*/
|
|
14
|
+
params, options) => {
|
|
9
15
|
const { status, symbol, side, size = 100 } = params;
|
|
10
16
|
const { data: markPrices = {} } = useMarkPricesStream();
|
|
11
|
-
const
|
|
17
|
+
const ee = useEventEmitter();
|
|
18
|
+
const { regesterKeyHandler, unregisterKeyHandler } = useDataCenterContext();
|
|
12
19
|
const [doCancelOrder, { error: cancelOrderError, isMutating: cancelMutating },] = useMutation("/v1/order", "DELETE");
|
|
13
20
|
const [doUpdateOrder, { error: updateOrderError, isMutating: updateMutating },] = useMutation("/v1/order", "PUT");
|
|
14
21
|
const [doCanceAlgolOrder, { error: cancelAlgoOrderError, isMutating: cancelAlgoMutating },] = useMutation("/v1/algo/order", "DELETE");
|
|
15
22
|
const [doUpdateAlgoOrder, { error: updateAlgoOrderError, isMutating: updateAlgoMutating },] = useMutation("/v1/algo/order", "PUT");
|
|
16
|
-
const getKey = (pageIndex, previousPageData) => {
|
|
17
|
-
// reached the end
|
|
18
|
-
if (previousPageData && !previousPageData.rows?.length)
|
|
19
|
-
return null;
|
|
20
|
-
const search = new URLSearchParams([
|
|
21
|
-
["size", size.toString()],
|
|
22
|
-
["page", `${pageIndex + 1}`],
|
|
23
|
-
["source_type", "ALL"],
|
|
24
|
-
]);
|
|
25
|
-
if (status) {
|
|
26
|
-
search.set(`status`, status);
|
|
27
|
-
}
|
|
28
|
-
if (symbol) {
|
|
29
|
-
search.set(`symbol`, symbol);
|
|
30
|
-
}
|
|
31
|
-
if (side) {
|
|
32
|
-
search.set(`side`, side);
|
|
33
|
-
}
|
|
34
|
-
return `/v1/orders?${search.toString()}`;
|
|
35
|
-
};
|
|
36
23
|
useEffect(() => {
|
|
37
24
|
const formatKey = (value) => (value ? `:${value}` : "");
|
|
38
25
|
const key = `orders${formatKey(status)}${formatKey(symbol)}${formatKey(side)}`;
|
|
39
|
-
regesterKeyHandler(key,
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
regesterKeyHandler?.(key, generateKeyFun({ status, symbol, side, size }));
|
|
27
|
+
return () => {
|
|
28
|
+
if (!options?.stopOnUnmount)
|
|
29
|
+
return;
|
|
30
|
+
unregisterKeyHandler(key);
|
|
31
|
+
};
|
|
32
|
+
}, [status, symbol, side, options?.keeplive]);
|
|
33
|
+
const ordersResponse = usePrivateInfiniteQuery(generateKeyFun({ status, symbol, side, size }), {
|
|
42
34
|
initialSize: 1,
|
|
43
35
|
// revalidateFirstPage: false,
|
|
44
36
|
// onError: (err) => {
|
|
@@ -53,6 +45,7 @@ export const useOrderStream = (params) => {
|
|
|
53
45
|
}
|
|
54
46
|
return ordersResponse.data?.map((item) => item.rows)?.flat();
|
|
55
47
|
}, [ordersResponse.data]);
|
|
48
|
+
// console.log(ordersResponse.data);
|
|
56
49
|
const orders = useMemo(() => {
|
|
57
50
|
if (!flattenOrders) {
|
|
58
51
|
return null;
|
|
@@ -97,7 +90,17 @@ export const useOrderStream = (params) => {
|
|
|
97
90
|
* update algo order
|
|
98
91
|
*/
|
|
99
92
|
const updateAlgoOrder = useCallback((orderId, order) => {
|
|
100
|
-
return _updateOrder(orderId, order, "algoOrder")
|
|
93
|
+
return _updateOrder(orderId, order, "algoOrder").then((res) => {
|
|
94
|
+
// TODO: remove this when the WS service provides the correct data
|
|
95
|
+
ee.emit("algoOrder:cache", {
|
|
96
|
+
// ...res.data.rows[0],
|
|
97
|
+
...order,
|
|
98
|
+
order_id: Number(orderId),
|
|
99
|
+
// trigger_price: price,
|
|
100
|
+
});
|
|
101
|
+
//------------fix end----------------
|
|
102
|
+
return res;
|
|
103
|
+
});
|
|
101
104
|
}, []);
|
|
102
105
|
const _cancelOrder = useCallback((orderId, type, symbol) => {
|
|
103
106
|
switch (type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOrderbookStream.d.ts","sourceRoot":"","sources":["../../src/orderly/useOrderbookStream.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC;AAErC,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,IAAI,EAAE,aAAa,EAAE,CAAC;CACvB,CAAC;AAyFF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,UACnB,MAAM,GAAG,SAAS,SAClB,MAAM,WACJ,OAAO,QACV,aAAa,KAClB,
|
|
1
|
+
{"version":3,"file":"useOrderbookStream.d.ts","sourceRoot":"","sources":["../../src/orderly/useOrderbookStream.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC;AAErC,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,IAAI,EAAE,aAAa,EAAE,CAAC;CACvB,CAAC;AAyFF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,UACnB,MAAM,GAAG,SAAS,SAClB,MAAM,WACJ,OAAO,QACV,aAAa,KAClB,aAyDF,CAAC;AAgCF,eAAO,MAAM,cAAc,SAAU,aAAa,UAAU,aAAa;;;CAWxE,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,WACrB,MAAM,YACL,aAAa,YACZ,gBAAgB;;;;;;;;;;;2BAgIgB,MAAM;;;;;;;;;IAmDjD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -95,18 +95,22 @@ export const reduceOrderbook = (depth, level, padding, data) => {
|
|
|
95
95
|
if (askPrice <= bidPrice) {
|
|
96
96
|
// console.log("xxxxxxxxxxx reset ask list begin", [...asks], { ...asks[0] });
|
|
97
97
|
asks.shift();
|
|
98
|
-
|
|
98
|
+
let logStr = "";
|
|
99
99
|
for (let index = 0; index < asks.length; index++) {
|
|
100
100
|
if (index === 0) {
|
|
101
101
|
const quantity = asks[index][1] + askQty;
|
|
102
102
|
asks[index][1] = quantity;
|
|
103
103
|
asks[index][2] = quantity;
|
|
104
|
-
asks[index][3] += newAmount;
|
|
104
|
+
// asks[index][3] += newAmount;
|
|
105
|
+
// FIXME: fix this code later
|
|
106
|
+
asks[index][3] = Math.ceil(quantity) * asks[index][0];
|
|
105
107
|
}
|
|
106
108
|
else {
|
|
107
|
-
asks[index][3] += newAmount;
|
|
109
|
+
// asks[index][3] += newAmount;
|
|
110
|
+
// FIXME: fix this code later
|
|
111
|
+
asks[index][3] = asks[index][0] * asks[index][1] + asks[index - 1][3];
|
|
108
112
|
}
|
|
109
|
-
|
|
113
|
+
logStr += `index: ${index} ${asks[index]}\n`;
|
|
110
114
|
}
|
|
111
115
|
// console.log("xxxxxxxxxxx reset ask list end", logStr);
|
|
112
116
|
}
|
|
@@ -184,6 +188,8 @@ export const useOrderbookStream = (symbol, initial = INIT_DATA, options) => {
|
|
|
184
188
|
// const [level, setLevel] = useState(() => options?.level ?? 10);
|
|
185
189
|
const config = useSymbolsInfo()[symbol];
|
|
186
190
|
const [depth, setDepth] = useState();
|
|
191
|
+
// markPrice, lastPrice
|
|
192
|
+
const prevMiddlePrice = useRef(0);
|
|
187
193
|
const depths = useMemo(() => {
|
|
188
194
|
const tick = config("quote_tick");
|
|
189
195
|
return [tick, tick * 10, tick * 100, tick * 1000];
|
|
@@ -231,6 +237,7 @@ export const useOrderbookStream = (symbol, initial = INIT_DATA, options) => {
|
|
|
231
237
|
ignore = true;
|
|
232
238
|
// clean the data;
|
|
233
239
|
setData(INIT_DATA);
|
|
240
|
+
prevMiddlePrice.current = 0;
|
|
234
241
|
};
|
|
235
242
|
}, [symbol]);
|
|
236
243
|
// const {data:markPrices} = useMarkPricesStream();
|
|
@@ -259,6 +266,7 @@ export const useOrderbookStream = (symbol, initial = INIT_DATA, options) => {
|
|
|
259
266
|
});
|
|
260
267
|
return () => {
|
|
261
268
|
ignore = true;
|
|
269
|
+
prevMiddlePrice.current = 0;
|
|
262
270
|
subscription?.(); //unsubscribe
|
|
263
271
|
};
|
|
264
272
|
}, [symbol, requestData]);
|
|
@@ -269,12 +277,10 @@ export const useOrderbookStream = (symbol, initial = INIT_DATA, options) => {
|
|
|
269
277
|
//
|
|
270
278
|
setDepth(() => depth);
|
|
271
279
|
}, []);
|
|
272
|
-
// markPrice, lastPrice
|
|
273
|
-
const prevMiddlePrice = useRef(0);
|
|
274
280
|
const middlePrice = useMemo(() => {
|
|
275
281
|
let asksFrist = 0, bidsFirst = 0;
|
|
276
282
|
if (data.asks.length > 0) {
|
|
277
|
-
asksFrist = data.asks[
|
|
283
|
+
asksFrist = data.asks[0][0];
|
|
278
284
|
}
|
|
279
285
|
if (data.bids.length > 0) {
|
|
280
286
|
bidsFirst = data.bids[0][0];
|
|
@@ -282,7 +288,7 @@ export const useOrderbookStream = (symbol, initial = INIT_DATA, options) => {
|
|
|
282
288
|
if (isNaN(asksFrist) || isNaN(bidsFirst) || !ticker)
|
|
283
289
|
return 0;
|
|
284
290
|
return [asksFrist, bidsFirst, ticker["24h_close"]].sort()[1];
|
|
285
|
-
}, [ticker, data]);
|
|
291
|
+
}, [ticker?.["24h_close"], data]);
|
|
286
292
|
useEffect(() => {
|
|
287
293
|
prevMiddlePrice.current = middlePrice;
|
|
288
294
|
}, [middlePrice]);
|
|
@@ -292,11 +298,12 @@ export const useOrderbookStream = (symbol, initial = INIT_DATA, options) => {
|
|
|
292
298
|
});
|
|
293
299
|
// emit the asks0 and bids0
|
|
294
300
|
useEffect(() => {
|
|
295
|
-
|
|
296
|
-
reducedData.asks?.[
|
|
297
|
-
reducedData.bids?.[0]?.[0]
|
|
298
|
-
]
|
|
299
|
-
|
|
301
|
+
const updateData = [
|
|
302
|
+
reducedData.asks?.[reducedData.asks.length - 1]?.[0],
|
|
303
|
+
reducedData.bids?.[0]?.[0]
|
|
304
|
+
];
|
|
305
|
+
eventEmitter.emit("orderbook:update", updateData);
|
|
306
|
+
}, [reducedData.asks?.[reducedData.asks.length - 1]?.[0], reducedData.bids?.[0]?.[0]]);
|
|
300
307
|
return [
|
|
301
308
|
{
|
|
302
309
|
asks: reducedData.asks.slice(-level),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePrivateDataObserver.d.ts","sourceRoot":"","sources":["../../src/orderly/usePrivateDataObserver.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"usePrivateDataObserver.d.ts","sourceRoot":"","sources":["../../src/orderly/usePrivateDataObserver.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,eAAO,MAAM,sBAAsB;uBAEd,MAAM,KAAK,IAAI,MAAM,EAAE,cAAc,CAAC;UA4K1D,CAAC"}
|
|
@@ -1,41 +1,60 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
2
|
import { useWS } from "../useWS";
|
|
3
|
-
import {
|
|
3
|
+
import { mutate } from "swr";
|
|
4
4
|
import { useAccount } from "../useAccount";
|
|
5
5
|
import { unstable_serialize } from "swr/infinite";
|
|
6
|
-
import { useDebouncedCallback } from "use-debounce";
|
|
7
6
|
import { useEventEmitter } from "../useEventEmitter";
|
|
8
|
-
import {
|
|
7
|
+
import { updateOrdersHandler } from "../utils/swr";
|
|
9
8
|
export const usePrivateDataObserver = (options) => {
|
|
10
9
|
const ws = useWS();
|
|
11
|
-
const { mutate } = useSWRConfig();
|
|
10
|
+
// const { mutate } = useSWRConfig();
|
|
12
11
|
const ee = useEventEmitter();
|
|
13
12
|
const { state } = useAccount();
|
|
14
|
-
|
|
13
|
+
// TODO: remove this when the WS service provides the correct data
|
|
14
|
+
const algoOrderCacheQuneue = useRef([]);
|
|
15
|
+
const updateOrders = (data, isAlgoOrder) => {
|
|
15
16
|
const map = options.getKeysMap("orders");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
// console.log("$$$$$$$$$$$$", data, algoOrderCacheQuneue.current);
|
|
18
|
+
if (isAlgoOrder) {
|
|
19
|
+
/// TODO: remove this when the WS service provides the correct data
|
|
20
|
+
if (algoOrderCacheQuneue.current.length) {
|
|
21
|
+
const index = algoOrderCacheQuneue.current.findIndex((item) => item.order_id === data.algoOrderId);
|
|
22
|
+
if (index > -1) {
|
|
23
|
+
data = {
|
|
24
|
+
...data,
|
|
25
|
+
...algoOrderCacheQuneue.current[index],
|
|
26
|
+
};
|
|
27
|
+
algoOrderCacheQuneue.current.splice(index, 1);
|
|
28
|
+
}
|
|
26
29
|
}
|
|
30
|
+
}
|
|
31
|
+
map.forEach((getKey, key) => {
|
|
32
|
+
mutate(unstable_serialize((index, prevData) => [
|
|
33
|
+
getKey(index, prevData),
|
|
34
|
+
state.accountId,
|
|
35
|
+
]), (prevData) => {
|
|
36
|
+
return updateOrdersHandler(key, data, prevData);
|
|
37
|
+
}, {
|
|
38
|
+
revalidate: false,
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
// emit events;
|
|
42
|
+
// ee.emit("orders:changed", {
|
|
43
|
+
// ...data,
|
|
44
|
+
// status: data.status || (data as WSMessage.AlgoOrder).algoStatus,
|
|
45
|
+
// });
|
|
46
|
+
ee.emit("orders:changed", {
|
|
47
|
+
...data,
|
|
48
|
+
status: data.status || data.algoStatus,
|
|
27
49
|
});
|
|
28
|
-
|
|
29
|
-
// ee.emit("orders:changed");
|
|
30
|
-
}, 500);
|
|
50
|
+
};
|
|
31
51
|
// orders
|
|
32
52
|
useEffect(() => {
|
|
33
53
|
if (!state.accountId)
|
|
34
54
|
return;
|
|
35
55
|
const unsubscribe = ws.privateSubscribe("executionreport", {
|
|
36
56
|
onMessage: (data) => {
|
|
37
|
-
updateOrders(data);
|
|
38
|
-
ee.emit("orders:changed", data);
|
|
57
|
+
updateOrders(data, false);
|
|
39
58
|
},
|
|
40
59
|
});
|
|
41
60
|
return () => unsubscribe?.();
|
|
@@ -46,13 +65,18 @@ export const usePrivateDataObserver = (options) => {
|
|
|
46
65
|
return;
|
|
47
66
|
const unsubscribe = ws.privateSubscribe("algoexecutionreport", {
|
|
48
67
|
onMessage: (data) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
68
|
+
setTimeout(() => {
|
|
69
|
+
if (Array.isArray(data)) {
|
|
70
|
+
data.forEach((item) => {
|
|
71
|
+
updateOrders(item, true);
|
|
72
|
+
// ee.emit("orders:changed", { ...item, status: item.algoStatus });
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
updateOrders(data, true);
|
|
77
|
+
// ee.emit("orders:changed", { ...data, status: data.algoStatus });
|
|
78
|
+
}
|
|
79
|
+
}, 100);
|
|
56
80
|
},
|
|
57
81
|
});
|
|
58
82
|
return () => unsubscribe?.();
|
|
@@ -109,18 +133,14 @@ export const usePrivateDataObserver = (options) => {
|
|
|
109
133
|
unsubscribe?.();
|
|
110
134
|
};
|
|
111
135
|
}, [state.accountId]);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
console.warn(`Error reading sessionStorage key “${key}”:`, error);
|
|
124
|
-
return initialValue;
|
|
125
|
-
}
|
|
136
|
+
// cache algo orders
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
const handler = (data) => {
|
|
139
|
+
algoOrderCacheQuneue.current.push(data);
|
|
140
|
+
};
|
|
141
|
+
ee.on("algoOrder:cache", handler);
|
|
142
|
+
return () => {
|
|
143
|
+
ee.off("algoOrder:cache", handler);
|
|
144
|
+
};
|
|
145
|
+
}, []);
|
|
126
146
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BasePaint, type
|
|
1
|
+
import { BasePaint, type DrawOptions } from "./basePaint";
|
|
2
2
|
export declare class BackgroundPaint extends BasePaint {
|
|
3
3
|
private img;
|
|
4
|
-
draw(options:
|
|
5
|
-
_drawColor(options:
|
|
6
|
-
_drawImage(options:
|
|
4
|
+
draw(options: DrawOptions): Promise<void>;
|
|
5
|
+
_drawColor(options: DrawOptions): void;
|
|
6
|
+
_drawImage(options: DrawOptions): Promise<void>;
|
|
7
7
|
private loadImg;
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=backgroundPaint.d.ts.map
|