oracleKeeper
This module provides utilities for retrieving Oracle Keeper URLs for different blockchain networks supported by the GMX protocol. Oracle Keepers are responsible for providing price feeds and other critical data to the GMX smart contracts.
Methods
Both functions throw an Error if chainId is not one of the supported chains: ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, or ARBITRUM_SEPOLIA.
getOracleKeeperUrl
getOracleKeeperUrl(chainId: number): string
Returns the primary Oracle Keeper URL for the chain. Throws if chainId is not supported.
import { getOracleKeeperUrl } from "@gmx-io/sdk/configs/oracleKeeper";
import { ARBITRUM } from "@gmx-io/sdk/configs/chains";
const url = getOracleKeeperUrl(ARBITRUM);
// "https://arbitrum-api.gmxinfra.io"
getOracleKeeperFallbackUrls
getOracleKeeperFallbackUrls(chainId: number): string[]
Returns an ordered list of fallback Oracle Keeper URLs for the chain. Use these when the primary URL is unavailable. Throws if chainId is not supported.
import { getOracleKeeperFallbackUrls } from "@gmx-io/sdk/configs/oracleKeeper";
import { ARBITRUM } from "@gmx-io/sdk/configs/chains";
const fallbackUrls = getOracleKeeperFallbackUrls(ARBITRUM);
// ["https://arbitrum-api-fallback.gmxinfra.io", "https://arbitrum-api-fallback.gmxinfra2.io"]