useTokenPrice & useTokenPrices
Two standalone hooks for fetching real-time cryptocurrency prices. Neither requires OneProvider -- they can be used anywhere in your React tree.
Both hooks use PriceService internally, which provides:
- Multi-source price aggregation with automatic fallback between providers.
- Client-side caching to avoid redundant network requests within a short window.
- Automatic retry on transient failures.
Import
import { useTokenPrice, useTokenPrices } from '@one_deploy/sdk';
useTokenPrice
Fetches the real-time USD price for a single token symbol.