@orderly.network/hooks 1.4.0 → 1.4.3

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.
Files changed (149) hide show
  1. package/esm/index.d.ts +1 -0
  2. package/esm/index.d.ts.map +1 -1
  3. package/esm/index.js +1 -0
  4. package/esm/index.js.map +1 -1
  5. package/esm/orderly/useAccountInfo.d.ts +1 -1
  6. package/esm/orderly/useAccountInfo.d.ts.map +1 -1
  7. package/esm/orderly/useIndexPrice.d.ts +1 -1
  8. package/esm/orderly/useIndexPrice.d.ts.map +1 -1
  9. package/esm/orderly/useMarkPricesStream.d.ts +1 -1
  10. package/esm/orderly/useMarkPricesStream.d.ts.map +1 -1
  11. package/esm/orderly/useOpenInterest.d.ts +1 -1
  12. package/esm/orderly/useOpenInterest.d.ts.map +1 -1
  13. package/esm/orderly/useOrderStream/useOrderStream.d.ts +1 -1
  14. package/esm/orderly/usePositionStream/usePositionStream.d.ts +1 -1
  15. package/esm/orderly/useSettleSubscription.d.ts +1 -1
  16. package/esm/orderly/useSettleSubscription.d.ts.map +1 -1
  17. package/esm/orderly/useTakeProfitAndStopLoss/index.d.ts +4 -4
  18. package/esm/orderly/useTakeProfitAndStopLoss/useTPSL.d.ts +4 -4
  19. package/esm/orderly/useTakeProfitAndStopLoss/useTPSL.d.ts.map +1 -1
  20. package/esm/orderly/useTakeProfitAndStopLoss/useTPSL.js.map +1 -1
  21. package/esm/orderly/useWalletSubscription.d.ts +1 -1
  22. package/esm/orderly/useWalletSubscription.d.ts.map +1 -1
  23. package/esm/referral/api.d.ts +87 -0
  24. package/esm/referral/api.d.ts.map +1 -0
  25. package/esm/referral/api.js +3 -0
  26. package/esm/referral/api.js.map +1 -0
  27. package/esm/referral/format.d.ts +2 -0
  28. package/esm/referral/format.d.ts.map +1 -0
  29. package/esm/referral/format.js +8 -0
  30. package/esm/referral/format.js.map +1 -0
  31. package/esm/referral/index.d.ts +9 -0
  32. package/esm/referral/index.d.ts.map +1 -0
  33. package/esm/referral/index.js +10 -0
  34. package/esm/referral/index.js.map +1 -0
  35. package/esm/referral/swr.d.ts +7 -0
  36. package/esm/referral/swr.d.ts.map +1 -0
  37. package/esm/referral/swr.js +24 -0
  38. package/esm/referral/swr.js.map +1 -0
  39. package/esm/referral/useCommission.d.ts +4 -0
  40. package/esm/referral/useCommission.d.ts.map +1 -0
  41. package/esm/referral/useCommission.js +59 -0
  42. package/esm/referral/useCommission.js.map +1 -0
  43. package/esm/referral/useDaily.d.ts +9 -0
  44. package/esm/referral/useDaily.d.ts.map +1 -0
  45. package/esm/referral/useDaily.js +19 -0
  46. package/esm/referral/useDaily.js.map +1 -0
  47. package/esm/referral/useDistribution.d.ts +9 -0
  48. package/esm/referral/useDistribution.d.ts.map +1 -0
  49. package/esm/referral/useDistribution.js +53 -0
  50. package/esm/referral/useDistribution.js.map +1 -0
  51. package/esm/referral/useRefereeHistory.d.ts +9 -0
  52. package/esm/referral/useRefereeHistory.d.ts.map +1 -0
  53. package/esm/referral/useRefereeHistory.js +47 -0
  54. package/esm/referral/useRefereeHistory.js.map +1 -0
  55. package/esm/referral/useRefereeInfo.d.ts +9 -0
  56. package/esm/referral/useRefereeInfo.d.ts.map +1 -0
  57. package/esm/referral/useRefereeInfo.js +47 -0
  58. package/esm/referral/useRefereeInfo.js.map +1 -0
  59. package/esm/referral/useRefereeRebateSummary.d.ts +12 -0
  60. package/esm/referral/useRefereeRebateSummary.d.ts.map +1 -0
  61. package/esm/referral/useRefereeRebateSummary.js +31 -0
  62. package/esm/referral/useRefereeRebateSummary.js.map +1 -0
  63. package/esm/referral/useReferralRebateSummary.d.ts +9 -0
  64. package/esm/referral/useReferralRebateSummary.d.ts.map +1 -0
  65. package/esm/referral/useReferralRebateSummary.js +47 -0
  66. package/esm/referral/useReferralRebateSummary.js.map +1 -0
  67. package/esm/services/orderCreator/baseCreator.d.ts.map +1 -1
  68. package/esm/services/orderCreator/baseCreator.js +5 -3
  69. package/esm/services/orderCreator/baseCreator.js.map +1 -1
  70. package/esm/usePrivateInfiniteQuery.d.ts +2 -2
  71. package/esm/usePrivateInfiniteQuery.d.ts.map +1 -1
  72. package/esm/version.d.ts +1 -1
  73. package/esm/version.js +2 -2
  74. package/esm/version.js.map +1 -1
  75. package/lib/index.d.ts +1 -0
  76. package/lib/index.d.ts.map +1 -1
  77. package/lib/index.js +1 -0
  78. package/lib/index.js.map +1 -1
  79. package/lib/orderly/useAccountInfo.d.ts +1 -1
  80. package/lib/orderly/useAccountInfo.d.ts.map +1 -1
  81. package/lib/orderly/useIndexPrice.d.ts +1 -1
  82. package/lib/orderly/useIndexPrice.d.ts.map +1 -1
  83. package/lib/orderly/useMarkPricesStream.d.ts +1 -1
  84. package/lib/orderly/useMarkPricesStream.d.ts.map +1 -1
  85. package/lib/orderly/useOpenInterest.d.ts +1 -1
  86. package/lib/orderly/useOpenInterest.d.ts.map +1 -1
  87. package/lib/orderly/useOrderStream/useOrderStream.d.ts +1 -1
  88. package/lib/orderly/usePositionStream/usePositionStream.d.ts +1 -1
  89. package/lib/orderly/useSettleSubscription.d.ts +1 -1
  90. package/lib/orderly/useSettleSubscription.d.ts.map +1 -1
  91. package/lib/orderly/useTakeProfitAndStopLoss/index.d.ts +4 -4
  92. package/lib/orderly/useTakeProfitAndStopLoss/useTPSL.d.ts +4 -4
  93. package/lib/orderly/useTakeProfitAndStopLoss/useTPSL.d.ts.map +1 -1
  94. package/lib/orderly/useTakeProfitAndStopLoss/useTPSL.js.map +1 -1
  95. package/lib/orderly/useWalletSubscription.d.ts +1 -1
  96. package/lib/orderly/useWalletSubscription.d.ts.map +1 -1
  97. package/lib/referral/api.d.ts +87 -0
  98. package/lib/referral/api.d.ts.map +1 -0
  99. package/lib/referral/api.js +6 -0
  100. package/lib/referral/api.js.map +1 -0
  101. package/lib/referral/format.d.ts +2 -0
  102. package/lib/referral/format.d.ts.map +1 -0
  103. package/lib/referral/format.js +18 -0
  104. package/lib/referral/format.js.map +1 -0
  105. package/lib/referral/index.d.ts +9 -0
  106. package/lib/referral/index.d.ts.map +1 -0
  107. package/lib/referral/index.js +56 -0
  108. package/lib/referral/index.js.map +1 -0
  109. package/lib/referral/swr.d.ts +7 -0
  110. package/lib/referral/swr.d.ts.map +1 -0
  111. package/lib/referral/swr.js +34 -0
  112. package/lib/referral/swr.js.map +1 -0
  113. package/lib/referral/useCommission.d.ts +4 -0
  114. package/lib/referral/useCommission.d.ts.map +1 -0
  115. package/lib/referral/useCommission.js +69 -0
  116. package/lib/referral/useCommission.js.map +1 -0
  117. package/lib/referral/useDaily.d.ts +9 -0
  118. package/lib/referral/useDaily.d.ts.map +1 -0
  119. package/lib/referral/useDaily.js +29 -0
  120. package/lib/referral/useDaily.js.map +1 -0
  121. package/lib/referral/useDistribution.d.ts +9 -0
  122. package/lib/referral/useDistribution.d.ts.map +1 -0
  123. package/lib/referral/useDistribution.js +63 -0
  124. package/lib/referral/useDistribution.js.map +1 -0
  125. package/lib/referral/useRefereeHistory.d.ts +9 -0
  126. package/lib/referral/useRefereeHistory.d.ts.map +1 -0
  127. package/lib/referral/useRefereeHistory.js +57 -0
  128. package/lib/referral/useRefereeHistory.js.map +1 -0
  129. package/lib/referral/useRefereeInfo.d.ts +9 -0
  130. package/lib/referral/useRefereeInfo.d.ts.map +1 -0
  131. package/lib/referral/useRefereeInfo.js +57 -0
  132. package/lib/referral/useRefereeInfo.js.map +1 -0
  133. package/lib/referral/useRefereeRebateSummary.d.ts +12 -0
  134. package/lib/referral/useRefereeRebateSummary.d.ts.map +1 -0
  135. package/lib/referral/useRefereeRebateSummary.js +41 -0
  136. package/lib/referral/useRefereeRebateSummary.js.map +1 -0
  137. package/lib/referral/useReferralRebateSummary.d.ts +9 -0
  138. package/lib/referral/useReferralRebateSummary.d.ts.map +1 -0
  139. package/lib/referral/useReferralRebateSummary.js +57 -0
  140. package/lib/referral/useReferralRebateSummary.js.map +1 -0
  141. package/lib/services/orderCreator/baseCreator.d.ts.map +1 -1
  142. package/lib/services/orderCreator/baseCreator.js +5 -3
  143. package/lib/services/orderCreator/baseCreator.js.map +1 -1
  144. package/lib/usePrivateInfiniteQuery.d.ts +2 -2
  145. package/lib/usePrivateInfiniteQuery.d.ts.map +1 -1
  146. package/lib/version.d.ts +1 -1
  147. package/lib/version.js +2 -2
  148. package/lib/version.js.map +1 -1
  149. package/package.json +7 -7
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useDistribution", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return useDistribution;
9
+ }
10
+ });
11
+ const _swr = require("./swr");
12
+ const _react = require("react");
13
+ const _usePrivateInfiniteQuery = require("../usePrivateInfiniteQuery");
14
+ const useDistribution = (params)=>{
15
+ const { size = 10, startDate, endDate, initialSize } = params;
16
+ const ordersResponse = (0, _usePrivateInfiniteQuery.usePrivateInfiniteQuery)((0, _swr.generateKeyFun)({
17
+ path: '/v1/client/distribution_history',
18
+ size,
19
+ startDate,
20
+ endDate
21
+ }), {
22
+ initialSize: initialSize,
23
+ // revalidateFirstPage: false,
24
+ // onError: (err) => {
25
+ // console.error("fetch failed::::", err);
26
+ // },
27
+ formatter: (data)=>data,
28
+ revalidateOnFocus: false
29
+ });
30
+ const loadMore = ()=>{
31
+ ordersResponse.setSize(ordersResponse.size + 1);
32
+ };
33
+ const total = (0, _react.useMemo)(()=>{
34
+ return ordersResponse.data?.[0]?.meta?.total || 0;
35
+ }, [
36
+ ordersResponse.data?.[0]?.meta?.total
37
+ ]);
38
+ const flattenOrders = (0, _react.useMemo)(()=>{
39
+ if (!ordersResponse.data) {
40
+ return null;
41
+ }
42
+ return ordersResponse.data?.map((item)=>item.rows)?.flat().map((item)=>{
43
+ return {
44
+ ...item,
45
+ created_time: item.created_time - 86400000,
46
+ updated_time: item.updated_time - 86400000
47
+ };
48
+ });
49
+ }, [
50
+ ordersResponse.data
51
+ ]);
52
+ return [
53
+ flattenOrders,
54
+ {
55
+ total,
56
+ isLoading: ordersResponse.isLoading,
57
+ refresh: ordersResponse.mutate,
58
+ loadMore
59
+ }
60
+ ];
61
+ };
62
+
63
+ //# sourceMappingURL=useDistribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/referral/useDistribution.ts"],"sourcesContent":["import { generateKeyFun } from \"./swr\";\nimport { useMemo } from \"react\";\nimport { RefferalAPI } from \"./api\";\nimport { usePrivateInfiniteQuery } from \"../usePrivateInfiniteQuery\";\n\ntype Params = {\n //** default is 10 */\n size?: number,\n //** YYYY-MM-dd */\n startDate?: string,\n //** YYYY-MM-dd */\n endDate?: string,\n //** default is 1 */\n initialSize?: number,\n}\n\nexport const useDistribution = (params: Params): any => {\n const { size = 10, startDate, endDate, initialSize } = params;\n\n const ordersResponse = usePrivateInfiniteQuery(\n generateKeyFun({ path: '/v1/client/distribution_history', size, startDate, endDate }),\n {\n initialSize: initialSize,\n // revalidateFirstPage: false,\n // onError: (err) => {\n // console.error(\"fetch failed::::\", err);\n // },\n formatter: (data: any) => data,\n revalidateOnFocus: false,\n }\n );\n\n\n const loadMore = () => {\n ordersResponse.setSize(ordersResponse.size + 1);\n };\n\n const total = useMemo(() => {\n return ordersResponse.data?.[0]?.meta?.total || 0;\n }, [ordersResponse.data?.[0]?.meta?.total]);\n\n\n const flattenOrders = useMemo((): RefferalAPI.Distribution[] | null => {\n if (!ordersResponse.data) {\n return null;\n }\n\n return ordersResponse.data?.map((item: any) => item.rows)?.flat()\n /// TODO: next version will be remove this code\n .map((item: any) => {\n return { ...item, created_time: item.created_time - 86400000, updated_time: item.updated_time - 86400000 };\n });\n }, [ordersResponse.data]);\n\n return [\n flattenOrders,\n {\n total,\n isLoading: ordersResponse.isLoading,\n refresh: ordersResponse.mutate,\n loadMore\n }\n ] as const;\n}"],"names":["useDistribution","params","size","startDate","endDate","initialSize","ordersResponse","usePrivateInfiniteQuery","generateKeyFun","path","formatter","data","revalidateOnFocus","loadMore","setSize","total","useMemo","meta","flattenOrders","map","item","rows","flat","created_time","updated_time","isLoading","refresh","mutate"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;qBAhBkB;uBACP;yCAEgB;AAajC,MAAMA,kBAAkB,CAACC;IAC5B,MAAM,EAAEC,OAAO,EAAE,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WAAW,EAAE,GAAGJ;IAEvD,MAAMK,iBAAiBC,IAAAA,gDAAuB,EAC1CC,IAAAA,mBAAc,EAAC;QAAEC,MAAM;QAAmCP;QAAMC;QAAWC;IAAQ,IACnF;QACIC,aAAaA;QACb,8BAA8B;QAC9B,sBAAsB;QACtB,4CAA4C;QAC5C,KAAK;QACLK,WAAW,CAACC,OAAcA;QAC1BC,mBAAmB;IACvB;IAIJ,MAAMC,WAAW;QACbP,eAAeQ,OAAO,CAACR,eAAeJ,IAAI,GAAG;IACjD;IAEA,MAAMa,QAAQC,IAAAA,cAAO,EAAC;QAClB,OAAOV,eAAeK,IAAI,EAAE,CAAC,EAAE,EAAEM,MAAMF,SAAS;IACpD,GAAG;QAACT,eAAeK,IAAI,EAAE,CAAC,EAAE,EAAEM,MAAMF;KAAM;IAG1C,MAAMG,gBAAgBF,IAAAA,cAAO,EAAC;QAC1B,IAAI,CAACV,eAAeK,IAAI,EAAE;YACtB,OAAO;QACX;QAEA,OAAOL,eAAeK,IAAI,EAAEQ,IAAI,CAACC,OAAcA,KAAKC,IAAI,GAAGC,OAEtDH,IAAI,CAACC;YACF,OAAO;gBAAE,GAAGA,IAAI;gBAAEG,cAAcH,KAAKG,YAAY,GAAG;gBAAUC,cAAcJ,KAAKI,YAAY,GAAG;YAAS;QAC7G;IACR,GAAG;QAAClB,eAAeK,IAAI;KAAC;IAExB,OAAO;QACHO;QACA;YACIH;YACAU,WAAWnB,eAAemB,SAAS;YACnCC,SAASpB,eAAeqB,MAAM;YAC9Bd;QACJ;KACH;AACL"}
@@ -0,0 +1,9 @@
1
+ type Params = {
2
+ size?: number;
3
+ startDate?: string;
4
+ endDate?: string;
5
+ initialSize?: number;
6
+ };
7
+ export declare const useRefereeHistory: (params: Params) => any[];
8
+ export {};
9
+ //# sourceMappingURL=useRefereeHistory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRefereeHistory.d.ts","sourceRoot":"","sources":["../../src/referral/useRefereeHistory.ts"],"names":[],"mappings":"AAIA,KAAK,MAAM,GAAG;IAEV,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAA;AAED,eAAO,MAAM,iBAAiB,WAAY,MAAM,KAAG,GAAG,EA2CrD,CAAA"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useRefereeHistory", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return useRefereeHistory;
9
+ }
10
+ });
11
+ const _usePrivateInfiniteQuery = require("../usePrivateInfiniteQuery");
12
+ const _swr = require("./swr");
13
+ const _react = require("react");
14
+ const useRefereeHistory = (params)=>{
15
+ const { size = 10, startDate, endDate, initialSize } = params;
16
+ const response = (0, _usePrivateInfiniteQuery.usePrivateInfiniteQuery)((0, _swr.generateKeyFun)({
17
+ path: '/v1/referral/referee_history',
18
+ size,
19
+ startDate,
20
+ endDate
21
+ }), {
22
+ initialSize: initialSize,
23
+ // revalidateFirstPage: false,
24
+ // onError: (err) => {
25
+ // console.error("fetch failed::::", err);
26
+ // },
27
+ formatter: (data)=>data,
28
+ revalidateOnFocus: false
29
+ });
30
+ const loadMore = ()=>{
31
+ response.setSize(response.size + 1);
32
+ };
33
+ const total = (0, _react.useMemo)(()=>{
34
+ return response.data?.[0]?.meta?.total || 0;
35
+ }, [
36
+ response.data?.[0]?.meta?.total
37
+ ]);
38
+ const flattenOrders = (0, _react.useMemo)(()=>{
39
+ if (!response.data) {
40
+ return null;
41
+ }
42
+ return response.data?.map((item)=>item.rows)?.flat();
43
+ }, [
44
+ response.data
45
+ ]);
46
+ return [
47
+ flattenOrders,
48
+ {
49
+ total,
50
+ isLoading: response.isLoading,
51
+ refresh: response.mutate,
52
+ loadMore
53
+ }
54
+ ];
55
+ };
56
+
57
+ //# sourceMappingURL=useRefereeHistory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/referral/useRefereeHistory.ts"],"sourcesContent":["import { usePrivateInfiniteQuery } from \"../usePrivateInfiniteQuery\";\nimport { generateKeyFun } from \"./swr\";\nimport { useMemo } from \"react\";\n\ntype Params = {\n //** default is 10 */\n size?: number,\n //** YYYY-MM-dd */\n startDate?: string,\n //** YYYY-MM-dd */\n endDate?: string,\n //** default is 1 */\n initialSize?: number,\n}\n\nexport const useRefereeHistory = (params: Params): any[] => {\n const { size = 10, startDate, endDate, initialSize } = params;\n\n const response = usePrivateInfiniteQuery(\n generateKeyFun({ path: '/v1/referral/referee_history', size, startDate, endDate }),\n {\n initialSize: initialSize,\n // revalidateFirstPage: false,\n // onError: (err) => {\n // console.error(\"fetch failed::::\", err);\n // },\n formatter: (data) => data,\n revalidateOnFocus: false,\n }\n );\n\n\n const loadMore = () => {\n response.setSize(response.size + 1);\n };\n\n const total = useMemo(() => {\n return response.data?.[0]?.meta?.total || 0;\n }, [response.data?.[0]?.meta?.total]);\n\n\n const flattenOrders = useMemo(() => {\n if (!response.data) {\n return null;\n }\n\n return response.data?.map((item) => item.rows)?.flat();\n }, [response.data]);\n\n return [\n flattenOrders,\n {\n total,\n isLoading: response.isLoading,\n refresh: response.mutate,\n loadMore\n }\n ];\n}"],"names":["useRefereeHistory","params","size","startDate","endDate","initialSize","response","usePrivateInfiniteQuery","generateKeyFun","path","formatter","data","revalidateOnFocus","loadMore","setSize","total","useMemo","meta","flattenOrders","map","item","rows","flat","isLoading","refresh","mutate"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;yCAf2B;qBACT;uBACP;AAajB,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,OAAO,EAAE,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WAAW,EAAE,GAAGJ;IAEvD,MAAMK,WAAWC,IAAAA,gDAAuB,EACpCC,IAAAA,mBAAc,EAAC;QAAEC,MAAM;QAAgCP;QAAMC;QAAWC;IAAQ,IAChF;QACIC,aAAaA;QACb,8BAA8B;QAC9B,sBAAsB;QACtB,4CAA4C;QAC5C,KAAK;QACLK,WAAW,CAACC,OAASA;QACrBC,mBAAmB;IACvB;IAIJ,MAAMC,WAAW;QACbP,SAASQ,OAAO,CAACR,SAASJ,IAAI,GAAG;IACrC;IAEA,MAAMa,QAAQC,IAAAA,cAAO,EAAC;QAClB,OAAOV,SAASK,IAAI,EAAE,CAAC,EAAE,EAAEM,MAAMF,SAAS;IAC9C,GAAG;QAACT,SAASK,IAAI,EAAE,CAAC,EAAE,EAAEM,MAAMF;KAAM;IAGpC,MAAMG,gBAAgBF,IAAAA,cAAO,EAAC;QAC1B,IAAI,CAACV,SAASK,IAAI,EAAE;YAChB,OAAO;QACX;QAEA,OAAOL,SAASK,IAAI,EAAEQ,IAAI,CAACC,OAASA,KAAKC,IAAI,GAAGC;IACpD,GAAG;QAAChB,SAASK,IAAI;KAAC;IAElB,OAAO;QACHO;QACA;YACIH;YACAQ,WAAWjB,SAASiB,SAAS;YAC7BC,SAASlB,SAASmB,MAAM;YACxBZ;QACJ;KACH;AACL"}
@@ -0,0 +1,9 @@
1
+ type Params = {
2
+ size?: number;
3
+ startDate?: string;
4
+ endDate?: string;
5
+ initialSize?: number;
6
+ };
7
+ export declare const useRefereeInfo: (params: Params) => any[];
8
+ export {};
9
+ //# sourceMappingURL=useRefereeInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRefereeInfo.d.ts","sourceRoot":"","sources":["../../src/referral/useRefereeInfo.ts"],"names":[],"mappings":"AAKA,KAAK,MAAM,GAAG;IAEV,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAA;AAED,eAAO,MAAM,cAAc,WAAY,MAAM,KAAG,GAAG,EA2ClD,CAAA"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useRefereeInfo", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return useRefereeInfo;
9
+ }
10
+ });
11
+ const _swr = require("./swr");
12
+ const _react = require("react");
13
+ const _usePrivateInfiniteQuery = require("../usePrivateInfiniteQuery");
14
+ const useRefereeInfo = (params)=>{
15
+ const { size = 10, startDate, endDate, initialSize } = params;
16
+ const response = (0, _usePrivateInfiniteQuery.usePrivateInfiniteQuery)((0, _swr.generateKeyFun)({
17
+ path: '/v1/referral/referee_info',
18
+ size,
19
+ startDate,
20
+ endDate
21
+ }), {
22
+ initialSize: initialSize,
23
+ // revalidateFirstPage: false,
24
+ // onError: (err) => {
25
+ // console.error("fetch failed::::", err);
26
+ // },
27
+ formatter: (data)=>data,
28
+ revalidateOnFocus: false
29
+ });
30
+ const loadMore = ()=>{
31
+ response.setSize(response.size + 1);
32
+ };
33
+ const total = (0, _react.useMemo)(()=>{
34
+ return response.data?.[0]?.meta?.total || 0;
35
+ }, [
36
+ response.data?.[0]?.meta?.total
37
+ ]);
38
+ const flattenOrders = (0, _react.useMemo)(()=>{
39
+ if (!response.data) {
40
+ return null;
41
+ }
42
+ return response.data?.map((item)=>item.rows)?.flat();
43
+ }, [
44
+ response.data
45
+ ]);
46
+ return [
47
+ flattenOrders,
48
+ {
49
+ total,
50
+ isLoading: response.isLoading,
51
+ refresh: response.mutate,
52
+ loadMore
53
+ }
54
+ ];
55
+ };
56
+
57
+ //# sourceMappingURL=useRefereeInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/referral/useRefereeInfo.ts"],"sourcesContent":["import { generateKeyFun } from \"./swr\";\nimport { useMemo } from \"react\";\nimport { RefferalAPI } from \"./api\";\nimport { usePrivateInfiniteQuery } from \"../usePrivateInfiniteQuery\";\n\ntype Params = {\n //** default is 10 */\n size?: number,\n //** YYYY-MM-dd */\n startDate?: string,\n //** YYYY-MM-dd */\n endDate?: string,\n //** default is 1 */\n initialSize?: number,\n}\n\nexport const useRefereeInfo = (params: Params): any[] => {\n const { size = 10, startDate, endDate, initialSize } = params;\n\n const response = usePrivateInfiniteQuery(\n generateKeyFun({ path: '/v1/referral/referee_info', size, startDate, endDate }),\n {\n initialSize: initialSize,\n // revalidateFirstPage: false,\n // onError: (err) => {\n // console.error(\"fetch failed::::\", err);\n // },\n formatter: (data) => data,\n revalidateOnFocus: false,\n }\n );\n\n\n const loadMore = () => {\n response.setSize(response.size + 1);\n };\n\n const total = useMemo(() => {\n return response.data?.[0]?.meta?.total || 0;\n }, [response.data?.[0]?.meta?.total]);\n\n\n const flattenOrders = useMemo((): RefferalAPI.RefereeInfoItem[] | null => {\n if (!response.data) {\n return null;\n }\n\n return response.data?.map((item) => item.rows)?.flat();\n }, [response.data]);\n\n return [\n flattenOrders,\n {\n total,\n isLoading: response.isLoading,\n refresh: response.mutate,\n loadMore\n }\n ];\n}"],"names":["useRefereeInfo","params","size","startDate","endDate","initialSize","response","usePrivateInfiniteQuery","generateKeyFun","path","formatter","data","revalidateOnFocus","loadMore","setSize","total","useMemo","meta","flattenOrders","map","item","rows","flat","isLoading","refresh","mutate"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;qBAhBkB;uBACP;yCAEgB;AAajC,MAAMA,iBAAiB,CAACC;IAC3B,MAAM,EAAEC,OAAO,EAAE,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WAAW,EAAE,GAAGJ;IAEvD,MAAMK,WAAWC,IAAAA,gDAAuB,EACpCC,IAAAA,mBAAc,EAAC;QAAEC,MAAM;QAA6BP;QAAMC;QAAWC;IAAQ,IAC7E;QACIC,aAAaA;QACb,8BAA8B;QAC9B,sBAAsB;QACtB,4CAA4C;QAC5C,KAAK;QACLK,WAAW,CAACC,OAASA;QACrBC,mBAAmB;IACvB;IAIJ,MAAMC,WAAW;QACbP,SAASQ,OAAO,CAACR,SAASJ,IAAI,GAAG;IACrC;IAEA,MAAMa,QAAQC,IAAAA,cAAO,EAAC;QAClB,OAAOV,SAASK,IAAI,EAAE,CAAC,EAAE,EAAEM,MAAMF,SAAS;IAC9C,GAAG;QAACT,SAASK,IAAI,EAAE,CAAC,EAAE,EAAEM,MAAMF;KAAM;IAGpC,MAAMG,gBAAgBF,IAAAA,cAAO,EAAC;QAC1B,IAAI,CAACV,SAASK,IAAI,EAAE;YAChB,OAAO;QACX;QAEA,OAAOL,SAASK,IAAI,EAAEQ,IAAI,CAACC,OAASA,KAAKC,IAAI,GAAGC;IACpD,GAAG;QAAChB,SAASK,IAAI;KAAC;IAElB,OAAO;QACHO;QACA;YACIH;YACAQ,WAAWjB,SAASiB,SAAS;YAC7BC,SAASlB,SAASmB,MAAM;YACxBZ;QACJ;KACH;AACL"}
@@ -0,0 +1,12 @@
1
+ import { RefferalAPI } from "./api";
2
+ type Params = {
3
+ startDate?: Date;
4
+ endDate?: Date;
5
+ };
6
+ export declare const useRefereeRebateSummary: (params: Params) => {
7
+ data?: RefferalAPI.RefereeRebateSummary[] | undefined;
8
+ mutate: any;
9
+ isLoading: boolean;
10
+ };
11
+ export {};
12
+ //# sourceMappingURL=useRefereeRebateSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRefereeRebateSummary.d.ts","sourceRoot":"","sources":["../../src/referral/useRefereeRebateSummary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpC,KAAK,MAAM,GAAG;IACV,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,IAAI,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,uBAAuB,WAAY,MAAM;;YAE1C,GAAG;eACA,OAAO;CA4BrB,CAAA"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useRefereeRebateSummary", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return useRefereeRebateSummary;
9
+ }
10
+ });
11
+ const _usePrivateQuery = require("../usePrivateQuery");
12
+ const _format = require("./format");
13
+ const useRefereeRebateSummary = (params)=>{
14
+ const path = "/v1/referral/referee_rebate_summary";
15
+ let url = path;
16
+ if (typeof params.endDate !== 'undefined' && typeof params.startDate !== 'undefined') {
17
+ const sDate = minDate(params.startDate, params.endDate);
18
+ const eDate = maxDate(params.startDate, params.endDate);
19
+ const search = new URLSearchParams([]);
20
+ search.set(`start_date`, (0, _format.formatDate)(sDate));
21
+ search.set(`end_date`, (0, _format.formatDate)(eDate));
22
+ const queryParams = search.toString() || "";
23
+ url = `${path}?${queryParams}`;
24
+ }
25
+ const { data, mutate, isLoading } = (0, _usePrivateQuery.usePrivateQuery)(url, {
26
+ revalidateOnFocus: true
27
+ });
28
+ return {
29
+ data,
30
+ mutate,
31
+ isLoading
32
+ };
33
+ };
34
+ function minDate(a, b) {
35
+ return a < b ? a : b;
36
+ }
37
+ function maxDate(a, b) {
38
+ return a > b ? a : b;
39
+ }
40
+
41
+ //# sourceMappingURL=useRefereeRebateSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/referral/useRefereeRebateSummary.ts"],"sourcesContent":["import { usePrivateQuery } from \"../usePrivateQuery\";\nimport { RefferalAPI } from \"./api\";\nimport { formatDate } from \"./format\";\n\ntype Params = {\n startDate?: Date,\n endDate?: Date\n}\n\nexport const useRefereeRebateSummary = (params: Params): {\n data?: RefferalAPI.RefereeRebateSummary[],\n mutate: any,\n isLoading: boolean,\n} => {\n const path = \"/v1/referral/referee_rebate_summary\";\n\n let url = path;\n if (typeof params.endDate !== 'undefined' && typeof params.startDate !== 'undefined') {\n\n const sDate = minDate(params.startDate, params.endDate);\n const eDate = maxDate(params.startDate, params.endDate);\n const search = new URLSearchParams([]);\n search.set(`start_date`, formatDate(sDate, ));\n search.set(`end_date`, formatDate(eDate,));\n const queryParams = search.toString() || \"\";\n url = `${path}?${queryParams}`;\n }\n const {\n data,\n mutate,\n isLoading,\n } = usePrivateQuery<RefferalAPI.RefereeRebateSummary[]>(url, {\n revalidateOnFocus: true\n });\n\n return {\n data,\n mutate,\n isLoading,\n }\n}\n\nfunction minDate(a: Date, b: Date) {\n return a < b ? a : b;\n}\n\nfunction maxDate(a: Date, b: Date) {\n return a > b ? a : b;\n}"],"names":["useRefereeRebateSummary","params","path","url","endDate","startDate","sDate","minDate","eDate","maxDate","search","URLSearchParams","set","formatDate","queryParams","toString","data","mutate","isLoading","usePrivateQuery","revalidateOnFocus","a","b"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;iCATmB;wBAEL;AAOpB,MAAMA,0BAA0B,CAACC;IAKpC,MAAMC,OAAO;IAEb,IAAIC,MAAMD;IACV,IAAI,OAAOD,OAAOG,OAAO,KAAK,eAAe,OAAOH,OAAOI,SAAS,KAAK,aAAa;QAElF,MAAMC,QAAQC,QAAQN,OAAOI,SAAS,EAAEJ,OAAOG,OAAO;QACtD,MAAMI,QAAQC,QAAQR,OAAOI,SAAS,EAAEJ,OAAOG,OAAO;QACtD,MAAMM,SAAS,IAAIC,gBAAgB,EAAE;QACrCD,OAAOE,GAAG,CAAC,CAAC,UAAU,CAAC,EAAEC,IAAAA,kBAAU,EAACP;QACpCI,OAAOE,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAEC,IAAAA,kBAAU,EAACL;QAClC,MAAMM,cAAcJ,OAAOK,QAAQ,MAAM;QACzCZ,MAAM,CAAC,EAAED,KAAK,CAAC,EAAEY,YAAY,CAAC;IAClC;IACA,MAAM,EACFE,IAAI,EACJC,MAAM,EACNC,SAAS,EACZ,GAAGC,IAAAA,gCAAe,EAAqChB,KAAK;QACzDiB,mBAAmB;IACvB;IAEA,OAAO;QACHJ;QACAC;QACAC;IACJ;AACJ;AAEA,SAASX,QAAQc,CAAO,EAAEC,CAAO;IAC7B,OAAOD,IAAIC,IAAID,IAAIC;AACvB;AAEA,SAASb,QAAQY,CAAO,EAAEC,CAAO;IAC7B,OAAOD,IAAIC,IAAID,IAAIC;AACvB"}
@@ -0,0 +1,9 @@
1
+ type Params = {
2
+ size?: number;
3
+ startDate?: string;
4
+ endDate?: string;
5
+ initialSize?: number;
6
+ };
7
+ export declare const useReferralRebateSummary: (params: Params) => any[];
8
+ export {};
9
+ //# sourceMappingURL=useReferralRebateSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useReferralRebateSummary.d.ts","sourceRoot":"","sources":["../../src/referral/useReferralRebateSummary.ts"],"names":[],"mappings":"AAKA,KAAK,MAAM,GAAG;IAEV,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAA;AAED,eAAO,MAAM,wBAAwB,WAAY,MAAM,KAAG,GAAG,EA2C5D,CAAA"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useReferralRebateSummary", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return useReferralRebateSummary;
9
+ }
10
+ });
11
+ const _swr = require("./swr");
12
+ const _react = require("react");
13
+ const _usePrivateInfiniteQuery = require("../usePrivateInfiniteQuery");
14
+ const useReferralRebateSummary = (params)=>{
15
+ const { size = 10, startDate, endDate, initialSize } = params;
16
+ const response = (0, _usePrivateInfiniteQuery.usePrivateInfiniteQuery)((0, _swr.generateKeyFun)({
17
+ path: '/v1/referral/rebate_summary',
18
+ size,
19
+ startDate,
20
+ endDate
21
+ }), {
22
+ initialSize: initialSize,
23
+ // revalidateFirstPage: false,
24
+ // onError: (err) => {
25
+ // console.error("fetch failed::::", err);
26
+ // },
27
+ formatter: (data)=>data,
28
+ revalidateOnFocus: false
29
+ });
30
+ const loadMore = ()=>{
31
+ response.setSize(response.size + 1);
32
+ };
33
+ const total = (0, _react.useMemo)(()=>{
34
+ return response.data?.[0]?.meta?.total || 0;
35
+ }, [
36
+ response.data?.[0]?.meta?.total
37
+ ]);
38
+ const flattenOrders = (0, _react.useMemo)(()=>{
39
+ if (!response.data) {
40
+ return null;
41
+ }
42
+ return response.data?.map((item)=>item.rows)?.flat();
43
+ }, [
44
+ response.data
45
+ ]);
46
+ return [
47
+ flattenOrders,
48
+ {
49
+ total,
50
+ isLoading: response.isLoading,
51
+ refresh: response.mutate,
52
+ loadMore
53
+ }
54
+ ];
55
+ };
56
+
57
+ //# sourceMappingURL=useReferralRebateSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/referral/useReferralRebateSummary.ts"],"sourcesContent":["import { generateKeyFun } from \"./swr\";\nimport { useMemo } from \"react\";\nimport { RefferalAPI } from \"./api\";\nimport { usePrivateInfiniteQuery } from \"../usePrivateInfiniteQuery\";\n\ntype Params = {\n //** default is 10 */\n size?: number,\n //** YYYY-MM-dd */\n startDate?: string,\n //** YYYY-MM-dd */\n endDate?: string,\n //** default is 1 */\n initialSize?: number,\n}\n\nexport const useReferralRebateSummary = (params: Params): any[] => {\n const { size = 10, startDate, endDate, initialSize } = params;\n\n const response = usePrivateInfiniteQuery(\n generateKeyFun({ path: '/v1/referral/rebate_summary', size, startDate, endDate }),\n {\n initialSize: initialSize,\n // revalidateFirstPage: false,\n // onError: (err) => {\n // console.error(\"fetch failed::::\", err);\n // },\n formatter: (data) => data,\n revalidateOnFocus: false,\n }\n );\n\n\n const loadMore = () => {\n response.setSize(response.size + 1);\n };\n\n const total = useMemo(() => {\n return response.data?.[0]?.meta?.total || 0;\n }, [response.data?.[0]?.meta?.total]);\n\n\n const flattenOrders = useMemo((): RefferalAPI.ReferralRebateSummary[] | null => {\n if (!response.data) {\n return null;\n }\n\n return response.data?.map((item) => item.rows)?.flat();\n }, [response.data]);\n\n return [\n flattenOrders,\n {\n total,\n isLoading: response.isLoading,\n refresh: response.mutate,\n loadMore\n }\n ];\n}"],"names":["useReferralRebateSummary","params","size","startDate","endDate","initialSize","response","usePrivateInfiniteQuery","generateKeyFun","path","formatter","data","revalidateOnFocus","loadMore","setSize","total","useMemo","meta","flattenOrders","map","item","rows","flat","isLoading","refresh","mutate"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;qBAhBkB;uBACP;yCAEgB;AAajC,MAAMA,2BAA2B,CAACC;IACrC,MAAM,EAAEC,OAAO,EAAE,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WAAW,EAAE,GAAGJ;IAEvD,MAAMK,WAAWC,IAAAA,gDAAuB,EACpCC,IAAAA,mBAAc,EAAC;QAAEC,MAAM;QAA+BP;QAAMC;QAAWC;IAAQ,IAC/E;QACIC,aAAaA;QACb,8BAA8B;QAC9B,sBAAsB;QACtB,4CAA4C;QAC5C,KAAK;QACLK,WAAW,CAACC,OAASA;QACrBC,mBAAmB;IACvB;IAIJ,MAAMC,WAAW;QACbP,SAASQ,OAAO,CAACR,SAASJ,IAAI,GAAG;IACrC;IAEA,MAAMa,QAAQC,IAAAA,cAAO,EAAC;QAClB,OAAOV,SAASK,IAAI,EAAE,CAAC,EAAE,EAAEM,MAAMF,SAAS;IAC9C,GAAG;QAACT,SAASK,IAAI,EAAE,CAAC,EAAE,EAAEM,MAAMF;KAAM;IAGpC,MAAMG,gBAAgBF,IAAAA,cAAO,EAAC;QAC1B,IAAI,CAACV,SAASK,IAAI,EAAE;YAChB,OAAO;QACX;QAEA,OAAOL,SAASK,IAAI,EAAEQ,IAAI,CAACC,OAASA,KAAKC,IAAI,GAAGC;IACpD,GAAG;QAAChB,SAASK,IAAI;KAAC;IAElB,OAAO;QACHO;QACA;YACIH;YACAQ,WAAWjB,SAASiB,SAAS;YAC7BC,SAASlB,SAASmB,MAAM;YACxBZ;QACJ;KACH;AACL"}
@@ -1 +1 @@
1
- {"version":3,"file":"baseCreator.d.ts","sourceRoot":"","sources":["../../../src/services/orderCreator/baseCreator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAa,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,YAAY,EACb,MAAM,aAAa,CAAC;AAIrB,8BAAsB,gBAAgB,CAAC,CAAC,CAAE,YAAW,YAAY,CAAC,CAAC,CAAC;IAClE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,CAAC;IAEvD,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC;IAE5E,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW;IA+BzC,YAAY,CACV,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,YAAY,CAAC;IAoFxB,eAAe,CACb,KAAK,EAAE;QACL,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACjC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACxB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC/B,EACD,MAAM,EAAE,eAAe,GACtB,WAAW;CAaf"}
1
+ {"version":3,"file":"baseCreator.d.ts","sourceRoot":"","sources":["../../../src/services/orderCreator/baseCreator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAa,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,YAAY,EACb,MAAM,aAAa,CAAC;AAIrB,8BAAsB,gBAAgB,CAAC,CAAC,CAAE,YAAW,YAAY,CAAC,CAAC,CAAC;IAClE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,CAAC;IAEvD,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC;IAE5E,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW;IA+BzC,YAAY,CACV,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,YAAY,CAAC;IAsFxB,eAAe,CACb,KAAK,EAAE;QACL,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACjC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACxB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC/B,EACD,MAAM,EAAE,eAAe,GACtB,WAAW;CAaf"}
@@ -28,8 +28,9 @@ class BaseOrderCreator {
28
28
  }
29
29
  baseValidate(values, configs) {
30
30
  const errors = {};
31
- const { maxQty, symbol } = configs;
32
- let { order_quantity, total, order_price, reduce_only } = values;
31
+ const { maxQty, symbol, markPrice } = configs;
32
+ // @ts-ignore
33
+ let { order_quantity, total, order_price, reduce_only, order_type } = values;
33
34
  const { min_notional } = symbol;
34
35
  if (!order_quantity) {
35
36
  // calculate order_quantity from total
@@ -77,7 +78,8 @@ class BaseOrderCreator {
77
78
  };
78
79
  }
79
80
  }
80
- const notionalHintStr = (0, _createOrder.checkNotional)(order_price, order_quantity, min_notional);
81
+ const price = `${order_type}`.includes("MARKET") ? markPrice : order_price;
82
+ const notionalHintStr = (0, _createOrder.checkNotional)(price, order_quantity, min_notional);
81
83
  if (notionalHintStr !== undefined && reduce_only !== true) {
82
84
  errors.total = {
83
85
  type: "min",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/services/orderCreator/baseCreator.ts"],"sourcesContent":["import { OrderEntity, OrderType } from \"@orderly.network/types\";\nimport {\n OrderCreator,\n OrderFormEntity,\n ValuesDepConfig,\n VerifyResult,\n} from \"./interface\";\nimport { Decimal } from \"@orderly.network/utils\";\nimport { checkNotional } from \"../../utils/createOrder\";\n\nexport abstract class BaseOrderCreator<T> implements OrderCreator<T> {\n abstract create(values: T, config?: ValuesDepConfig): T;\n\n abstract validate(values: T, config: ValuesDepConfig): Promise<VerifyResult>;\n\n baseOrder(data: OrderEntity): OrderEntity {\n const order: Pick<\n OrderEntity,\n | \"symbol\"\n | \"order_type\"\n | \"side\"\n | \"reduce_only\"\n | \"order_quantity\"\n | \"total\"\n | \"visible_quantity\"\n > = {\n symbol: data.symbol!,\n order_type:\n data.order_type === OrderType.LIMIT\n ? !!data.order_type_ext\n ? data.order_type_ext\n : data.order_type\n : data.order_type,\n side: data.side,\n reduce_only: data.reduce_only!,\n order_quantity: data.order_quantity!,\n total: data.total,\n };\n\n if (data.visible_quantity === 0) {\n order.visible_quantity = data.visible_quantity;\n }\n\n return order as OrderEntity;\n }\n\n baseValidate(\n values: OrderFormEntity,\n configs: ValuesDepConfig\n ): Promise<VerifyResult> {\n const errors: {\n [P in keyof OrderEntity]?: { type: string; message: string };\n } = {};\n\n const { maxQty, symbol } = configs;\n\n let { order_quantity, total, order_price, reduce_only } = values;\n\n const { min_notional } = symbol;\n\n if (!order_quantity) {\n // calculate order_quantity from total\n if (total && order_price) {\n const { quote_dp } = configs.symbol;\n const totalNumber = new Decimal(total);\n const qty = totalNumber.dividedBy(order_price).toFixed(quote_dp);\n order_quantity = qty;\n }\n }\n\n if (!order_quantity) {\n errors.order_quantity = {\n type: \"required\",\n message: \"quantity is required\",\n };\n } else {\n // need to use MaxQty+base_max, base_min to compare\n const { base_min, quote_dp, base_dp } = configs.symbol;\n const qty = new Decimal(order_quantity);\n if (qty.lt(base_min)) {\n errors.order_quantity = {\n type: \"min\",\n message: `quantity must be greater than ${new Decimal(base_min).todp(\n base_dp\n )}`,\n };\n // errors.order_quantity = `quantity must be greater than ${base_min}`;\n } else if (qty.gt(maxQty)) {\n errors.order_quantity = {\n type: \"max\",\n message: `quantity must be less than ${new Decimal(maxQty).todp(\n base_dp\n )}`,\n };\n }\n }\n\n if (!!total) {\n const { quote_max, quote_min, quote_dp } = configs.symbol;\n const totalNumber = new Decimal(total);\n if (totalNumber.lt(quote_min)) {\n errors.total = {\n type: \"min\",\n message: `Quantity must be at least ${new Decimal(quote_min).todp(\n quote_dp\n )}`,\n };\n } else if (totalNumber.gt(quote_max)) {\n errors.total = {\n type: \"max\",\n message: `Quantity should be less or equal than ${new Decimal(\n quote_max\n ).todp(quote_dp)}`,\n };\n }\n }\n\n const notionalHintStr = checkNotional(\n order_price,\n order_quantity,\n min_notional\n );\n\n if (notionalHintStr !== undefined && reduce_only !== true) {\n errors.total = {\n type: \"min\",\n message: notionalHintStr,\n };\n }\n\n return Promise.resolve(errors);\n }\n\n totalToQuantity(\n order: {\n order_quantity?: number | string;\n total?: string | number;\n order_price?: string | number;\n },\n config: ValuesDepConfig\n ): OrderEntity {\n // if order_quantity is not set but total is set, calculate order_quantity from total\n if (!order.order_quantity && order.total && order.order_price) {\n const { base_dp } = config.symbol;\n const totalNumber = new Decimal(order.total);\n const qty = totalNumber.div(order.order_price).toDecimalPlaces(base_dp);\n order.order_quantity = qty.toNumber();\n\n delete order.total;\n }\n\n return order as OrderEntity;\n }\n}\n"],"names":["BaseOrderCreator","baseOrder","data","order","symbol","order_type","OrderType","LIMIT","order_type_ext","side","reduce_only","order_quantity","total","visible_quantity","baseValidate","values","configs","errors","maxQty","order_price","min_notional","quote_dp","totalNumber","Decimal","qty","dividedBy","toFixed","type","message","base_min","base_dp","lt","todp","gt","quote_max","quote_min","notionalHintStr","checkNotional","undefined","Promise","resolve","totalToQuantity","config","div","toDecimalPlaces","toNumber"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
1
+ {"version":3,"sources":["../../../src/services/orderCreator/baseCreator.ts"],"sourcesContent":["import { OrderEntity, OrderType } from \"@orderly.network/types\";\nimport {\n OrderCreator,\n OrderFormEntity,\n ValuesDepConfig,\n VerifyResult,\n} from \"./interface\";\nimport { Decimal } from \"@orderly.network/utils\";\nimport { checkNotional } from \"../../utils/createOrder\";\n\nexport abstract class BaseOrderCreator<T> implements OrderCreator<T> {\n abstract create(values: T, config?: ValuesDepConfig): T;\n\n abstract validate(values: T, config: ValuesDepConfig): Promise<VerifyResult>;\n\n baseOrder(data: OrderEntity): OrderEntity {\n const order: Pick<\n OrderEntity,\n | \"symbol\"\n | \"order_type\"\n | \"side\"\n | \"reduce_only\"\n | \"order_quantity\"\n | \"total\"\n | \"visible_quantity\"\n > = {\n symbol: data.symbol!,\n order_type:\n data.order_type === OrderType.LIMIT\n ? !!data.order_type_ext\n ? data.order_type_ext\n : data.order_type\n : data.order_type,\n side: data.side,\n reduce_only: data.reduce_only!,\n order_quantity: data.order_quantity!,\n total: data.total,\n };\n\n if (data.visible_quantity === 0) {\n order.visible_quantity = data.visible_quantity;\n }\n\n return order as OrderEntity;\n }\n\n baseValidate(\n values: OrderFormEntity,\n configs: ValuesDepConfig\n ): Promise<VerifyResult> {\n const errors: {\n [P in keyof OrderEntity]?: { type: string; message: string };\n } = {};\n\n const { maxQty, symbol, markPrice } = configs;\n\n // @ts-ignore\n let { order_quantity, total, order_price, reduce_only, order_type } = values;\n\n const { min_notional } = symbol;\n\n if (!order_quantity) {\n // calculate order_quantity from total\n if (total && order_price) {\n const { quote_dp } = configs.symbol;\n const totalNumber = new Decimal(total);\n const qty = totalNumber.dividedBy(order_price).toFixed(quote_dp);\n order_quantity = qty;\n }\n }\n\n if (!order_quantity) {\n errors.order_quantity = {\n type: \"required\",\n message: \"quantity is required\",\n };\n } else {\n // need to use MaxQty+base_max, base_min to compare\n const { base_min, quote_dp, base_dp } = configs.symbol;\n const qty = new Decimal(order_quantity);\n if (qty.lt(base_min)) {\n errors.order_quantity = {\n type: \"min\",\n message: `quantity must be greater than ${new Decimal(base_min).todp(\n base_dp\n )}`,\n };\n // errors.order_quantity = `quantity must be greater than ${base_min}`;\n } else if (qty.gt(maxQty)) {\n errors.order_quantity = {\n type: \"max\",\n message: `quantity must be less than ${new Decimal(maxQty).todp(\n base_dp\n )}`,\n };\n }\n }\n\n if (!!total) {\n const { quote_max, quote_min, quote_dp } = configs.symbol;\n const totalNumber = new Decimal(total);\n if (totalNumber.lt(quote_min)) {\n errors.total = {\n type: \"min\",\n message: `Quantity must be at least ${new Decimal(quote_min).todp(\n quote_dp\n )}`,\n };\n } else if (totalNumber.gt(quote_max)) {\n errors.total = {\n type: \"max\",\n message: `Quantity should be less or equal than ${new Decimal(\n quote_max\n ).todp(quote_dp)}`,\n };\n }\n }\n\n const price = `${order_type}`.includes(\"MARKET\") ? markPrice : order_price;\n const notionalHintStr = checkNotional(\n price,\n order_quantity,\n min_notional\n );\n\n if (notionalHintStr !== undefined && reduce_only !== true) {\n errors.total = {\n type: \"min\",\n message: notionalHintStr,\n };\n }\n\n return Promise.resolve(errors);\n }\n\n totalToQuantity(\n order: {\n order_quantity?: number | string;\n total?: string | number;\n order_price?: string | number;\n },\n config: ValuesDepConfig\n ): OrderEntity {\n // if order_quantity is not set but total is set, calculate order_quantity from total\n if (!order.order_quantity && order.total && order.order_price) {\n const { base_dp } = config.symbol;\n const totalNumber = new Decimal(order.total);\n const qty = totalNumber.div(order.order_price).toDecimalPlaces(base_dp);\n order.order_quantity = qty.toNumber();\n\n delete order.total;\n }\n\n return order as OrderEntity;\n }\n}\n"],"names":["BaseOrderCreator","baseOrder","data","order","symbol","order_type","OrderType","LIMIT","order_type_ext","side","reduce_only","order_quantity","total","visible_quantity","baseValidate","values","configs","errors","maxQty","markPrice","order_price","min_notional","quote_dp","totalNumber","Decimal","qty","dividedBy","toFixed","type","message","base_min","base_dp","lt","todp","gt","quote_max","quote_min","price","includes","notionalHintStr","checkNotional","undefined","Promise","resolve","totalToQuantity","config","div","toDecimalPlaces","toNumber"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
@@ -1,5 +1,5 @@
1
1
  import { type SWRInfiniteKeyLoader, type SWRInfiniteConfiguration } from "swr/infinite";
2
- export declare const usePrivateInfiniteQuery: (getKey: SWRInfiniteKeyLoader, options?: (SWRInfiniteConfiguration<any, any, import("swr/_internal").BareFetcher<any>> & {
2
+ export declare const usePrivateInfiniteQuery: (getKey: SWRInfiniteKeyLoader, options?: (SWRInfiniteConfiguration<any, any, import("swr/dist/_internal").BareFetcher<any>> & {
3
3
  formatter?: ((data: any) => any) | undefined;
4
- }) | undefined) => import("swr/infinite").SWRInfiniteResponse<any, any>;
4
+ }) | undefined) => import("swr/dist/infinite").SWRInfiniteResponse<any, any>;
5
5
  //# sourceMappingURL=usePrivateInfiniteQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePrivateInfiniteQuery.d.ts","sourceRoot":"","sources":["../src/usePrivateInfiniteQuery.ts"],"names":[],"mappings":"AAAA,OAAuB,EACrB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC9B,MAAM,cAAc,CAAC;AAMtB,eAAO,MAAM,uBAAuB,WAC1B,oBAAoB;wBAEP,GAAG,KAAK,GAAG;uEA4BjC,CAAC"}
1
+ {"version":3,"file":"usePrivateInfiniteQuery.d.ts","sourceRoot":"","sources":["../src/usePrivateInfiniteQuery.ts"],"names":[],"mappings":"AAAA,OAAuB,EACrB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC9B,MAAM,cAAc,CAAC;AAMtB,eAAO,MAAM,uBAAuB,WAC1B,oBAAoB;wBAEP,GAAG,KAAK,GAAG;4EA4BjC,CAAC"}
package/lib/version.d.ts CHANGED
@@ -5,6 +5,6 @@ declare global {
5
5
  };
6
6
  }
7
7
  }
8
- declare const _default: "1.4.0";
8
+ declare const _default: "1.4.3";
9
9
  export default _default;
10
10
  //# sourceMappingURL=version.d.ts.map
package/lib/version.js CHANGED
@@ -10,8 +10,8 @@ Object.defineProperty(exports, "default", {
10
10
  });
11
11
  if (typeof window !== 'undefined') {
12
12
  window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
13
- window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "1.4.0";
13
+ window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "1.4.3";
14
14
  }
15
- const _default = "1.4.0";
15
+ const _default = "1.4.3";
16
16
 
17
17
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/version.ts"],"sourcesContent":["\ndeclare global {\n interface Window {\n __ORDERLY_VERSION__?: {\n [key: string]: string;\n };\n }\n}\nif(typeof window !== 'undefined') {\n window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};\n window.__ORDERLY_VERSION__[\"@orderly.network/hooks\"] = \"1.4.0\";\n};\n\nexport default \"1.4.0\";\n"],"names":["window","__ORDERLY_VERSION__"],"rangeMappings":";;;;;;;;;;;;;;","mappings":";;;;+BAaA;;;eAAA;;;AALA,IAAG,OAAOA,WAAW,aAAa;IAC9BA,OAAOC,mBAAmB,GAAGD,OAAOC,mBAAmB,IAAI,CAAC;IAC5DD,OAAOC,mBAAmB,CAAC,yBAAyB,GAAG;AAC3D;MAEA,WAAe"}
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["\ndeclare global {\n interface Window {\n __ORDERLY_VERSION__?: {\n [key: string]: string;\n };\n }\n}\nif(typeof window !== 'undefined') {\n window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};\n window.__ORDERLY_VERSION__[\"@orderly.network/hooks\"] = \"1.4.3\";\n};\n\nexport default \"1.4.3\";\n"],"names":["window","__ORDERLY_VERSION__"],"rangeMappings":";;;;;;;;;;;;;;","mappings":";;;;+BAaA;;;eAAA;;;AALA,IAAG,OAAOA,WAAW,aAAa;IAC9BA,OAAOC,mBAAmB,GAAGD,OAAOC,mBAAmB,IAAI,CAAC;IAC5DD,OAAOC,mBAAmB,CAAC,yBAAyB,GAAG;AAC3D;MAEA,WAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orderly.network/hooks",
3
- "version": "1.4.0",
3
+ "version": "1.4.3",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",
@@ -32,18 +32,18 @@
32
32
  "tsup": "^7.1.0",
33
33
  "typedoc": "^0.24.8",
34
34
  "typescript": "^5.1.6",
35
- "tsconfig": "0.2.2"
35
+ "tsconfig": "0.2.5"
36
36
  },
37
37
  "dependencies": {
38
38
  "ramda": "^0.29.0",
39
39
  "swr": "^2.2.4",
40
40
  "use-constant": "^1.1.1",
41
41
  "use-debounce": "^9.0.4",
42
- "@orderly.network/core": "1.4.0",
43
- "@orderly.network/net": "1.4.0",
44
- "@orderly.network/perp": "3.2.0",
45
- "@orderly.network/types": "1.4.0",
46
- "@orderly.network/utils": "1.4.0"
42
+ "@orderly.network/core": "1.4.3",
43
+ "@orderly.network/net": "1.4.3",
44
+ "@orderly.network/perp": "3.2.3",
45
+ "@orderly.network/types": "1.4.3",
46
+ "@orderly.network/utils": "1.4.3"
47
47
  },
48
48
  "publishConfig": {
49
49
  "access": "public"