Hooks
@orderly.network/hooks
The hooks libraries provides a series of React hooks for React developers to ensure a seamless integration experience through the Orderly SDK. This library is a package built on top of @orderly.network/core
and @orderly.network/perp
.
Coding standards
- If hooks returns an array, then the first elemnet will be the actual data, and the second element will be an object containing some supporting functions.
- All hooks ending with stream will update in real-time, via relevant websocket subscriptions.
- All hooks ending with query is a wrapper on API requests.
List of hooks
Base & Common
Provides basic hooks to help handle UI states, and some common state management logic.
- useQuery -
GET
Public API - usePrivateQuery -
GET
Private API - usePrivateLazyInfiniteQuery - A version of
usePrivateQuery
that supports infinite scrolling - useLazyQuery
- useMutation -
POST
APIs - useWS - WebSocket client
- useConfig - An instance of the ConfigStore
- useEventEmitter - An instance of the EventEmitter
- useLocalStorage - Management (CRUD) of localStorage
- useSessionStorage - Management (CRUD) of sessionStorage
Orderly API
Provides a list of hooks related to Orderly's business logic. Each hooks contains usage of the Orderly API and related data calculation logic.
- useAccount - Account information
- useHoldingStream - Holding
- useCollateral - Asset information
- useLeverage - Leverage information
- useMarginRatio - Margin information
- useOrderEntry - Order placement
- useFundingRate - Funding rate information
- useFundingRates - Batch funding rate information
- useChains - Chain information
- useDeposit - Deposit helper
- useWithdraw - Withdrawal helper
- useSymbolsInfo - Symbol information
- useTokenInfo - Token information
- useMaxQty - Maximum trading quantity
- useTickerStream - Symbol market data stream
- useOrderStream - Order management
- usePositionStream - Position management
- useOrderbookStream - Orderbook stream
- useMarkPricesStream - Mark prices stream
For more details please see API docs