@pear-protocol/symmio-client 0.1.3 → 0.1.4
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.d.mts +15 -2
- package/dist/react/index.d.ts +15 -2
- package/dist/react/index.js +25 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +25 -1
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as viem from 'viem';
|
|
3
3
|
import { Address, Hex, PublicClient, WalletClient } from 'viem';
|
|
4
4
|
import * as _pear_protocol_symm_core from '@pear-protocol/symm-core';
|
|
5
|
-
import { SymmSDK, OpenBasketPositionRequest, ClosePositionRequest, CancelOpenRequest, UpdatePositionRequest, SetTpslRequest, CancelTpslRequest } from '@pear-protocol/symm-core';
|
|
5
|
+
import { SymmSDK, OpenBasketPositionRequest, ClosePositionRequest, CancelOpenRequest, UpdatePositionRequest, SetTpslRequest, CancelTpslRequest, MarketItem } from '@pear-protocol/symm-core';
|
|
6
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
7
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
8
8
|
import * as node_modules__pear_protocol_symm_core_dist_types from 'node_modules/@pear-protocol/symm-core/dist/types';
|
|
@@ -560,6 +560,18 @@ declare function useSymmMarkets(params?: {
|
|
|
560
560
|
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<_pear_protocol_symm_core.MarketsResponse, Error>>;
|
|
561
561
|
};
|
|
562
562
|
|
|
563
|
+
type UseSymmHedgerMarketsParams = {
|
|
564
|
+
chainId?: number;
|
|
565
|
+
searchText?: string;
|
|
566
|
+
enabled?: boolean;
|
|
567
|
+
};
|
|
568
|
+
declare function useSymmHedgerMarkets(params?: UseSymmHedgerMarketsParams): {
|
|
569
|
+
markets: MarketItem[];
|
|
570
|
+
isLoading: boolean;
|
|
571
|
+
isFetching: boolean;
|
|
572
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<_pear_protocol_symm_core.HedgerMarketsListResponse, Error>>;
|
|
573
|
+
};
|
|
574
|
+
|
|
563
575
|
declare function useSymmFunding(params?: {
|
|
564
576
|
chainId?: number;
|
|
565
577
|
}): {
|
|
@@ -730,6 +742,7 @@ declare const symmKeys: {
|
|
|
730
742
|
tpslOrders: (address?: Address, chainId?: number) => readonly ["symm", "tpslOrders", `0x${string}` | undefined, number | undefined];
|
|
731
743
|
twapOrders: (address?: Address, chainId?: number) => readonly ["symm", "twapOrders", `0x${string}` | undefined, number | undefined];
|
|
732
744
|
markets: (chainId?: number, search?: string) => readonly ["symm", "markets", number | undefined, string | undefined];
|
|
745
|
+
hedgerMarkets: (chainId?: number, search?: string) => readonly ["symm", "hedgerMarkets", number | undefined, string | undefined];
|
|
733
746
|
fundingRates: (chainId?: number) => readonly ["symm", "fundingRates", number | undefined];
|
|
734
747
|
portfolio: (address?: Address, chainId?: number) => readonly ["symm", "portfolio", `0x${string}` | undefined, number | undefined];
|
|
735
748
|
notifications: (address?: Address, chainId?: number) => readonly ["symm", "notifications", `0x${string}` | undefined, number | undefined];
|
|
@@ -738,4 +751,4 @@ declare const symmKeys: {
|
|
|
738
751
|
|
|
739
752
|
declare function getSymmErrorMessage(error: unknown): string;
|
|
740
753
|
|
|
741
|
-
export { type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmPerformanceOverlay, SymmProvider, type SymmProviderProps, type SymmTokenMetadata, type UseSymmChartCandlesReturn, type UseSymmTokenSelectionMetadataReturn, getSymmErrorMessage, symmKeys, useSymmAccounts, useSymmApproval, useSymmAuth, useSymmBalances, useSymmChartCandles, useSymmChartSelection, useSymmCollateral, useSymmContext, useSymmCoreClient, useSymmDeposit, useSymmFunding, useSymmMarkets, useSymmNotifications, useSymmOpenOrders, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmSignature, useSymmTokenSelectionMetadata, useSymmTpsl, useSymmTrade, useSymmTradeHistory, useSymmTwap, useSymmWithdraw, useSymmWs, useSymmioClient };
|
|
754
|
+
export { type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmPerformanceOverlay, SymmProvider, type SymmProviderProps, type SymmTokenMetadata, type UseSymmChartCandlesReturn, type UseSymmHedgerMarketsParams, type UseSymmTokenSelectionMetadataReturn, getSymmErrorMessage, symmKeys, useSymmAccounts, useSymmApproval, useSymmAuth, useSymmBalances, useSymmChartCandles, useSymmChartSelection, useSymmCollateral, useSymmContext, useSymmCoreClient, useSymmDeposit, useSymmFunding, useSymmHedgerMarkets, useSymmMarkets, useSymmNotifications, useSymmOpenOrders, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmSignature, useSymmTokenSelectionMetadata, useSymmTpsl, useSymmTrade, useSymmTradeHistory, useSymmTwap, useSymmWithdraw, useSymmWs, useSymmioClient };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as viem from 'viem';
|
|
3
3
|
import { Address, Hex, PublicClient, WalletClient } from 'viem';
|
|
4
4
|
import * as _pear_protocol_symm_core from '@pear-protocol/symm-core';
|
|
5
|
-
import { SymmSDK, OpenBasketPositionRequest, ClosePositionRequest, CancelOpenRequest, UpdatePositionRequest, SetTpslRequest, CancelTpslRequest } from '@pear-protocol/symm-core';
|
|
5
|
+
import { SymmSDK, OpenBasketPositionRequest, ClosePositionRequest, CancelOpenRequest, UpdatePositionRequest, SetTpslRequest, CancelTpslRequest, MarketItem } from '@pear-protocol/symm-core';
|
|
6
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
7
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
8
8
|
import * as node_modules__pear_protocol_symm_core_dist_types from 'node_modules/@pear-protocol/symm-core/dist/types';
|
|
@@ -560,6 +560,18 @@ declare function useSymmMarkets(params?: {
|
|
|
560
560
|
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<_pear_protocol_symm_core.MarketsResponse, Error>>;
|
|
561
561
|
};
|
|
562
562
|
|
|
563
|
+
type UseSymmHedgerMarketsParams = {
|
|
564
|
+
chainId?: number;
|
|
565
|
+
searchText?: string;
|
|
566
|
+
enabled?: boolean;
|
|
567
|
+
};
|
|
568
|
+
declare function useSymmHedgerMarkets(params?: UseSymmHedgerMarketsParams): {
|
|
569
|
+
markets: MarketItem[];
|
|
570
|
+
isLoading: boolean;
|
|
571
|
+
isFetching: boolean;
|
|
572
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<_pear_protocol_symm_core.HedgerMarketsListResponse, Error>>;
|
|
573
|
+
};
|
|
574
|
+
|
|
563
575
|
declare function useSymmFunding(params?: {
|
|
564
576
|
chainId?: number;
|
|
565
577
|
}): {
|
|
@@ -730,6 +742,7 @@ declare const symmKeys: {
|
|
|
730
742
|
tpslOrders: (address?: Address, chainId?: number) => readonly ["symm", "tpslOrders", `0x${string}` | undefined, number | undefined];
|
|
731
743
|
twapOrders: (address?: Address, chainId?: number) => readonly ["symm", "twapOrders", `0x${string}` | undefined, number | undefined];
|
|
732
744
|
markets: (chainId?: number, search?: string) => readonly ["symm", "markets", number | undefined, string | undefined];
|
|
745
|
+
hedgerMarkets: (chainId?: number, search?: string) => readonly ["symm", "hedgerMarkets", number | undefined, string | undefined];
|
|
733
746
|
fundingRates: (chainId?: number) => readonly ["symm", "fundingRates", number | undefined];
|
|
734
747
|
portfolio: (address?: Address, chainId?: number) => readonly ["symm", "portfolio", `0x${string}` | undefined, number | undefined];
|
|
735
748
|
notifications: (address?: Address, chainId?: number) => readonly ["symm", "notifications", `0x${string}` | undefined, number | undefined];
|
|
@@ -738,4 +751,4 @@ declare const symmKeys: {
|
|
|
738
751
|
|
|
739
752
|
declare function getSymmErrorMessage(error: unknown): string;
|
|
740
753
|
|
|
741
|
-
export { type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmPerformanceOverlay, SymmProvider, type SymmProviderProps, type SymmTokenMetadata, type UseSymmChartCandlesReturn, type UseSymmTokenSelectionMetadataReturn, getSymmErrorMessage, symmKeys, useSymmAccounts, useSymmApproval, useSymmAuth, useSymmBalances, useSymmChartCandles, useSymmChartSelection, useSymmCollateral, useSymmContext, useSymmCoreClient, useSymmDeposit, useSymmFunding, useSymmMarkets, useSymmNotifications, useSymmOpenOrders, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmSignature, useSymmTokenSelectionMetadata, useSymmTpsl, useSymmTrade, useSymmTradeHistory, useSymmTwap, useSymmWithdraw, useSymmWs, useSymmioClient };
|
|
754
|
+
export { type SymmChartSelection, type SymmChartSelectionInput, type SymmChartTokenSelection, type SymmContextValue, type SymmPerformanceOverlay, SymmProvider, type SymmProviderProps, type SymmTokenMetadata, type UseSymmChartCandlesReturn, type UseSymmHedgerMarketsParams, type UseSymmTokenSelectionMetadataReturn, getSymmErrorMessage, symmKeys, useSymmAccounts, useSymmApproval, useSymmAuth, useSymmBalances, useSymmChartCandles, useSymmChartSelection, useSymmCollateral, useSymmContext, useSymmCoreClient, useSymmDeposit, useSymmFunding, useSymmHedgerMarkets, useSymmMarkets, useSymmNotifications, useSymmOpenOrders, useSymmPerformanceOverlays, useSymmPortfolio, useSymmPositions, useSymmSignature, useSymmTokenSelectionMetadata, useSymmTpsl, useSymmTrade, useSymmTradeHistory, useSymmTwap, useSymmWithdraw, useSymmWs, useSymmioClient };
|
package/dist/react/index.js
CHANGED
|
@@ -24402,6 +24402,7 @@ var symmKeys = {
|
|
|
24402
24402
|
tpslOrders: (address, chainId) => ["symm", "tpslOrders", address, chainId],
|
|
24403
24403
|
twapOrders: (address, chainId) => ["symm", "twapOrders", address, chainId],
|
|
24404
24404
|
markets: (chainId, search) => ["symm", "markets", chainId, search],
|
|
24405
|
+
hedgerMarkets: (chainId, search) => ["symm", "hedgerMarkets", chainId, search],
|
|
24405
24406
|
fundingRates: (chainId) => ["symm", "fundingRates", chainId],
|
|
24406
24407
|
portfolio: (address, chainId) => ["symm", "portfolio", address, chainId],
|
|
24407
24408
|
notifications: (address, chainId) => ["symm", "notifications", address, chainId],
|
|
@@ -24838,6 +24839,29 @@ function useSymmMarkets(params) {
|
|
|
24838
24839
|
refetch: query.refetch
|
|
24839
24840
|
};
|
|
24840
24841
|
}
|
|
24842
|
+
function useSymmHedgerMarkets(params) {
|
|
24843
|
+
const { symmCoreClient, chainId: ctxChainId } = useSymmContext();
|
|
24844
|
+
const chainId = params?.chainId ?? ctxChainId;
|
|
24845
|
+
const searchText = params?.searchText?.trim();
|
|
24846
|
+
const isEnabled = params?.enabled ?? true;
|
|
24847
|
+
const query = reactQuery.useQuery({
|
|
24848
|
+
queryKey: symmKeys.hedgerMarkets(chainId, searchText),
|
|
24849
|
+
queryFn: async () => {
|
|
24850
|
+
return symmCoreClient.markets.listHedger({
|
|
24851
|
+
chainId,
|
|
24852
|
+
searchText: searchText || void 0
|
|
24853
|
+
});
|
|
24854
|
+
},
|
|
24855
|
+
enabled: !!symmCoreClient && isEnabled,
|
|
24856
|
+
staleTime: 3e4
|
|
24857
|
+
});
|
|
24858
|
+
return {
|
|
24859
|
+
markets: query.data?.data?.markets ?? [],
|
|
24860
|
+
isLoading: query.isLoading,
|
|
24861
|
+
isFetching: query.isFetching,
|
|
24862
|
+
refetch: query.refetch
|
|
24863
|
+
};
|
|
24864
|
+
}
|
|
24841
24865
|
function useSymmFunding(params) {
|
|
24842
24866
|
const { symmCoreClient, chainId: ctxChainId } = useSymmContext();
|
|
24843
24867
|
const chainId = params?.chainId ?? ctxChainId;
|
|
@@ -25979,6 +26003,7 @@ exports.useSymmContext = useSymmContext;
|
|
|
25979
26003
|
exports.useSymmCoreClient = useSymmCoreClient;
|
|
25980
26004
|
exports.useSymmDeposit = useSymmDeposit;
|
|
25981
26005
|
exports.useSymmFunding = useSymmFunding;
|
|
26006
|
+
exports.useSymmHedgerMarkets = useSymmHedgerMarkets;
|
|
25982
26007
|
exports.useSymmMarkets = useSymmMarkets;
|
|
25983
26008
|
exports.useSymmNotifications = useSymmNotifications;
|
|
25984
26009
|
exports.useSymmOpenOrders = useSymmOpenOrders;
|