@orderly.network/hooks

The hooks libraries provides a series of React hooks for React developers to ensure a seamless integration experience. This library is a package built on top of @orderly.network/core and @orderly.network/perp.

Coding standards

  • If the hook returns an array, then the first element 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 subscription subscribe to relevant Websocket API and allow to pass in a function.
  • All hooks ending with query is a wrapper of an API request.

List of hooks

REST & WS API

The REST API hooks can be used to facilitate interacting with Orderly REST & Websocket APIs.

Utility

These utility hooks provide ways to help handle UI states and some state management logic.

Account

Assets

  • useCollateral - retrieves information about a user’s collateral
  • useMaxQty - retrieves the maximum quantity a user can place based on the symbol, side, leverage etc.
  • useChain - Chain information
  • useChains - Retrieves the list of supported chains
  • useDeposit - retrieves a Withdraw tokens from Orderly smart contract balance helper
  • useHoldingStream - Retrieves user’s assets

Markets

Orders

Positions

Funding

Referral