API ReferenceSetup and configurationInterface
OracleConfig
Oracle (Pyth) configuration.
Properties
hermesAccessToken?
optional hermesAccessToken?: string;Pyth API key for authenticating Hermes requests. Sent as an Authorization: Bearer <token> header
on every Hermes call. Required whenever requests go directly to Pyth’s Hermes service. Never embed
it in a browser bundle: set it only where the SDK runs server-side, or keep it in a proxy named by
OracleConfig.hermesEndpoint.
hermesEndpoint?
optional hermesEndpoint?: string;URL of the Pyth Hermes price feed service. Defaults to https://hermes.pyth.network, which rejects
requests that carry no API key. In a browser, point this at your own proxy that attaches the key
server-side, and leave OracleConfig.hermesAccessToken unset.
maxPriceAgeSeconds?
optional maxPriceAgeSeconds?: number;Maximum absolute age, in seconds, accepted for prices fetched from Pyth Hermes. Must be a
non-negative finite number. Defaults to 300 seconds. Set to positive Infinity to disable freshness
enforcement, including the guard against materially future-dated prices.
updateBufferSeconds?
optional updateBufferSeconds?: number;The amount of time that validation assumes it will take an oracle update transaction to get submitted and confirmed. This is to prevent users of the SDK from paying for transactions that are likely to fail when confirmed. For instance, if the max price update stale duration is 300 seconds and updateBufferSeconds is 60 seconds, any oracle price updates > 240 seconds old will be considered invalid within validation, ahead of transaction submission. Defaults to 30 seconds.