Documentation Index
Fetch the complete documentation index at: https://orderly.network/docs/llms.txt
Use this file to discover all available pages before exploring further.
@orderly.network/hooks provides the following hooks for handling account-related logic:
- useAccount: Retrieves the current account info and status. With this hook you can also create an account and create an
orderlyKey - useAccountInfo - Fetches account information
- useAccountInstance - Returns
Accountsingleton - useWalletConnector - Handles wallet connection
- useWalletSubscription - Subscribe to wallet transactionsvia WebSocket
- useLeverage - Retrieves the current account leverage
- useMarginRatio - Margin information
- useSettleSubscription - Subscribe to PnL settlement via WebSocket
- useDaily - Retrieving daily user volume
How to integrate wallet?
Since@orderly.network/hooks only focus on processing the Orderly business logic, the hooks don’t include the function of connecting to the wallet, but they can be easily integrated with third-party wallet connection libraries.
Here are two examples:
web3-onboard
Web3-Onboard is the quickest and easiest way to add multi-wallet and multi-chain support to your project. moreUse your Web3-Onboard state as the source of truth for connection status, selected chain, and active wallet, then expose those values through
WalletConnectorContextState.
The custom provider pattern in Wallet connect shows where to implement connect, disconnect, setChain, switchChain, and the wallet object consumed by Orderly hooks.
WalletConnect
WalletConnect provides developer toolkits empowering you to build engaging web3 experiences. moreWhen integrating WalletConnect directly, map the active session, connected accounts, and current chain into
WalletConnectorContextState, then pass that provider above OrderlyAppProvider.
If you want a ready-made example of the provider shape Orderly expects, refer to Wallet connect and the base app setup in Getting started.