@pear-protocol/symmio-client 0.2.5 → 0.2.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.
@@ -365,8 +365,6 @@ declare function useSymmTrade(): {
365
365
 
366
366
  declare function useSymmPositions(params: {
367
367
  accountAddress?: Address;
368
- /** @deprecated Use `address` instead. */
369
- mainAddress?: Address;
370
368
  address?: Address;
371
369
  chainId?: number;
372
370
  query?: SymmQueryConfig;
@@ -378,7 +376,7 @@ declare function useSymmPositions(params: {
378
376
 
379
377
  declare function useSymmOpenOrders(params: {
380
378
  accountAddress?: Address;
381
- mainAddress?: Address;
379
+ address?: Address;
382
380
  chainId?: number;
383
381
  query?: SymmQueryConfig;
384
382
  }): {
@@ -389,7 +387,7 @@ declare function useSymmOpenOrders(params: {
389
387
 
390
388
  declare function useSymmTradeHistory(params: {
391
389
  accountAddress?: Address;
392
- mainAddress?: Address;
390
+ address?: Address;
393
391
  chainId?: number;
394
392
  query?: SymmQueryConfig;
395
393
  }): {
@@ -405,7 +403,7 @@ declare function useSymmTpsl(): {
405
403
 
406
404
  type UseSymmTpslOrdersParams = {
407
405
  accountAddress?: Address;
408
- mainAddress?: Address;
406
+ address?: Address;
409
407
  positionId?: string;
410
408
  type?: GetTpslOrdersRequest['type'];
411
409
  status?: GetTpslOrdersRequest['status'];
@@ -421,7 +419,7 @@ declare function useSymmTpslOrders(params: UseSymmTpslOrdersParams): {
421
419
 
422
420
  declare function useSymmTwap(params: {
423
421
  accountAddress?: Address;
424
- mainAddress?: Address;
422
+ address?: Address;
425
423
  chainId?: number;
426
424
  query?: SymmQueryConfig;
427
425
  }): {
@@ -443,7 +441,7 @@ declare function useSymmTriggerConfig(params: {
443
441
 
444
442
  declare function useSymmTriggerOrders(params: {
445
443
  accountAddress?: Address;
446
- mainAddress?: Address;
444
+ address?: Address;
447
445
  chainId?: number;
448
446
  status?: string;
449
447
  limit?: number;
@@ -595,7 +593,7 @@ declare function useSymmFundingPayments(params: {
595
593
 
596
594
  declare function useSymmPortfolio(params: {
597
595
  accountAddress?: Address;
598
- mainAddress?: Address;
596
+ address?: Address;
599
597
  chainId?: number;
600
598
  query?: SymmQueryConfig;
601
599
  }): {
@@ -655,8 +653,9 @@ declare function useSymmTwapOrder(params: {
655
653
  };
656
654
 
657
655
  declare function useSymmWs(params: {
656
+ symmCoreClient: SymmSDK | null;
658
657
  accountAddress?: Address;
659
- chainId?: number;
658
+ chainId: number;
660
659
  }): {
661
660
  isConnected: boolean;
662
661
  };
@@ -790,24 +789,48 @@ declare const symmKeys: {
790
789
  accountsLength: (address?: Address, chainId?: number) => readonly ["symm", "accountsLength", `0x${string}` | undefined, number | undefined];
791
790
  accountsWithPositions: (address?: Address, chainId?: number) => readonly ["symm", "accountsWithPositions", `0x${string}` | undefined, number | undefined];
792
791
  accountSummary: (address?: Address, chainId?: number) => readonly ["symm", "accountSummary", `0x${string}` | undefined, number | undefined];
793
- accountData: (address?: Address, chainId?: number) => readonly ["symm", "accountData", `0x${string}` | undefined, number | undefined];
792
+ accountData: (address?: Address, chainId?: number, upnl?: string) => readonly ["symm", "accountData", `0x${string}` | undefined, number | undefined, string | undefined];
794
793
  signature: (address?: Address, chainId?: number) => readonly ["symm", "signature", `0x${string}` | undefined, number | undefined];
795
- approval: (owner?: Address, spender?: Address, chainId?: number) => readonly ["symm", "approval", `0x${string}` | undefined, `0x${string}` | undefined, number | undefined];
794
+ approval: (owner?: Address, spender?: Address, chainId?: number, token?: Address) => readonly ["symm", "approval", `0x${string}` | undefined, `0x${string}` | undefined, number | undefined, `0x${string}` | undefined];
796
795
  balances: (address?: Address, chainId?: number) => readonly ["symm", "balances", `0x${string}` | undefined, number | undefined];
797
- positions: (address?: Address, chainId?: number) => readonly ["symm", "positions", `0x${string}` | undefined, number | undefined];
798
- openOrders: (address?: Address, chainId?: number) => readonly ["symm", "openOrders", `0x${string}` | undefined, number | undefined];
799
- tradeHistory: (address?: Address, chainId?: number) => readonly ["symm", "tradeHistory", `0x${string}` | undefined, number | undefined];
796
+ positions: (params?: {
797
+ accountAddress?: Address;
798
+ address?: Address;
799
+ chainId?: number;
800
+ }) => readonly ["symm", "positions", {
801
+ accountAddress?: Address;
802
+ address?: Address;
803
+ chainId?: number;
804
+ } | undefined];
805
+ openOrders: (params?: {
806
+ accountAddress?: Address;
807
+ address?: Address;
808
+ chainId?: number;
809
+ }) => readonly ["symm", "openOrders", {
810
+ accountAddress?: Address;
811
+ address?: Address;
812
+ chainId?: number;
813
+ } | undefined];
814
+ tradeHistory: (params?: {
815
+ accountAddress?: Address;
816
+ address?: Address;
817
+ chainId?: number;
818
+ }) => readonly ["symm", "tradeHistory", {
819
+ accountAddress?: Address;
820
+ address?: Address;
821
+ chainId?: number;
822
+ } | undefined];
800
823
  tpslOrders: (address?: Address, chainId?: number) => readonly ["symm", "tpslOrders", `0x${string}` | undefined, number | undefined];
801
824
  tpslOrdersList: (params?: {
802
825
  accountAddress?: Address;
803
- mainAddress?: Address;
826
+ address?: Address;
804
827
  positionId?: string;
805
828
  type?: string;
806
829
  status?: string;
807
830
  chainId?: number;
808
831
  }) => readonly ["symm", "tpslOrders", {
809
832
  accountAddress?: Address;
810
- mainAddress?: Address;
833
+ address?: Address;
811
834
  positionId?: string;
812
835
  type?: string;
813
836
  status?: string;
@@ -816,14 +839,14 @@ declare const symmKeys: {
816
839
  twapOrders: (address?: Address, chainId?: number) => readonly ["symm", "twapOrders", `0x${string}` | undefined, number | undefined];
817
840
  triggerOrders: (params?: {
818
841
  accountAddress?: Address;
819
- mainAddress?: Address;
842
+ address?: Address;
820
843
  status?: string;
821
844
  limit?: number;
822
845
  offset?: number;
823
846
  chainId?: number;
824
847
  }) => readonly ["symm", "triggerOrders", {
825
848
  accountAddress?: Address;
826
- mainAddress?: Address;
849
+ address?: Address;
827
850
  status?: string;
828
851
  limit?: number;
829
852
  offset?: number;
@@ -866,7 +889,15 @@ declare const symmKeys: {
866
889
  weightMode?: string;
867
890
  includeContributions?: boolean;
868
891
  } | undefined];
869
- portfolio: (address?: Address, chainId?: number) => readonly ["symm", "portfolio", `0x${string}` | undefined, number | undefined];
892
+ portfolio: (params?: {
893
+ accountAddress?: Address;
894
+ address?: Address;
895
+ chainId?: number;
896
+ }) => readonly ["symm", "portfolio", {
897
+ accountAddress?: Address;
898
+ address?: Address;
899
+ chainId?: number;
900
+ } | undefined];
870
901
  notifications: (address?: Address, chainId?: number) => readonly ["symm", "notifications", `0x${string}` | undefined, number | undefined];
871
902
  unreadCount: (address?: Address, chainId?: number) => readonly ["symm", "unreadCount", `0x${string}` | undefined, number | undefined];
872
903
  availableMargin: (address?: Address, chainId?: number) => readonly ["symm", "availableMargin", `0x${string}` | undefined, number | undefined];
@@ -365,8 +365,6 @@ declare function useSymmTrade(): {
365
365
 
366
366
  declare function useSymmPositions(params: {
367
367
  accountAddress?: Address;
368
- /** @deprecated Use `address` instead. */
369
- mainAddress?: Address;
370
368
  address?: Address;
371
369
  chainId?: number;
372
370
  query?: SymmQueryConfig;
@@ -378,7 +376,7 @@ declare function useSymmPositions(params: {
378
376
 
379
377
  declare function useSymmOpenOrders(params: {
380
378
  accountAddress?: Address;
381
- mainAddress?: Address;
379
+ address?: Address;
382
380
  chainId?: number;
383
381
  query?: SymmQueryConfig;
384
382
  }): {
@@ -389,7 +387,7 @@ declare function useSymmOpenOrders(params: {
389
387
 
390
388
  declare function useSymmTradeHistory(params: {
391
389
  accountAddress?: Address;
392
- mainAddress?: Address;
390
+ address?: Address;
393
391
  chainId?: number;
394
392
  query?: SymmQueryConfig;
395
393
  }): {
@@ -405,7 +403,7 @@ declare function useSymmTpsl(): {
405
403
 
406
404
  type UseSymmTpslOrdersParams = {
407
405
  accountAddress?: Address;
408
- mainAddress?: Address;
406
+ address?: Address;
409
407
  positionId?: string;
410
408
  type?: GetTpslOrdersRequest['type'];
411
409
  status?: GetTpslOrdersRequest['status'];
@@ -421,7 +419,7 @@ declare function useSymmTpslOrders(params: UseSymmTpslOrdersParams): {
421
419
 
422
420
  declare function useSymmTwap(params: {
423
421
  accountAddress?: Address;
424
- mainAddress?: Address;
422
+ address?: Address;
425
423
  chainId?: number;
426
424
  query?: SymmQueryConfig;
427
425
  }): {
@@ -443,7 +441,7 @@ declare function useSymmTriggerConfig(params: {
443
441
 
444
442
  declare function useSymmTriggerOrders(params: {
445
443
  accountAddress?: Address;
446
- mainAddress?: Address;
444
+ address?: Address;
447
445
  chainId?: number;
448
446
  status?: string;
449
447
  limit?: number;
@@ -595,7 +593,7 @@ declare function useSymmFundingPayments(params: {
595
593
 
596
594
  declare function useSymmPortfolio(params: {
597
595
  accountAddress?: Address;
598
- mainAddress?: Address;
596
+ address?: Address;
599
597
  chainId?: number;
600
598
  query?: SymmQueryConfig;
601
599
  }): {
@@ -655,8 +653,9 @@ declare function useSymmTwapOrder(params: {
655
653
  };
656
654
 
657
655
  declare function useSymmWs(params: {
656
+ symmCoreClient: SymmSDK | null;
658
657
  accountAddress?: Address;
659
- chainId?: number;
658
+ chainId: number;
660
659
  }): {
661
660
  isConnected: boolean;
662
661
  };
@@ -790,24 +789,48 @@ declare const symmKeys: {
790
789
  accountsLength: (address?: Address, chainId?: number) => readonly ["symm", "accountsLength", `0x${string}` | undefined, number | undefined];
791
790
  accountsWithPositions: (address?: Address, chainId?: number) => readonly ["symm", "accountsWithPositions", `0x${string}` | undefined, number | undefined];
792
791
  accountSummary: (address?: Address, chainId?: number) => readonly ["symm", "accountSummary", `0x${string}` | undefined, number | undefined];
793
- accountData: (address?: Address, chainId?: number) => readonly ["symm", "accountData", `0x${string}` | undefined, number | undefined];
792
+ accountData: (address?: Address, chainId?: number, upnl?: string) => readonly ["symm", "accountData", `0x${string}` | undefined, number | undefined, string | undefined];
794
793
  signature: (address?: Address, chainId?: number) => readonly ["symm", "signature", `0x${string}` | undefined, number | undefined];
795
- approval: (owner?: Address, spender?: Address, chainId?: number) => readonly ["symm", "approval", `0x${string}` | undefined, `0x${string}` | undefined, number | undefined];
794
+ approval: (owner?: Address, spender?: Address, chainId?: number, token?: Address) => readonly ["symm", "approval", `0x${string}` | undefined, `0x${string}` | undefined, number | undefined, `0x${string}` | undefined];
796
795
  balances: (address?: Address, chainId?: number) => readonly ["symm", "balances", `0x${string}` | undefined, number | undefined];
797
- positions: (address?: Address, chainId?: number) => readonly ["symm", "positions", `0x${string}` | undefined, number | undefined];
798
- openOrders: (address?: Address, chainId?: number) => readonly ["symm", "openOrders", `0x${string}` | undefined, number | undefined];
799
- tradeHistory: (address?: Address, chainId?: number) => readonly ["symm", "tradeHistory", `0x${string}` | undefined, number | undefined];
796
+ positions: (params?: {
797
+ accountAddress?: Address;
798
+ address?: Address;
799
+ chainId?: number;
800
+ }) => readonly ["symm", "positions", {
801
+ accountAddress?: Address;
802
+ address?: Address;
803
+ chainId?: number;
804
+ } | undefined];
805
+ openOrders: (params?: {
806
+ accountAddress?: Address;
807
+ address?: Address;
808
+ chainId?: number;
809
+ }) => readonly ["symm", "openOrders", {
810
+ accountAddress?: Address;
811
+ address?: Address;
812
+ chainId?: number;
813
+ } | undefined];
814
+ tradeHistory: (params?: {
815
+ accountAddress?: Address;
816
+ address?: Address;
817
+ chainId?: number;
818
+ }) => readonly ["symm", "tradeHistory", {
819
+ accountAddress?: Address;
820
+ address?: Address;
821
+ chainId?: number;
822
+ } | undefined];
800
823
  tpslOrders: (address?: Address, chainId?: number) => readonly ["symm", "tpslOrders", `0x${string}` | undefined, number | undefined];
801
824
  tpslOrdersList: (params?: {
802
825
  accountAddress?: Address;
803
- mainAddress?: Address;
826
+ address?: Address;
804
827
  positionId?: string;
805
828
  type?: string;
806
829
  status?: string;
807
830
  chainId?: number;
808
831
  }) => readonly ["symm", "tpslOrders", {
809
832
  accountAddress?: Address;
810
- mainAddress?: Address;
833
+ address?: Address;
811
834
  positionId?: string;
812
835
  type?: string;
813
836
  status?: string;
@@ -816,14 +839,14 @@ declare const symmKeys: {
816
839
  twapOrders: (address?: Address, chainId?: number) => readonly ["symm", "twapOrders", `0x${string}` | undefined, number | undefined];
817
840
  triggerOrders: (params?: {
818
841
  accountAddress?: Address;
819
- mainAddress?: Address;
842
+ address?: Address;
820
843
  status?: string;
821
844
  limit?: number;
822
845
  offset?: number;
823
846
  chainId?: number;
824
847
  }) => readonly ["symm", "triggerOrders", {
825
848
  accountAddress?: Address;
826
- mainAddress?: Address;
849
+ address?: Address;
827
850
  status?: string;
828
851
  limit?: number;
829
852
  offset?: number;
@@ -866,7 +889,15 @@ declare const symmKeys: {
866
889
  weightMode?: string;
867
890
  includeContributions?: boolean;
868
891
  } | undefined];
869
- portfolio: (address?: Address, chainId?: number) => readonly ["symm", "portfolio", `0x${string}` | undefined, number | undefined];
892
+ portfolio: (params?: {
893
+ accountAddress?: Address;
894
+ address?: Address;
895
+ chainId?: number;
896
+ }) => readonly ["symm", "portfolio", {
897
+ accountAddress?: Address;
898
+ address?: Address;
899
+ chainId?: number;
900
+ } | undefined];
870
901
  notifications: (address?: Address, chainId?: number) => readonly ["symm", "notifications", `0x${string}` | undefined, number | undefined];
871
902
  unreadCount: (address?: Address, chainId?: number) => readonly ["symm", "unreadCount", `0x${string}` | undefined, number | undefined];
872
903
  availableMargin: (address?: Address, chainId?: number) => readonly ["symm", "availableMargin", `0x${string}` | undefined, number | undefined];
@@ -24,13 +24,13 @@ var symmKeys = {
24
24
  accountsLength: (address, chainId) => ["symm", "accountsLength", address, chainId],
25
25
  accountsWithPositions: (address, chainId) => ["symm", "accountsWithPositions", address, chainId],
26
26
  accountSummary: (address, chainId) => ["symm", "accountSummary", address, chainId],
27
- accountData: (address, chainId) => ["symm", "accountData", address, chainId],
27
+ accountData: (address, chainId, upnl) => ["symm", "accountData", address, chainId, upnl],
28
28
  signature: (address, chainId) => ["symm", "signature", address, chainId],
29
- approval: (owner, spender, chainId) => ["symm", "approval", owner, spender, chainId],
29
+ approval: (owner, spender, chainId, token) => ["symm", "approval", owner, spender, chainId, token],
30
30
  balances: (address, chainId) => ["symm", "balances", address, chainId],
31
- positions: (address, chainId) => ["symm", "positions", address, chainId],
32
- openOrders: (address, chainId) => ["symm", "openOrders", address, chainId],
33
- tradeHistory: (address, chainId) => ["symm", "tradeHistory", address, chainId],
31
+ positions: (params) => ["symm", "positions", params],
32
+ openOrders: (params) => ["symm", "openOrders", params],
33
+ tradeHistory: (params) => ["symm", "tradeHistory", params],
34
34
  tpslOrders: (address, chainId) => ["symm", "tpslOrders", address, chainId],
35
35
  tpslOrdersList: (params) => ["symm", "tpslOrders", params],
36
36
  twapOrders: (address, chainId) => ["symm", "twapOrders", address, chainId],
@@ -44,7 +44,7 @@ var symmKeys = {
44
44
  fundingRates: (chainId) => ["symm", "fundingRates", chainId],
45
45
  fundingPayments: (params) => ["symm", "fundingPayments", params],
46
46
  fundingHistory: (params) => ["symm", "fundingHistory", params],
47
- portfolio: (address, chainId) => ["symm", "portfolio", address, chainId],
47
+ portfolio: (params) => ["symm", "portfolio", params],
48
48
  notifications: (address, chainId) => ["symm", "notifications", address, chainId],
49
49
  unreadCount: (address, chainId) => ["symm", "unreadCount", address, chainId],
50
50
  availableMargin: (address, chainId) => ["symm", "availableMargin", address, chainId],
@@ -60,10 +60,8 @@ function asUnsubscribeFn(value) {
60
60
  return typeof value === "function" ? value : null;
61
61
  }
62
62
  function useSymmWs(params) {
63
- const { symmCoreClient, chainId: ctxChainId } = useSymmContext();
64
63
  const queryClient = reactQuery.useQueryClient();
65
- const { accountAddress } = params;
66
- const chainId = params.chainId ?? ctxChainId;
64
+ const { symmCoreClient, accountAddress, chainId } = params;
67
65
  const [isConnected, setIsConnected] = react.useState(false);
68
66
  react.useEffect(() => {
69
67
  if (!symmCoreClient || !accountAddress) {
@@ -78,19 +76,19 @@ function useSymmWs(params) {
78
76
  unsubscribers.push(removeOnConnect, removeOnDisconnect);
79
77
  const positionsUnsub = asUnsubscribeFn(ws.subscribeToPositions(addr, chainId, () => {
80
78
  queryClient.invalidateQueries({
81
- queryKey: symmKeys.positions(accountAddress, chainId)
79
+ queryKey: ["symm", "positions"]
82
80
  });
83
81
  }));
84
82
  if (positionsUnsub) unsubscribers.push(positionsUnsub);
85
83
  const openOrdersUnsub = asUnsubscribeFn(ws.subscribeToOpenOrders(addr, chainId, () => {
86
84
  queryClient.invalidateQueries({
87
- queryKey: symmKeys.openOrders(accountAddress, chainId)
85
+ queryKey: ["symm", "openOrders"]
88
86
  });
89
87
  }));
90
88
  if (openOrdersUnsub) unsubscribers.push(openOrdersUnsub);
91
89
  const tradesUnsub = asUnsubscribeFn(ws.subscribeToTrades(addr, chainId, () => {
92
90
  queryClient.invalidateQueries({
93
- queryKey: symmKeys.tradeHistory(accountAddress, chainId)
91
+ queryKey: ["symm", "tradeHistory"]
94
92
  });
95
93
  }));
96
94
  if (tradesUnsub) unsubscribers.push(tradesUnsub);
@@ -129,10 +127,10 @@ function useSymmWs(params) {
129
127
  if (triggerOrdersUnsub) unsubscribers.push(triggerOrdersUnsub);
130
128
  const executionsUnsub = asUnsubscribeFn(ws.subscribeToExecutions(addr, chainId, () => {
131
129
  queryClient.invalidateQueries({
132
- queryKey: symmKeys.positions(accountAddress, chainId)
130
+ queryKey: ["symm", "positions"]
133
131
  });
134
132
  queryClient.invalidateQueries({
135
- queryKey: symmKeys.portfolio(accountAddress, chainId)
133
+ queryKey: ["symm", "portfolio"]
136
134
  });
137
135
  }));
138
136
  if (executionsUnsub) unsubscribers.push(executionsUnsub);
@@ -167,7 +165,7 @@ function SymmProvider({
167
165
  });
168
166
  }, [chainId, symmCoreConfig.apiUrl, symmCoreConfig.wsUrl]);
169
167
  const resolvedAuthToken = authToken ?? accessToken;
170
- useSymmWs({ chainId });
168
+ useSymmWs({ symmCoreClient, accountAddress: address, chainId });
171
169
  const value = react.useMemo(
172
170
  () => ({
173
171
  symmCoreClient,
@@ -1398,7 +1396,7 @@ function useSymmApproval(params) {
1398
1396
  const internalEnabled = !!publicClient && !!owner && !!resolvedSpender && !!resolvedToken;
1399
1397
  const approvalQuery = reactQuery.useQuery({
1400
1398
  ...params.query,
1401
- queryKey: symmKeys.approval(owner, resolvedSpender, chainId),
1399
+ queryKey: symmKeys.approval(owner, resolvedSpender, chainId, resolvedToken),
1402
1400
  queryFn: async () => {
1403
1401
  const [allowanceVal, balanceVal] = await Promise.all([
1404
1402
  getAllowance(publicClient, resolvedToken, owner, resolvedSpender),
@@ -1416,7 +1414,7 @@ function useSymmApproval(params) {
1416
1414
  },
1417
1415
  onSuccess: () => {
1418
1416
  queryClient.invalidateQueries({
1419
- queryKey: symmKeys.approval(owner, resolvedSpender, chainId)
1417
+ queryKey: symmKeys.approval(owner, resolvedSpender, chainId, resolvedToken)
1420
1418
  });
1421
1419
  }
1422
1420
  });
@@ -24551,7 +24549,7 @@ function useSymmAccountData(params) {
24551
24549
  const internalEnabled = !!symmCoreClient && !!address;
24552
24550
  const query = reactQuery.useQuery({
24553
24551
  ...params.query,
24554
- queryKey: symmKeys.accountData(address, chainId),
24552
+ queryKey: symmKeys.accountData(address, chainId, upnl),
24555
24553
  queryFn: () => symmCoreClient.accounts.getData({
24556
24554
  address,
24557
24555
  chainId,
@@ -24641,13 +24639,17 @@ function useSymmTrade() {
24641
24639
  }
24642
24640
  function useSymmPositions(params) {
24643
24641
  const { symmCoreClient, chainId: ctxChainId } = useSymmContext();
24644
- const { accountAddress, mainAddress, address } = params;
24645
- const resolvedAddress = address ?? mainAddress;
24642
+ const { accountAddress, address } = params;
24643
+ const resolvedAddress = accountAddress ? void 0 : address;
24646
24644
  const chainId = params.chainId ?? ctxChainId;
24647
24645
  const internalEnabled = !!symmCoreClient && !!(accountAddress || resolvedAddress);
24648
24646
  const query = reactQuery.useQuery({
24649
24647
  ...params.query,
24650
- queryKey: symmKeys.positions(accountAddress ?? resolvedAddress, chainId),
24648
+ queryKey: symmKeys.positions({
24649
+ accountAddress,
24650
+ address: resolvedAddress,
24651
+ chainId
24652
+ }),
24651
24653
  queryFn: () => symmCoreClient.positions.getOpen({
24652
24654
  accountAddress,
24653
24655
  address: resolvedAddress,
@@ -24663,15 +24665,19 @@ function useSymmPositions(params) {
24663
24665
  }
24664
24666
  function useSymmOpenOrders(params) {
24665
24667
  const { symmCoreClient, chainId: ctxChainId } = useSymmContext();
24666
- const { accountAddress, mainAddress } = params;
24668
+ const { accountAddress, address } = params;
24669
+ const resolvedAddress = accountAddress ? void 0 : address;
24667
24670
  const chainId = params.chainId ?? ctxChainId;
24668
- const internalEnabled = !!symmCoreClient && !!(accountAddress || mainAddress);
24671
+ const internalEnabled = !!symmCoreClient && !!(accountAddress || resolvedAddress);
24669
24672
  const query = reactQuery.useQuery({
24670
24673
  ...params.query,
24671
- queryKey: symmKeys.openOrders(accountAddress ?? mainAddress, chainId),
24674
+ queryKey: symmKeys.openOrders({
24675
+ accountAddress,
24676
+ address: resolvedAddress,
24677
+ chainId
24678
+ }),
24672
24679
  queryFn: () => symmCoreClient.orders.list({
24673
- address: accountAddress,
24674
- mainAddress,
24680
+ address: accountAddress ?? resolvedAddress,
24675
24681
  chainId
24676
24682
  }),
24677
24683
  enabled: internalEnabled && (params.query?.enabled ?? true)
@@ -24684,17 +24690,25 @@ function useSymmOpenOrders(params) {
24684
24690
  }
24685
24691
  function useSymmTradeHistory(params) {
24686
24692
  const { symmCoreClient, chainId: ctxChainId } = useSymmContext();
24687
- const { accountAddress, mainAddress } = params;
24693
+ const { accountAddress, address } = params;
24694
+ const resolvedAddress = accountAddress ? void 0 : address;
24688
24695
  const chainId = params.chainId ?? ctxChainId;
24689
- const internalEnabled = !!symmCoreClient && !!(accountAddress || mainAddress);
24696
+ const internalEnabled = !!symmCoreClient && !!(accountAddress || resolvedAddress);
24690
24697
  const query = reactQuery.useQuery({
24691
24698
  ...params.query,
24692
- queryKey: symmKeys.tradeHistory(accountAddress ?? mainAddress, chainId),
24693
- queryFn: () => symmCoreClient.positions.getTradeHistory({
24699
+ queryKey: symmKeys.tradeHistory({
24694
24700
  accountAddress,
24695
- mainAddress,
24701
+ address: resolvedAddress,
24696
24702
  chainId
24697
24703
  }),
24704
+ queryFn: () => {
24705
+ const request = {
24706
+ accountAddress,
24707
+ address: resolvedAddress,
24708
+ chainId
24709
+ };
24710
+ return symmCoreClient.positions.getTradeHistory(request);
24711
+ },
24698
24712
  enabled: internalEnabled && (params.query?.enabled ?? true)
24699
24713
  });
24700
24714
  return {
@@ -24730,12 +24744,12 @@ function useSymmTpsl() {
24730
24744
  }
24731
24745
  function useSymmTpslOrders(params) {
24732
24746
  const { symmCoreClient, chainId: ctxChainId } = useSymmContext();
24733
- const { accountAddress, mainAddress, positionId, type, status } = params;
24747
+ const { accountAddress, address, positionId, type, status } = params;
24748
+ const resolvedAddress = accountAddress ? void 0 : address;
24734
24749
  const chainId = params.chainId ?? ctxChainId;
24735
- const internalEnabled = !!symmCoreClient && !!(accountAddress || mainAddress || positionId);
24750
+ const internalEnabled = !!symmCoreClient && !!(accountAddress || resolvedAddress || positionId);
24736
24751
  const request = {
24737
- address: accountAddress,
24738
- mainAddress,
24752
+ address: accountAddress ?? resolvedAddress,
24739
24753
  positionId,
24740
24754
  type,
24741
24755
  status,
@@ -24745,7 +24759,7 @@ function useSymmTpslOrders(params) {
24745
24759
  ...params.query,
24746
24760
  queryKey: symmKeys.tpslOrdersList({
24747
24761
  accountAddress,
24748
- mainAddress,
24762
+ address: resolvedAddress,
24749
24763
  positionId,
24750
24764
  type,
24751
24765
  status,
@@ -24764,15 +24778,15 @@ function useSymmTpslOrders(params) {
24764
24778
  function useSymmTwap(params) {
24765
24779
  const { symmCoreClient, chainId: ctxChainId } = useSymmContext();
24766
24780
  const queryClient = reactQuery.useQueryClient();
24767
- const { accountAddress, mainAddress } = params;
24781
+ const { accountAddress, address } = params;
24782
+ const resolvedAddress = accountAddress ? void 0 : address;
24768
24783
  const chainId = params.chainId ?? ctxChainId;
24769
- const internalEnabled = !!symmCoreClient && !!(accountAddress || mainAddress);
24784
+ const internalEnabled = !!symmCoreClient && !!(accountAddress || resolvedAddress);
24770
24785
  const query = reactQuery.useQuery({
24771
24786
  ...params.query,
24772
- queryKey: symmKeys.twapOrders(accountAddress ?? mainAddress, chainId),
24787
+ queryKey: symmKeys.twapOrders(accountAddress ?? resolvedAddress, chainId),
24773
24788
  queryFn: () => symmCoreClient.orders.getTwapOrders({
24774
- address: accountAddress,
24775
- mainAddress,
24789
+ address: accountAddress ?? resolvedAddress,
24776
24790
  chainId
24777
24791
  }),
24778
24792
  enabled: internalEnabled && (params.query?.enabled ?? true)
@@ -24841,12 +24855,12 @@ function useSymmTriggerConfig(params) {
24841
24855
  }
24842
24856
  function useSymmTriggerOrders(params) {
24843
24857
  const { symmCoreClient, chainId: ctxChainId } = useSymmContext();
24844
- const { accountAddress, mainAddress, status, limit, offset } = params;
24858
+ const { accountAddress, address, status, limit, offset } = params;
24859
+ const resolvedAddress = accountAddress ? void 0 : address;
24845
24860
  const chainId = params.chainId ?? ctxChainId;
24846
- const internalEnabled = !!symmCoreClient && !!(accountAddress || mainAddress);
24861
+ const internalEnabled = !!symmCoreClient && !!(accountAddress || resolvedAddress);
24847
24862
  const request = {
24848
- address: accountAddress,
24849
- mainAddress,
24863
+ address: accountAddress ?? resolvedAddress,
24850
24864
  chainId,
24851
24865
  status,
24852
24866
  limit,
@@ -24856,7 +24870,7 @@ function useSymmTriggerOrders(params) {
24856
24870
  ...params.query,
24857
24871
  queryKey: symmKeys.triggerOrders({
24858
24872
  accountAddress,
24859
- mainAddress,
24873
+ address: resolvedAddress,
24860
24874
  chainId,
24861
24875
  status,
24862
24876
  limit,
@@ -25073,17 +25087,25 @@ function useSymmFundingPayments(params) {
25073
25087
  }
25074
25088
  function useSymmPortfolio(params) {
25075
25089
  const { symmCoreClient, chainId: ctxChainId } = useSymmContext();
25076
- const { accountAddress, mainAddress } = params;
25090
+ const { accountAddress, address } = params;
25091
+ const resolvedAddress = accountAddress ? void 0 : address;
25077
25092
  const chainId = params.chainId ?? ctxChainId;
25078
- const internalEnabled = !!symmCoreClient && !!(accountAddress || mainAddress);
25093
+ const internalEnabled = !!symmCoreClient && !!(accountAddress || resolvedAddress);
25079
25094
  const query = reactQuery.useQuery({
25080
25095
  ...params.query,
25081
- queryKey: symmKeys.portfolio(accountAddress ?? mainAddress, chainId),
25082
- queryFn: () => symmCoreClient.portfolio.getMetrics({
25096
+ queryKey: symmKeys.portfolio({
25083
25097
  accountAddress,
25084
- mainAddress,
25098
+ address: resolvedAddress,
25085
25099
  chainId
25086
25100
  }),
25101
+ queryFn: () => {
25102
+ const request = {
25103
+ accountAddress,
25104
+ address: resolvedAddress,
25105
+ chainId
25106
+ };
25107
+ return symmCoreClient.portfolio.getMetrics(request);
25108
+ },
25087
25109
  enabled: internalEnabled && (params.query?.enabled ?? true)
25088
25110
  });
25089
25111
  return {