Utility
useConfig
This hook allows to return various configuration values.
Possible keys:
export type ConfigKey =
| "apiBaseUrl"
| "klineDataUrl"
| "privateWsUrl"
| "publicWsUrl"
| "operatorUrl"
| "domain"
| "brokerId"
| "networkId"
| "env"
| "PROD_URL"
| "markets";
If no key is provided, then the entire ConfigStore
will be returned.
Example
// get specific config
const networkId = useConfig("networkId");
useEffect(() => {
if (networkId === "testnet") {
// do something
}
}, [networkId]);