@pear-protocol/symmio-client 0.1.6 → 0.1.8

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.
@@ -445,11 +445,39 @@ declare function useSymmAuth(): {
445
445
  refresh: (accountAddress?: viem.Address) => Promise<string | null>;
446
446
  };
447
447
 
448
+ /**
449
+ * Consumer-facing query configuration.
450
+ * Allows overriding common TanStack Query options without
451
+ * affecting the hook's internal queryKey/queryFn/select.
452
+ */
453
+ type SymmQueryConfig = {
454
+ /** Whether the query should execute. ANDed with the hook's internal conditions. */
455
+ enabled?: boolean;
456
+ /** Time in ms that data is considered fresh. Overrides the hook's default. */
457
+ staleTime?: number;
458
+ /** Time in ms that unused/inactive cache data remains in memory. */
459
+ gcTime?: number;
460
+ /** Polling interval in ms, or false to disable. */
461
+ refetchInterval?: number | false;
462
+ /** Refetch when the window regains focus. */
463
+ refetchOnWindowFocus?: boolean | 'always';
464
+ /** Refetch when the component mounts. */
465
+ refetchOnMount?: boolean | 'always';
466
+ /** Refetch when the network reconnects. */
467
+ refetchOnReconnect?: boolean | 'always';
468
+ /** Number of retry attempts on failure, or false to disable. */
469
+ retry?: boolean | number;
470
+ /** Delay between retries in ms, or a function of attempt index. */
471
+ retryDelay?: number | ((attemptIndex: number) => number);
472
+ };
473
+
448
474
  type UseSymmDelegationParams = {
449
475
  accountAddress?: Address;
450
476
  target?: Address;
451
477
  selectors?: readonly Hex[];
478
+ /** @deprecated Use `query.enabled` instead. */
452
479
  enabled?: boolean;
480
+ query?: SymmQueryConfig;
453
481
  };
