Orderly provides both public and private APIs. Public APIs can be fetched directly. Private APIs require authentication and these can be performed using hooks from @orderly.network/hooks
.
Reminder: Most often you might not have to use the following hooks, as
@orderly.network/hooks
likely implements higher level hooks on top of the request module. For
example, you can use usePositionStream
for position management, and useOrderEntry
for order
placement. You may consider to use these hooks if you want to build out more advanced usage of
Orderly, or if the provided hooks are not suitable for your use case.
@orderly.network/hooks
provides the following hooks for builders to access Orderly’s RESTful APIs:
GET
Public APIGET
Private APIusePrivateQuery
that supports infinite scrollingPOST
APIsThe above hooks are based on SWR and have the following properties:
Use usePrivateQuery
, usePrivateInfiniteQuery
or useMutation
to access any private API. These are slightly different from useQuery
:
OrderlyKey
according to Orderly’s standards.@orderly.network/hooks
provides a useWS
hook for accessing Orderly’s Websocket API. useWS
returns the WS
instance of @orderly.network/net
. Builders can use WS
to subscribe, cancel, or to send messages through the Websocket.
For all available topics of the Websocket, please check the Websocket API documentation.
Orderly provides both public and private APIs. Public APIs can be fetched directly. Private APIs require authentication and these can be performed using hooks from @orderly.network/hooks
.
Reminder: Most often you might not have to use the following hooks, as
@orderly.network/hooks
likely implements higher level hooks on top of the request module. For
example, you can use usePositionStream
for position management, and useOrderEntry
for order
placement. You may consider to use these hooks if you want to build out more advanced usage of
Orderly, or if the provided hooks are not suitable for your use case.
@orderly.network/hooks
provides the following hooks for builders to access Orderly’s RESTful APIs:
GET
Public APIGET
Private APIusePrivateQuery
that supports infinite scrollingPOST
APIsThe above hooks are based on SWR and have the following properties:
Use usePrivateQuery
, usePrivateInfiniteQuery
or useMutation
to access any private API. These are slightly different from useQuery
:
OrderlyKey
according to Orderly’s standards.@orderly.network/hooks
provides a useWS
hook for accessing Orderly’s Websocket API. useWS
returns the WS
instance of @orderly.network/net
. Builders can use WS
to subscribe, cancel, or to send messages through the Websocket.
For all available topics of the Websocket, please check the Websocket API documentation.