@pear-protocol/symmio-client 0.2.10 → 0.2.11
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/react/index.js +163 -142
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +164 -143
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/provider.js +0 -149
- package/dist/react/provider.js.map +1 -1
- package/dist/react/provider.mjs +1 -150
- package/dist/react/provider.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { createContext, useContext,
|
|
2
|
+
import { createContext, useContext, useMemo, useRef, useCallback, useEffect } from 'react';
|
|
3
3
|
import { createSymmSDK, isAuthExpiredError, isNetworkError, isInsufficientMarginError, isRateLimitedError, isTimeoutError } from '@pear-protocol/symm-core';
|
|
4
|
-
import { useQueryClient, useQuery, useMutation } from '@tanstack/react-query';
|
|
5
|
-
import { create } from 'zustand';
|
|
6
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
import { create } from 'zustand';
|
|
6
|
+
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
7
7
|
import { isAddress, encodeFunctionData } from 'viem';
|
|
8
8
|
|
|
9
9
|
var SymmContext = createContext(null);
|
|
@@ -14,145 +14,6 @@ function useSymmContext() {
|
|
|
14
14
|
}
|
|
15
15
|
return ctx;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
// src/react/query-keys.ts
|
|
19
|
-
var symmKeys = {
|
|
20
|
-
all: ["symm"],
|
|
21
|
-
accounts: (address, chainId) => ["symm", "accounts", address, chainId],
|
|
22
|
-
accountsApi: (address, chainId) => ["symm", "accountsApi", address, chainId],
|
|
23
|
-
accountsLength: (address, chainId) => ["symm", "accountsLength", address, chainId],
|
|
24
|
-
accountsWithPositions: (address, chainId) => ["symm", "accountsWithPositions", address, chainId],
|
|
25
|
-
accountSummary: (address, chainId) => ["symm", "accountSummary", address, chainId],
|
|
26
|
-
accountData: (address, chainId, upnl) => ["symm", "accountData", address, chainId, upnl],
|
|
27
|
-
signature: (address, chainId) => ["symm", "signature", address, chainId],
|
|
28
|
-
approval: (owner, spender, chainId, token) => ["symm", "approval", owner, spender, chainId, token],
|
|
29
|
-
balances: (address, chainId) => ["symm", "balances", address, chainId],
|
|
30
|
-
positions: (params) => ["symm", "positions", params],
|
|
31
|
-
openOrders: (params) => ["symm", "openOrders", params],
|
|
32
|
-
tradeHistory: (params) => ["symm", "tradeHistory", params],
|
|
33
|
-
tpslOrders: (address, chainId) => ["symm", "tpslOrders", address, chainId],
|
|
34
|
-
tpslOrdersList: (params) => ["symm", "tpslOrders", params],
|
|
35
|
-
twapOrders: (address, chainId) => ["symm", "twapOrders", address, chainId],
|
|
36
|
-
triggerOrders: (params) => ["symm", "triggerOrders", params],
|
|
37
|
-
triggerConfig: (orderId) => ["symm", "triggerConfig", orderId],
|
|
38
|
-
markets: (chainId, search) => ["symm", "markets", chainId, search],
|
|
39
|
-
hedgerMarketById: (id, chainId) => ["symm", "hedgerMarketById", id, chainId],
|
|
40
|
-
hedgerMarketBySymbol: (symbol, chainId) => ["symm", "hedgerMarketBySymbol", symbol, chainId],
|
|
41
|
-
lockedParams: (marketName, leverage, chainId) => ["symm", "lockedParams", marketName, leverage, chainId],
|
|
42
|
-
hedgerMarkets: (request) => ["symm", "hedgerMarkets", request],
|
|
43
|
-
fundingRates: (chainId) => ["symm", "fundingRates", chainId],
|
|
44
|
-
fundingPayments: (params) => ["symm", "fundingPayments", params],
|
|
45
|
-
fundingHistory: (params) => ["symm", "fundingHistory", params],
|
|
46
|
-
portfolio: (params) => ["symm", "portfolio", params],
|
|
47
|
-
notifications: (address, chainId) => ["symm", "notifications", address, chainId],
|
|
48
|
-
unreadCount: (address, chainId) => ["symm", "unreadCount", address, chainId],
|
|
49
|
-
availableMargin: (address, chainId) => ["symm", "availableMargin", address, chainId],
|
|
50
|
-
pendingIds: (address, chainId) => ["symm", "pendingIds", address, chainId],
|
|
51
|
-
pendingInstantOpens: (accountAddress, chainId) => ["symm", "pendingInstantOpens", accountAddress, chainId],
|
|
52
|
-
twapOrder: (orderId) => ["symm", "twapOrder", orderId],
|
|
53
|
-
delegation: (account, target, selectors, chainId) => ["symm", "delegation", account, target, selectors, chainId],
|
|
54
|
-
chartMetadata: (symbolsKey, positionKey) => ["symm", "chartMetadata", symbolsKey, positionKey]
|
|
55
|
-
};
|
|
56
|
-
var useSymmWsStore = create((set) => ({
|
|
57
|
-
isConnected: false,
|
|
58
|
-
setConnected: (isConnected) => set({ isConnected })
|
|
59
|
-
}));
|
|
60
|
-
|
|
61
|
-
// src/react/hooks/use-symm-ws.ts
|
|
62
|
-
function asUnsubscribeFn(value) {
|
|
63
|
-
return typeof value === "function" ? value : null;
|
|
64
|
-
}
|
|
65
|
-
function useSymmWs(params = {}) {
|
|
66
|
-
const { symmCoreClient: ctxClient, address: ctxAddress, chainId: ctxChainId } = useSymmContext();
|
|
67
|
-
const queryClient = useQueryClient();
|
|
68
|
-
const isConnected = useSymmWsStore((state) => state.isConnected);
|
|
69
|
-
const setConnected = useSymmWsStore((state) => state.setConnected);
|
|
70
|
-
const symmCoreClient = params.symmCoreClient ?? ctxClient;
|
|
71
|
-
const accountAddress = params.accountAddress ?? ctxAddress;
|
|
72
|
-
const chainId = params.chainId ?? ctxChainId;
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
if (!symmCoreClient || !accountAddress) {
|
|
75
|
-
setConnected(false);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const ws = symmCoreClient.ws;
|
|
79
|
-
const addr = accountAddress;
|
|
80
|
-
const unsubscribers = [];
|
|
81
|
-
const removeOnConnect = ws.onConnect(() => setConnected(true));
|
|
82
|
-
const removeOnDisconnect = ws.onDisconnect(() => setConnected(false));
|
|
83
|
-
unsubscribers.push(removeOnConnect, removeOnDisconnect);
|
|
84
|
-
const positionsUnsub = asUnsubscribeFn(ws.subscribeToPositions(addr, chainId, () => {
|
|
85
|
-
queryClient.invalidateQueries({
|
|
86
|
-
queryKey: ["symm", "positions"]
|
|
87
|
-
});
|
|
88
|
-
}));
|
|
89
|
-
if (positionsUnsub) unsubscribers.push(positionsUnsub);
|
|
90
|
-
const openOrdersUnsub = asUnsubscribeFn(ws.subscribeToOpenOrders(addr, chainId, () => {
|
|
91
|
-
queryClient.invalidateQueries({
|
|
92
|
-
queryKey: ["symm", "openOrders"]
|
|
93
|
-
});
|
|
94
|
-
}));
|
|
95
|
-
if (openOrdersUnsub) unsubscribers.push(openOrdersUnsub);
|
|
96
|
-
const tradesUnsub = asUnsubscribeFn(ws.subscribeToTrades(addr, chainId, () => {
|
|
97
|
-
queryClient.invalidateQueries({
|
|
98
|
-
queryKey: ["symm", "tradeHistory"]
|
|
99
|
-
});
|
|
100
|
-
}));
|
|
101
|
-
if (tradesUnsub) unsubscribers.push(tradesUnsub);
|
|
102
|
-
const accountSummaryUnsub = asUnsubscribeFn(ws.subscribeToAccountSummary(addr, chainId, () => {
|
|
103
|
-
queryClient.invalidateQueries({
|
|
104
|
-
queryKey: symmKeys.balances(accountAddress, chainId)
|
|
105
|
-
});
|
|
106
|
-
queryClient.invalidateQueries({
|
|
107
|
-
queryKey: symmKeys.accountSummary(accountAddress, chainId)
|
|
108
|
-
});
|
|
109
|
-
}));
|
|
110
|
-
if (accountSummaryUnsub) unsubscribers.push(accountSummaryUnsub);
|
|
111
|
-
const notificationsUnsub = asUnsubscribeFn(ws.subscribeToNotifications(addr, chainId, () => {
|
|
112
|
-
queryClient.invalidateQueries({
|
|
113
|
-
queryKey: symmKeys.notifications(accountAddress, chainId)
|
|
114
|
-
});
|
|
115
|
-
queryClient.invalidateQueries({
|
|
116
|
-
queryKey: symmKeys.unreadCount(accountAddress, chainId)
|
|
117
|
-
});
|
|
118
|
-
}));
|
|
119
|
-
if (notificationsUnsub) unsubscribers.push(notificationsUnsub);
|
|
120
|
-
const tpslUnsub = asUnsubscribeFn(ws.subscribeToTpsl(addr, chainId, () => {
|
|
121
|
-
queryClient.invalidateQueries({ queryKey: ["symm", "tpslOrders"] });
|
|
122
|
-
queryClient.invalidateQueries({ queryKey: ["symm", "openOrders"] });
|
|
123
|
-
}));
|
|
124
|
-
if (tpslUnsub) unsubscribers.push(tpslUnsub);
|
|
125
|
-
const twapUnsub = asUnsubscribeFn(ws.subscribeToTwapOrders(addr, chainId, () => {
|
|
126
|
-
queryClient.invalidateQueries({ queryKey: ["symm", "twapOrders"] });
|
|
127
|
-
queryClient.invalidateQueries({ queryKey: ["symm", "openOrders"] });
|
|
128
|
-
}));
|
|
129
|
-
if (twapUnsub) unsubscribers.push(twapUnsub);
|
|
130
|
-
const triggerOrdersUnsub = asUnsubscribeFn(ws.subscribeToTriggerOrders(addr, chainId, () => {
|
|
131
|
-
queryClient.invalidateQueries({ queryKey: ["symm", "triggerOrders"] });
|
|
132
|
-
queryClient.invalidateQueries({ queryKey: ["symm", "openOrders"] });
|
|
133
|
-
}));
|
|
134
|
-
if (triggerOrdersUnsub) unsubscribers.push(triggerOrdersUnsub);
|
|
135
|
-
const executionsUnsub = asUnsubscribeFn(ws.subscribeToExecutions(addr, chainId, () => {
|
|
136
|
-
queryClient.invalidateQueries({
|
|
137
|
-
queryKey: ["symm", "positions"]
|
|
138
|
-
});
|
|
139
|
-
queryClient.invalidateQueries({
|
|
140
|
-
queryKey: ["symm", "portfolio"]
|
|
141
|
-
});
|
|
142
|
-
}));
|
|
143
|
-
if (executionsUnsub) unsubscribers.push(executionsUnsub);
|
|
144
|
-
return () => {
|
|
145
|
-
if (unsubscribers.length > 2) {
|
|
146
|
-
unsubscribers.forEach((unsubscribe) => unsubscribe());
|
|
147
|
-
} else {
|
|
148
|
-
removeOnConnect();
|
|
149
|
-
removeOnDisconnect();
|
|
150
|
-
ws.unsubscribeAll();
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}, [symmCoreClient, accountAddress, chainId, queryClient, setConnected]);
|
|
154
|
-
return { isConnected };
|
|
155
|
-
}
|
|
156
17
|
function SymmProvider({
|
|
157
18
|
chainId = 42161,
|
|
158
19
|
address,
|
|
@@ -167,7 +28,6 @@ function SymmProvider({
|
|
|
167
28
|
defaultChainId: chainId
|
|
168
29
|
});
|
|
169
30
|
}, [chainId, symmCoreConfig.apiUrl, symmCoreConfig.wsUrl]);
|
|
170
|
-
useSymmWs({ symmCoreClient, accountAddress: address, chainId });
|
|
171
31
|
const value = useMemo(
|
|
172
32
|
() => ({
|
|
173
33
|
symmCoreClient,
|
|
@@ -987,6 +847,45 @@ async function hasDelegatedAccess(publicClient, multiAccount, params) {
|
|
|
987
847
|
return Boolean(result);
|
|
988
848
|
}
|
|
989
849
|
|
|
850
|
+
// src/react/query-keys.ts
|
|
851
|
+
var symmKeys = {
|
|
852
|
+
all: ["symm"],
|
|
853
|
+
accounts: (address, chainId) => ["symm", "accounts", address, chainId],
|
|
854
|
+
accountsApi: (address, chainId) => ["symm", "accountsApi", address, chainId],
|
|
855
|
+
accountsLength: (address, chainId) => ["symm", "accountsLength", address, chainId],
|
|
856
|
+
accountsWithPositions: (address, chainId) => ["symm", "accountsWithPositions", address, chainId],
|
|
857
|
+
accountSummary: (address, chainId) => ["symm", "accountSummary", address, chainId],
|
|
858
|
+
accountData: (address, chainId, upnl) => ["symm", "accountData", address, chainId, upnl],
|
|
859
|
+
signature: (address, chainId) => ["symm", "signature", address, chainId],
|
|
860
|
+
approval: (owner, spender, chainId, token) => ["symm", "approval", owner, spender, chainId, token],
|
|
861
|
+
balances: (address, chainId) => ["symm", "balances", address, chainId],
|
|
862
|
+
positions: (params) => ["symm", "positions", params],
|
|
863
|
+
openOrders: (params) => ["symm", "openOrders", params],
|
|
864
|
+
tradeHistory: (params) => ["symm", "tradeHistory", params],
|
|
865
|
+
tpslOrders: (address, chainId) => ["symm", "tpslOrders", address, chainId],
|
|
866
|
+
tpslOrdersList: (params) => ["symm", "tpslOrders", params],
|
|
867
|
+
twapOrders: (address, chainId) => ["symm", "twapOrders", address, chainId],
|
|
868
|
+
triggerOrders: (params) => ["symm", "triggerOrders", params],
|
|
869
|
+
triggerConfig: (orderId) => ["symm", "triggerConfig", orderId],
|
|
870
|
+
markets: (chainId, search) => ["symm", "markets", chainId, search],
|
|
871
|
+
hedgerMarketById: (id, chainId) => ["symm", "hedgerMarketById", id, chainId],
|
|
872
|
+
hedgerMarketBySymbol: (symbol, chainId) => ["symm", "hedgerMarketBySymbol", symbol, chainId],
|
|
873
|
+
lockedParams: (marketName, leverage, chainId) => ["symm", "lockedParams", marketName, leverage, chainId],
|
|
874
|
+
hedgerMarkets: (request) => ["symm", "hedgerMarkets", request],
|
|
875
|
+
fundingRates: (chainId) => ["symm", "fundingRates", chainId],
|
|
876
|
+
fundingPayments: (params) => ["symm", "fundingPayments", params],
|
|
877
|
+
fundingHistory: (params) => ["symm", "fundingHistory", params],
|
|
878
|
+
portfolio: (params) => ["symm", "portfolio", params],
|
|
879
|
+
notifications: (address, chainId) => ["symm", "notifications", address, chainId],
|
|
880
|
+
unreadCount: (address, chainId) => ["symm", "unreadCount", address, chainId],
|
|
881
|
+
availableMargin: (address, chainId) => ["symm", "availableMargin", address, chainId],
|
|
882
|
+
pendingIds: (address, chainId) => ["symm", "pendingIds", address, chainId],
|
|
883
|
+
pendingInstantOpens: (accountAddress, chainId) => ["symm", "pendingInstantOpens", accountAddress, chainId],
|
|
884
|
+
twapOrder: (orderId) => ["symm", "twapOrder", orderId],
|
|
885
|
+
delegation: (account, target, selectors, chainId) => ["symm", "delegation", account, target, selectors, chainId],
|
|
886
|
+
chartMetadata: (symbolsKey, positionKey) => ["symm", "chartMetadata", symbolsKey, positionKey]
|
|
887
|
+
};
|
|
888
|
+
|
|
990
889
|
// src/react/hooks/use-symm-delegation.ts
|
|
991
890
|
function useSymmDelegation(params) {
|
|
992
891
|
const { chainId, address, symmioConfig } = useSymmContext();
|
|
@@ -25284,6 +25183,128 @@ function useSymmTwapOrder(params) {
|
|
|
25284
25183
|
refetch: query.refetch
|
|
25285
25184
|
};
|
|
25286
25185
|
}
|
|
25186
|
+
var useSymmWsStore = create((set) => ({
|
|
25187
|
+
isConnected: false,
|
|
25188
|
+
setConnected: (isConnected) => set({ isConnected })
|
|
25189
|
+
}));
|
|
25190
|
+
|
|
25191
|
+
// src/react/hooks/use-symm-ws.ts
|
|
25192
|
+
function asUnsubscribeFn(value) {
|
|
25193
|
+
return typeof value === "function" ? value : null;
|
|
25194
|
+
}
|
|
25195
|
+
function useSymmWs(params = {}) {
|
|
25196
|
+
const {
|
|
25197
|
+
symmCoreClient: ctxClient,
|
|
25198
|
+
address: ctxAddress,
|
|
25199
|
+
chainId: ctxChainId
|
|
25200
|
+
} = useSymmContext();
|
|
25201
|
+
const queryClient = useQueryClient();
|
|
25202
|
+
const isConnected = useSymmWsStore((state) => state.isConnected);
|
|
25203
|
+
const setConnected = useSymmWsStore((state) => state.setConnected);
|
|
25204
|
+
const symmCoreClient = params.symmCoreClient ?? ctxClient;
|
|
25205
|
+
const accountAddress = params.accountAddress ?? ctxAddress;
|
|
25206
|
+
const chainId = params.chainId ?? ctxChainId;
|
|
25207
|
+
useEffect(() => {
|
|
25208
|
+
if (!symmCoreClient || !accountAddress) {
|
|
25209
|
+
setConnected(false);
|
|
25210
|
+
return;
|
|
25211
|
+
}
|
|
25212
|
+
const ws = symmCoreClient.ws;
|
|
25213
|
+
const addr = accountAddress;
|
|
25214
|
+
const unsubscribers = [];
|
|
25215
|
+
const removeOnConnect = ws.onConnect(() => setConnected(true));
|
|
25216
|
+
const removeOnDisconnect = ws.onDisconnect(() => setConnected(false));
|
|
25217
|
+
unsubscribers.push(removeOnConnect, removeOnDisconnect);
|
|
25218
|
+
const positionsUnsub = asUnsubscribeFn(
|
|
25219
|
+
ws.subscribeToPositions(addr, chainId, () => {
|
|
25220
|
+
queryClient.invalidateQueries({
|
|
25221
|
+
queryKey: ["symm", "positions"]
|
|
25222
|
+
});
|
|
25223
|
+
})
|
|
25224
|
+
);
|
|
25225
|
+
if (positionsUnsub) unsubscribers.push(positionsUnsub);
|
|
25226
|
+
const openOrdersUnsub = asUnsubscribeFn(
|
|
25227
|
+
ws.subscribeToOpenOrders(addr, chainId, () => {
|
|
25228
|
+
queryClient.invalidateQueries({
|
|
25229
|
+
queryKey: ["symm", "openOrders"]
|
|
25230
|
+
});
|
|
25231
|
+
})
|
|
25232
|
+
);
|
|
25233
|
+
if (openOrdersUnsub) unsubscribers.push(openOrdersUnsub);
|
|
25234
|
+
const tradesUnsub = asUnsubscribeFn(
|
|
25235
|
+
ws.subscribeToTrades(addr, chainId, () => {
|
|
25236
|
+
queryClient.invalidateQueries({
|
|
25237
|
+
queryKey: ["symm", "tradeHistory"]
|
|
25238
|
+
});
|
|
25239
|
+
})
|
|
25240
|
+
);
|
|
25241
|
+
if (tradesUnsub) unsubscribers.push(tradesUnsub);
|
|
25242
|
+
const accountSummaryUnsub = asUnsubscribeFn(
|
|
25243
|
+
ws.subscribeToAccountSummary(addr, chainId, () => {
|
|
25244
|
+
queryClient.invalidateQueries({
|
|
25245
|
+
queryKey: symmKeys.balances(accountAddress, chainId)
|
|
25246
|
+
});
|
|
25247
|
+
queryClient.invalidateQueries({
|
|
25248
|
+
queryKey: symmKeys.accountSummary(accountAddress, chainId)
|
|
25249
|
+
});
|
|
25250
|
+
})
|
|
25251
|
+
);
|
|
25252
|
+
if (accountSummaryUnsub) unsubscribers.push(accountSummaryUnsub);
|
|
25253
|
+
const notificationsUnsub = asUnsubscribeFn(
|
|
25254
|
+
ws.subscribeToNotifications(addr, chainId, () => {
|
|
25255
|
+
queryClient.invalidateQueries({
|
|
25256
|
+
queryKey: symmKeys.notifications(accountAddress, chainId)
|
|
25257
|
+
});
|
|
25258
|
+
queryClient.invalidateQueries({
|
|
25259
|
+
queryKey: symmKeys.unreadCount(accountAddress, chainId)
|
|
25260
|
+
});
|
|
25261
|
+
})
|
|
25262
|
+
);
|
|
25263
|
+
if (notificationsUnsub) unsubscribers.push(notificationsUnsub);
|
|
25264
|
+
const tpslUnsub = asUnsubscribeFn(
|
|
25265
|
+
ws.subscribeToTpsl(addr, chainId, () => {
|
|
25266
|
+
queryClient.invalidateQueries({ queryKey: ["symm", "tpslOrders"] });
|
|
25267
|
+
queryClient.invalidateQueries({ queryKey: ["symm", "openOrders"] });
|
|
25268
|
+
})
|
|
25269
|
+
);
|
|
25270
|
+
if (tpslUnsub) unsubscribers.push(tpslUnsub);
|
|
25271
|
+
const twapUnsub = asUnsubscribeFn(
|
|
25272
|
+
ws.subscribeToTwapOrders(addr, chainId, () => {
|
|
25273
|
+
queryClient.invalidateQueries({ queryKey: ["symm", "twapOrders"] });
|
|
25274
|
+
queryClient.invalidateQueries({ queryKey: ["symm", "openOrders"] });
|
|
25275
|
+
})
|
|
25276
|
+
);
|
|
25277
|
+
if (twapUnsub) unsubscribers.push(twapUnsub);
|
|
25278
|
+
const triggerOrdersUnsub = asUnsubscribeFn(
|
|
25279
|
+
ws.subscribeToTriggerOrders(addr, chainId, () => {
|
|
25280
|
+
queryClient.invalidateQueries({ queryKey: ["symm", "triggerOrders"] });
|
|
25281
|
+
queryClient.invalidateQueries({ queryKey: ["symm", "openOrders"] });
|
|
25282
|
+
})
|
|
25283
|
+
);
|
|
25284
|
+
if (triggerOrdersUnsub) unsubscribers.push(triggerOrdersUnsub);
|
|
25285
|
+
const executionsUnsub = asUnsubscribeFn(
|
|
25286
|
+
ws.subscribeToExecutions(addr, chainId, () => {
|
|
25287
|
+
queryClient.invalidateQueries({
|
|
25288
|
+
queryKey: ["symm", "positions"]
|
|
25289
|
+
});
|
|
25290
|
+
queryClient.invalidateQueries({
|
|
25291
|
+
queryKey: ["symm", "portfolio"]
|
|
25292
|
+
});
|
|
25293
|
+
})
|
|
25294
|
+
);
|
|
25295
|
+
if (executionsUnsub) unsubscribers.push(executionsUnsub);
|
|
25296
|
+
return () => {
|
|
25297
|
+
if (unsubscribers.length > 2) {
|
|
25298
|
+
unsubscribers.forEach((unsubscribe) => unsubscribe());
|
|
25299
|
+
} else {
|
|
25300
|
+
removeOnConnect();
|
|
25301
|
+
removeOnDisconnect();
|
|
25302
|
+
ws.unsubscribeAll();
|
|
25303
|
+
}
|
|
25304
|
+
};
|
|
25305
|
+
}, [symmCoreClient, accountAddress, chainId, queryClient, setConnected]);
|
|
25306
|
+
return { isConnected };
|
|
25307
|
+
}
|
|
25287
25308
|
var STABLE_SYMBOLS = /* @__PURE__ */ new Set(["USDC", "USD", "USDT", "USDE", "USDH", "USDT0"]);
|
|
25288
25309
|
function useSymmChartSelection(input) {
|
|
25289
25310
|
const {
|