454
482
  type SymmDelegationState = {
455
483
  hasAccess: boolean;
@@ -494,7 +522,9 @@ declare function useSymmInstantTrade(params?: {
494
522
  execute: _tanstack_react_query.UseMutationResult<unknown, Error, SymmInstantTradeRequest, unknown>;
495
523
  };
496
524
 
497
- declare function useSymmAccounts(userAddress?: Address): {
525
+ declare function useSymmAccounts(userAddress?: Address, options?: {
526
+ query?: SymmQueryConfig;
527
+ }): {
498
528
  accounts: Account[];
499
529
  count: number;
500
530
  isLoading: boolean;
@@ -514,6 +544,7 @@ declare function useSymmApproval(params: {
514
544
  amount: bigint;
515
545
  spender?: Address;
516
546
  collateralToken?: Address;
547
+ query?: SymmQueryConfig;
517
548
  }): {
518
549
  approvalState: ApprovalState | null;
519
550
  allowance: bigint;
@@ -555,7 +586,9 @@ declare function useSymmCollateral(): {
555
586
  }, unknown>;
556
587
  };
557
588
 
558
- declare function useSymmSignature(userAddress?: Address): {
589
+ declare function useSymmSignature(userAddress?: Address, options?: {
590
+ query?: SymmQueryConfig;
591
+ }): {
559
592
  hasSigned: boolean;
560
593
  isLoading: boolean;
561
594
  signTerms: _tanstack_react_query.UseMutationResult<void, Error, void, unknown>;
@@ -564,6 +597,7 @@ declare function useSymmSignature(userAddress?: Address): {
564
597
  declare function useSymmAvailableMargin(params: {
565
598
  accountAddress?: Address;
566
599
  upnl?: bigint;
600
+ query?: SymmQueryConfig;
567
601
  }): {
568
602
  availableForOrder: bigint | null;
569
603
  stats: {
@@ -609,6 +643,7 @@ declare function useSymmBalances(params: {
609
643
  userAddress?: Address;
610
644
  chainId?: number;
611
645
  multiAccountAddress?: Address;
646
+ query?: SymmQueryConfig;
612
647
  }): {
613
648
  balanceInfo: node_modules__pear_protocol_symm_core_dist_types.BalanceInfoResponse | null;
614
649
  isLoading: boolean;
@@ -632,6 +667,7 @@ declare function useSymmPositions(params: {
632
667
  accountAddress?: Address;
633
668
  mainAddress?: Address;
634
669
  chainId?: number;
670
+ query?: SymmQueryConfig;
635
671
  }): {
636
672
  positions: _pear_protocol_symm_core.OpenPositionDto[];
637
673
  isLoading: boolean;
@@ -642,6 +678,7 @@ declare function useSymmOpenOrders(params: {
642
678
  accountAddress?: Address;
643
679
  mainAddress?: Address;
644
680
  chainId?: number;
681
+ query?: SymmQueryConfig;
645
682
  }): {
646
683
  orders: _pear_protocol_symm_core.UnifiedOrderItem[];
647
684
  isLoading: boolean;
@@ -652,6 +689,7 @@ declare function useSymmTradeHistory(params: {
652
689
  accountAddress?: Address;
653
690
  mainAddress?: Address;
654
691
  chainId?: number;
692
+ query?: SymmQueryConfig;
655
693
  }): {
656
694
  trades: _pear_protocol_symm_shared.ApiResponse<unknown> | null;
657
695
  isLoading: boolean;
@@ -667,6 +705,7 @@ declare function useSymmTwap(params: {
667
705
  accountAddress?: Address;
668
706
  mainAddress?: Address;
669
707
  chainId?: number;
708
+ query?: SymmQueryConfig;
670
709
  }): {
671
710
  twapOrders: node_modules__pear_protocol_symm_core_dist_types.TwapOrder[];
672
711
  isLoading: boolean;
@@ -676,6 +715,7 @@ declare function useSymmTwap(params: {
676
715
  declare function useSymmMarkets(params?: {
677
716
  chainId?: number;
678
717
  searchText?: string;
718
+ query?: SymmQueryConfig;
679
719
  }): {
680
720
  markets: _pear_protocol_symm_core.MarketGroupItem[];
681
721
  isLoading: boolean;
@@ -683,7 +723,9 @@ declare function useSymmMarkets(params?: {
683
723
  };
684
724
 
685
725
  type UseSymmHedgerMarketsParams = GetSymmHedgerMarketsRequest & {
726
+ /** @deprecated Use `query.enabled` instead. */
686
727
  enabled?: boolean;
728
+ query?: SymmQueryConfig;
687
729
  };
688
730
  declare function useSymmHedgerMarkets(params?: UseSymmHedgerMarketsParams): {
689
731
  data: _pear_protocol_symm_core.SymmHedgerMarketsResult | null;
@@ -703,6 +745,7 @@ declare function useSymmHedgerMarkets(params?: UseSymmHedgerMarketsParams): {
703
745
 
704
746
  declare function useSymmFunding(params?: {
705
747
  chainId?: number;
748
+ query?: SymmQueryConfig;
706
749
  }): {
707
750
  rates: node_modules__pear_protocol_symm_core_dist_types.FundingRate[];
708
751
  isLoading: boolean;
@@ -712,6 +755,7 @@ declare function useSymmPortfolio(params: {
712
755
  accountAddress?: Address;
713
756
  mainAddress?: Address;
714
757
  chainId?: number;
758
+ query?: SymmQueryConfig;
715
759
  }): {
716
760
  metrics: _pear_protocol_symm_core.PortfolioResponse | null;
717
761
  isLoading: boolean;
@@ -721,6 +765,7 @@ declare function useSymmPortfolio(params: {
721
765
  declare function useSymmNotifications(params: {
722
766
  userAddress?: Address;
723
767
  chainId?: number;
768
+ query?: SymmQueryConfig;
724
769
  }): {
725
770
  notifications: _pear_protocol_symm_core.Notification[];
726
771
  unreadCount: number;
@@ -792,7 +837,10 @@ interface UseSymmTokenSelectionMetadataReturn {
792
837
  * Fetches Binance market data for selected SYMM chart tokens and derives
793
838
  * chart header metrics (price ratio, weighted ratio, etc.).
794
839
  */
795
- declare function useSymmTokenSelectionMetadata(selection: SymmChartSelection): UseSymmTokenSelectionMetadataReturn;
840
+ declare function useSymmTokenSelectionMetadata(selection: SymmChartSelection, options?: {
841
+ enabled?: boolean;
842
+ query?: SymmQueryConfig;
843
+ }): UseSymmTokenSelectionMetadataReturn;
796
844
 
797
845
  /**
798
846
  * Candle interval type matching the chart system.
@@ -855,7 +903,7 @@ interface SymmPerformanceOverlay {
855
903
  */
856
904
  declare function useSymmPerformanceOverlays(selection: SymmChartSelection): {
857
905
  overlays: SymmPerformanceOverlay[];
858
- generateOverlaySymbols: () => string[];
906
+ overlaySymbols: string[];
859
907
  };
860
908
 
861
909
  declare const symmKeys: {
@@ -878,8 +926,9 @@ declare const symmKeys: {
878
926
  unreadCount: (address?: Address, chainId?: number) => readonly ["symm", "unreadCount", `0x${string}` | undefined, number | undefined];
879
927
  availableMargin: (address?: Address, chainId?: number) => readonly ["symm", "availableMargin", `0x${string}` | undefined, number | undefined];
880
928
  delegation: (account?: Address, target?: Address, selectors?: readonly Hex[], chainId?: number) => readonly ["symm", "delegation", `0x${string}` | undefined, `0x${string}` | undefined, readonly `0x${string}`[] | undefined, number | undefined];
929
+ chartMetadata: (symbolsKey: string, positionKey: string) => readonly ["symm", "chartMetadata", string, string];
881
930
  };
882
931
 
883
932
  declare function getSymmErrorMessage(error: unknown): string;
884
933
 
885
- export { type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmDelegationState, type SymmInstantTradeActionArgs, type SymmInstantTradeRequest, type SymmPerformanceOverlay, SymmProvider, type SymmProviderProps, type SymmTokenMetadata, type UseSymmChartCandlesReturn, type UseSymmDelegationParams, type UseSymmHedgerMarketsParams, type UseSymmTokenSelectionMetadataReturn, getSymmErrorMessage, symmKeys, useSymmAccounts, useSymmApproval, useSymmAuth, useSymmAvailableMargin, useSymmBalances, useSymmChartCandles, useSymmChartSelection, useSymmCollateral, useSymmContext, useSymmCoreClient, useSymmDelegation, useSymmDeposit, useSymmFunding, useSymmHedgerMarkets, useSymmInstantTrade, useSymmMarkets, useSymmNotifications, useSymmOpenOrders, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmSignature, useSymmTokenSelectionMetadata, useSymmTpsl, useSymmTrade, useSymmTradeHistory, useSymmTwap, useSymmWithdraw, useSymmWs, useSymmioClient };
934
+ export { type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmDelegationState, type SymmInstantTradeActionArgs, type SymmInstantTradeRequest, type SymmPerformanceOverlay, SymmProvider, type SymmProviderProps, type SymmQueryConfig, type SymmTokenMetadata, type UseSymmChartCandlesReturn, type UseSymmDelegationParams, type UseSymmHedgerMarketsParams, type UseSymmTokenSelectionMetadataReturn, getSymmErrorMessage, symmKeys, useSymmAccounts, useSymmApproval, useSymmAuth, useSymmAvailableMargin, useSymmBalances, useSymmChartCandles, useSymmChartSelection, useSymmCollateral, useSymmContext, useSymmCoreClient, useSymmDelegation, useSymmDeposit, useSymmFunding, useSymmHedgerMarkets, useSymmInstantTrade, useSymmMarkets, useSymmNotifications, useSymmOpenOrders, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmSignature, useSymmTokenSelectionMetadata, useSymmTpsl, useSymmTrade, useSymmTradeHistory, useSymmTwap, useSymmWithdraw, useSymmWs, useSymmioClient };
@@ -445,11 +445,39 @@ declare function useSymmAuth(): {
445
445
  refresh: (accountAddress?: viem.Address) => Promise<string | null>;
446
446
  };
447
447
 
448
+ /**
449
+ * Consumer-facing query configuration.
450
+ * Allows overriding common TanStack Query options without
451
+ * affecting the hook's internal queryKey/queryFn/select.
452
+ */
453
+ type SymmQueryConfig = {
454
+ /** Whether the query should execute. ANDed with the hook's internal conditions. */
455
+ enabled?: boolean;
456
+ /** Time in ms that data is considered fresh. Overrides the hook's default. */
457
+ staleTime?: number;
458
+ /** Time in ms that unused/inactive cache data remains in memory. */
459
+ gcTime?: number;
460
+ /** Polling interval in ms, or false to disable. */
461
+ refetchInterval?: number | false;
462
+ /** Refetch when the window regains focus. */
463
+ refetchOnWindowFocus?: boolean | 'always';
464
+ /** Refetch when the component mounts. */
465
+ refetchOnMount?: boolean | 'always';
466
+ /** Refetch when the network reconnects. */
467
+ refetchOnReconnect?: boolean | 'always';
468
+ /** Number of retry attempts on failure, or false to disable. */
469
+ retry?: boolean | number;
470
+ /** Delay between retries in ms, or a function of attempt index. */
471
+ retryDelay?: number | ((attemptIndex: number) => number);
472
+ };
473
+
448
474
  type UseSymmDelegationParams = {
449
475
  accountAddress?: Address;
450
476
  target?: Address;
451
477
  selectors?: readonly Hex[];
478
+ /** @deprecated Use `query.enabled` instead. */
452
479
  enabled?: boolean;
480
+ query?: SymmQueryConfig;
453
481
  };
454
482
  type SymmDelegationState = {
455
483
  hasAccess: boolean;
@@ -494,7 +522,9 @@ declare function useSymmInstantTrade(params?: {
494
522
  execute: _tanstack_react_query.UseMutationResult<unknown, Error, SymmInstantTradeRequest, unknown>;
495
523
  };
496
524
 
497
- declare function useSymmAccounts(userAddress?: Address): {
525
+ declare function useSymmAccounts(userAddress?: Address, options?: {
526
+ query?: SymmQueryConfig;
527
+ }): {
498
528
  accounts: Account[];
499
529
  count: number;
500
530
  isLoading: boolean;
@@ -514,6 +544,7 @@ declare function useSymmApproval(params: {
514
544
  amount: bigint;
515
545
  spender?: Address;
516
546
  collateralToken?: Address;
547
+ query?: SymmQueryConfig;
517
548
  }): {
518
549
  approvalState: ApprovalState | null;
519
550
  allowance: bigint;
@@ -555,7 +586,9 @@ declare function useSymmCollateral(): {
555
586
  }, unknown>;
556
587
  };
557
588
 
558
- declare function useSymmSignature(userAddress?: Address): {
589
+ declare function useSymmSignature(userAddress?: Address, options?: {
590
+ query?: SymmQueryConfig;
591
+ }): {
559
592
  hasSigned: boolean;
560
593
  isLoading: boolean;
561
594
  signTerms: _tanstack_react_query.UseMutationResult<void, Error, void, unknown>;
@@ -564,6 +597,7 @@ declare function useSymmSignature(userAddress?: Address): {
564
597
  declare function useSymmAvailableMargin(params: {
565
598
  accountAddress?: Address;
566
599
  upnl?: bigint;
600
+ query?: SymmQueryConfig;
567
601
  }): {
568
602
  availableForOrder: bigint | null;
569
603
  stats: {
@@ -609,6 +643,7 @@ declare function useSymmBalances(params: {
609
643
  userAddress?: Address;
610
644
  chainId?: number;
611
645
  multiAccountAddress?: Address;
646
+ query?: SymmQueryConfig;
612
647
  }): {
613
648
  balanceInfo: node_modules__pear_protocol_symm_core_dist_types.BalanceInfoResponse | null;
614
649
  isLoading: boolean;
@@ -632,6 +667,7 @@ declare function useSymmPositions(params: {
632
667
  accountAddress?: Address;
633
668
  mainAddress?: Address;
634
669
  chainId?: number;
670
+ query?: SymmQueryConfig;
635
671
  }): {
636
672
  positions: _pear_protocol_symm_core.OpenPositionDto[];
637
673
  isLoading: boolean;
@@ -642,6 +678,7 @@ declare function useSymmOpenOrders(params: {
642
678
  accountAddress?: Address;
643
679
  mainAddress?: Address;
644
680
  chainId?: number;
681
+ query?: SymmQueryConfig;
645
682
  }): {
646
683
  orders: _pear_protocol_symm_core.UnifiedOrderItem[];
647
684
  isLoading: boolean;
@@ -652,6 +689,7 @@ declare function useSymmTradeHistory(params: {
652
689
  accountAddress?: Address;
653
690
  mainAddress?: Address;
654
691
  chainId?: number;
692
+ query?: SymmQueryConfig;
655
693
  }): {
656
694
  trades: _pear_protocol_symm_shared.ApiResponse<unknown> | null;
657
695
  isLoading: boolean;
@@ -667,6 +705,7 @@ declare function useSymmTwap(params: {
667
705
  accountAddress?: Address;
668
706
  mainAddress?: Address;
669
707
  chainId?: number;
708
+ query?: SymmQueryConfig;
670
709
  }): {
671
710
  twapOrders: node_modules__pear_protocol_symm_core_dist_types.TwapOrder[];
672
711
  isLoading: boolean;
@@ -676,6 +715,7 @@ declare function useSymmTwap(params: {
676
715
  declare function useSymmMarkets(params?: {
677
716
  chainId?: number;
678
717
  searchText?: string;
718
+ query?: SymmQueryConfig;
679
719
  }): {
680
720
  markets: _pear_protocol_symm_core.MarketGroupItem[];
681
721
  isLoading: boolean;
@@ -683,7 +723,9 @@ declare function useSymmMarkets(params?: {
683
723
  };
684
724
 
685
725
  type UseSymmHedgerMarketsParams = GetSymmHedgerMarketsRequest & {
726
+ /** @deprecated Use `query.enabled` instead. */
686
727
  enabled?: boolean;
728
+ query?: SymmQueryConfig;
687
729
  };
688
730
  declare function useSymmHedgerMarkets(params?: UseSymmHedgerMarketsParams): {
689
731
  data: _pear_protocol_symm_core.SymmHedgerMarketsResult | null;
@@ -703,6 +745,7 @@ declare function useSymmHedgerMarkets(params?: UseSymmHedgerMarketsParams): {
703
745
 
704
746
  declare function useSymmFunding(params?: {
705
747
  chainId?: number;
748
+ query?: SymmQueryConfig;
706
749
  }): {
707
750
  rates: node_modules__pear_protocol_symm_core_dist_types.FundingRate[];
708
751
  isLoading: boolean;
@@ -712,6 +755,7 @@ declare function useSymmPortfolio(params: {
712
755
  accountAddress?: Address;
713
756
  mainAddress?: Address;
714
757
  chainId?: number;
758
+ query?: SymmQueryConfig;
715
759
  }): {
716
760
  metrics: _pear_protocol_symm_core.PortfolioResponse | null;
717
761
  isLoading: boolean;
@@ -721,6 +765,7 @@ declare function useSymmPortfolio(params: {
721
765
  declare function useSymmNotifications(params: {
722
766
  userAddress?: Address;
723
767
  chainId?: number;
768
+ query?: SymmQueryConfig;
724
769
  }): {
725
770
  notifications: _pear_protocol_symm_core.Notification[];
726
771
  unreadCount: number;
@@ -792,7 +837,10 @@ interface UseSymmTokenSelectionMetadataReturn {
792
837
  * Fetches Binance market data for selected SYMM chart tokens and derives
793
838
  * chart header metrics (price ratio, weighted ratio, etc.).
794
839
  */
795
- declare function useSymmTokenSelectionMetadata(selection: SymmChartSelection): UseSymmTokenSelectionMetadataReturn;
840
+ declare function useSymmTokenSelectionMetadata(selection: SymmChartSelection, options?: {
841
+ enabled?: boolean;
842
+ query?: SymmQueryConfig;
843
+ }): UseSymmTokenSelectionMetadataReturn;
796
844
 
797
845
  /**
798
846
  * Candle interval type matching the chart system.
@@ -855,7 +903,7 @@ interface SymmPerformanceOverlay {
855
903
  */
856
904
  declare function useSymmPerformanceOverlays(selection: SymmChartSelection): {
857
905
  overlays: SymmPerformanceOverlay[];
858
- generateOverlaySymbols: () => string[];
906
+ overlaySymbols: string[];
859
907
  };
860
908
 
861
909
  declare const symmKeys: {
@@ -878,8 +926,9 @@ declare const symmKeys: {
878
926
  unreadCount: (address?: Address, chainId?: number) => readonly ["symm", "unreadCount", `0x${string}` | undefined, number | undefined];
879
927
  availableMargin: (address?: Address, chainId?: number) => readonly ["symm", "availableMargin", `0x${string}` | undefined, number | undefined];
880
928
  delegation: (account?: Address, target?: Address, selectors?: readonly Hex[], chainId?: number) => readonly ["symm", "delegation", `0x${string}` | undefined, `0x${string}` | undefined, readonly `0x${string}`[] | undefined, number | undefined];
929
+ chartMetadata: (symbolsKey: string, positionKey: string) => readonly ["symm", "chartMetadata", string, string];
881
930
  };
882
931
 
883
932
  declare function getSymmErrorMessage(error: unknown): string;
884
933
 
885
- export { type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmDelegationState, type SymmInstantTradeActionArgs, type SymmInstantTradeRequest, type SymmPerformanceOverlay, SymmProvider, type SymmProviderProps, type SymmTokenMetadata, type UseSymmChartCandlesReturn, type UseSymmDelegationParams, type UseSymmHedgerMarketsParams, type UseSymmTokenSelectionMetadataReturn, getSymmErrorMessage, symmKeys, useSymmAccounts, useSymmApproval, useSymmAuth, useSymmAvailableMargin, useSymmBalances, useSymmChartCandles, useSymmChartSelection, useSymmCollateral, useSymmContext, useSymmCoreClient, useSymmDelegation, useSymmDeposit, useSymmFunding, useSymmHedgerMarkets, useSymmInstantTrade, useSymmMarkets, useSymmNotifications, useSymmOpenOrders, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmSignature, useSymmTokenSelectionMetadata, useSymmTpsl, useSymmTrade, useSymmTradeHistory, useSymmTwap, useSymmWithdraw, useSymmWs, useSymmioClient };
934
+ export { type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmDelegationState, type SymmInstantTradeActionArgs, type SymmInstantTradeRequest, type SymmPerformanceOverlay, SymmProvider, type SymmProviderProps, type SymmQueryConfig, type SymmTokenMetadata, type UseSymmChartCandlesReturn, type UseSymmDelegationParams, type UseSymmHedgerMarketsParams, type UseSymmTokenSelectionMetadataReturn, getSymmErrorMessage, symmKeys, useSymmAccounts, useSymmApproval, useSymmAuth, useSymmAvailableMargin, useSymmBalances, useSymmChartCandles, useSymmChartSelection, useSymmCollateral, useSymmContext, useSymmCoreClient, useSymmDelegation, useSymmDeposit, useSymmFunding, useSymmHedgerMarkets, useSymmInstantTrade, useSymmMarkets, useSymmNotifications, useSymmOpenOrders, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmSignature, useSymmTokenSelectionMetadata, useSymmTpsl, useSymmTrade, useSymmTradeHistory, useSymmTwap, useSymmWithdraw, useSymmWs, useSymmioClient };