@orderly.network/hooks 0.0.56 → 0.0.58
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/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { SimpleDI, Account, EventEmitter, utils } from '@orderly.network/core';
|
|
|
9
9
|
import { AccountStatusEnum, OrderSide, chainsMap, OrderStatus as OrderStatus$1, OrderType } from '@orderly.network/types';
|
|
10
10
|
import useSWRSubscription from 'swr/subscription';
|
|
11
11
|
import { Decimal, zero, getPrecisionByNumber, timeConvertString } from '@orderly.network/utils';
|
|
12
|
-
import { pathOr, propOr, compose, head, prop,
|
|
12
|
+
import { pathOr, propOr, compose, head, prop, pick } from 'ramda';
|
|
13
13
|
import { positions, account, order } from '@orderly.network/futures';
|
|
14
14
|
import useSWRInfinite from 'swr/infinite';
|
|
15
15
|
export * from 'use-debounce';
|
|
@@ -2586,18 +2586,24 @@ var useChains = (networkId, options = {}) => {
|
|
|
2586
2586
|
let testnetArr = [];
|
|
2587
2587
|
let mainnetArr = [];
|
|
2588
2588
|
Object.keys(data.data).forEach((key) => {
|
|
2589
|
-
data.data[key];
|
|
2590
|
-
if (orderlyChainIds.has(
|
|
2589
|
+
const chain = data.data[key];
|
|
2590
|
+
if (orderlyChainIds.has(chain.network_infos.chain_id)) {
|
|
2591
2591
|
orderlyChainsArr = orderlyChainsArr.map((item2) => {
|
|
2592
|
-
if (item2.network_infos.chain_id ===
|
|
2593
|
-
return
|
|
2592
|
+
if (item2.network_infos.chain_id === chain.network_infos.chain_id) {
|
|
2593
|
+
return {
|
|
2594
|
+
network_infos: {
|
|
2595
|
+
...item2.network_infos,
|
|
2596
|
+
...chain.network_infos
|
|
2597
|
+
},
|
|
2598
|
+
token_infos: chain.token_infos
|
|
2599
|
+
};
|
|
2594
2600
|
}
|
|
2595
2601
|
return item2;
|
|
2596
2602
|
});
|
|
2597
2603
|
return;
|
|
2598
2604
|
}
|
|
2599
2605
|
const item = {
|
|
2600
|
-
...
|
|
2606
|
+
...chain,
|
|
2601
2607
|
name: key
|
|
2602
2608
|
};
|
|
2603
2609
|
if (item.token_infos?.length === 0)
|