Hooks & Store
For custom UIs that need widget data or actions:
Hooks
useEssential()β wallet, network, consts (zo/sudo/usdz), accountData, refreshAccountuseWallet(),useNetwork()β wallet and current networkusePosition(address, network)β positions list, refresh,dataUpdatedAtuseOrder(address, network)β orders list, refresh,dataUpdatedAtuseHistories(address, network)β trade historyuseFundingRate(symbol, network, lpToken)β funding rateusePositionConfig(network, { symbols })β position config (fees, etc.)useSymbolInfo(network)β symbol info map (ZLP/SLP/USDZ)useRpc()β RPC list, custom URL, latency; used byRpcSettingsuseSponsoredGasAvailability(address, network)β gas sponsorship
Store (Jotai)
appStoreβ same store instance must be used for the widget and your app (see Quick start).currentSymbolAtomβ{ symbolId, unit, icon }; set when user picks a market.tokenPriceAtomβ{ tokenPrice: Record<string, number>, isLoading, error }(Pyth oracle prices).
Last updated