Constructors

Properties

appendUrlSearchParams: any
baseURL: any
headers: any
httpRequest: any
httpRetries: any
timeout: any

Methods

  • Fetch the latest price updates for a set of price feed IDs. This endpoint can be customized by specifying the encoding type and whether the results should also return the parsed price update using the options object. This will throw an error if there is a network problem or the price service returns a non-ok response.

    Parameters

    • ids: string[]

      Array of hex-encoded price feed IDs for which updates are requested.

    • Optional options: {
          encoding?: "hex" | "base64";
          parsed?: boolean;
      }

      Optional parameters: - encoding: Encoding type. If specified, return the price update in the encoding specified by the encoding parameter. Default is hex. - parsed: Boolean to specify if the parsed price update should be included in the response. Default is false.

      • Optional encoding?: "hex" | "base64"
      • Optional parsed?: boolean

    Returns Promise<objectOutputType<{
        binary: ZodObject<{
            data: ZodArray<ZodString, "many">;
            encoding: ZodEnum<["hex", "base64"]>;
        }, "passthrough", ZodTypeAny, objectOutputType<{
            data: ZodArray<ZodString, "many">;
            encoding: ZodEnum<["hex", "base64"]>;
        }, ZodTypeAny, "passthrough">, objectInputType<{
            data: ZodArray<ZodString, "many">;
            encoding: ZodEnum<["hex", "base64"]>;
        }, ZodTypeAny, "passthrough">>;
        parsed: ZodOptional<ZodNullable<ZodArray<ZodObject<{
            ema_price: ZodObject<{
                conf: ZodString;
                expo: ZodNumber;
                price: ZodString;
                publish_time: ZodNumber;
            }, "passthrough", ZodTypeAny, objectOutputType<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, ZodTypeAny, "passthrough">, objectInputType<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, ZodTypeAny, "passthrough">>;
            id: ZodString;
            metadata: ZodObject<{
                prev_publish_time: ZodOptional<(...)>;
                proof_available_time: ZodOptional<(...)>;
                slot: ZodOptional<(...)>;
            }, "passthrough", ZodTypeAny, objectOutputType<{
                prev_publish_time: ...;
                proof_available_time: ...;
                slot: ...;
            }, ZodTypeAny, "passthrough">, objectInputType<{
                prev_publish_time: ...;
                proof_available_time: ...;
                slot: ...;
            }, ZodTypeAny, "passthrough">>;
            price: ZodObject<{
                conf: ZodString;
                expo: ZodNumber;
                price: ZodString;
                publish_time: ZodNumber;
            }, "passthrough", ZodTypeAny, objectOutputType<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, ZodTypeAny, "passthrough">, objectInputType<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, ZodTypeAny, "passthrough">>;
        }, "passthrough", ZodTypeAny, objectOutputType<{
            ema_price: ZodObject<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
            id: ZodString;
            metadata: ZodObject<{
                prev_publish_time: ...;
                proof_available_time: ...;
                slot: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
            price: ZodObject<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
        }, ZodTypeAny, "passthrough">, objectInputType<{
            ema_price: ZodObject<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
            id: ZodString;
            metadata: ZodObject<{
                prev_publish_time: ...;
                proof_available_time: ...;
                slot: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
            price: ZodObject<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
        }, ZodTypeAny, "passthrough">>, "many">>>;
    }, ZodTypeAny, "passthrough">>

    PriceUpdate object containing the latest updates.

  • Fetch the set of available price feeds. This endpoint can be filtered by asset type and query string. This will throw an error if there is a network problem or the price service returns a non-ok response.

    Parameters

    • Optional options: {
          filter?: string;
          query?: string;
      }

      Optional parameters: - query: String to filter the price feeds. If provided, the results will be filtered to all price feeds whose symbol contains the query string. Query string is case insensitive. Example: "bitcoin". - filter: String to filter the price feeds by asset type. Possible values are "crypto", "equity", "fx", "metal", "rates". Filter string is case insensitive.

      • Optional filter?: string
      • Optional query?: string

    Returns Promise<objectOutputType<{
        attributes: ZodRecord<ZodString, ZodString>;
        id: ZodString;
    }, ZodTypeAny, "passthrough">[]>

    Array of PriceFeedMetadata objects.

  • Fetch the price updates for a set of price feed IDs at a given timestamp. This endpoint can be customized by specifying the encoding type and whether the results should also return the parsed price update. This will throw an error if there is a network problem or the price service returns a non-ok response.

    Parameters

    • publishTime: number

      Unix timestamp in seconds.

    • ids: string[]

      Array of hex-encoded price feed IDs for which updates are requested.

    • Optional options: {
          encoding?: "hex" | "base64";
          parsed?: boolean;
      }

      Optional parameters: - encoding: Encoding type. If specified, return the price update in the encoding specified by the encoding parameter. Default is hex. - parsed: Boolean to specify if the parsed price update should be included in the response. Default is false.

      • Optional encoding?: "hex" | "base64"
      • Optional parsed?: boolean

    Returns Promise<objectOutputType<{
        binary: ZodObject<{
            data: ZodArray<ZodString, "many">;
            encoding: ZodEnum<["hex", "base64"]>;
        }, "passthrough", ZodTypeAny, objectOutputType<{
            data: ZodArray<ZodString, "many">;
            encoding: ZodEnum<["hex", "base64"]>;
        }, ZodTypeAny, "passthrough">, objectInputType<{
            data: ZodArray<ZodString, "many">;
            encoding: ZodEnum<["hex", "base64"]>;
        }, ZodTypeAny, "passthrough">>;
        parsed: ZodOptional<ZodNullable<ZodArray<ZodObject<{
            ema_price: ZodObject<{
                conf: ZodString;
                expo: ZodNumber;
                price: ZodString;
                publish_time: ZodNumber;
            }, "passthrough", ZodTypeAny, objectOutputType<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, ZodTypeAny, "passthrough">, objectInputType<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, ZodTypeAny, "passthrough">>;
            id: ZodString;
            metadata: ZodObject<{
                prev_publish_time: ZodOptional<(...)>;
                proof_available_time: ZodOptional<(...)>;
                slot: ZodOptional<(...)>;
            }, "passthrough", ZodTypeAny, objectOutputType<{
                prev_publish_time: ...;
                proof_available_time: ...;
                slot: ...;
            }, ZodTypeAny, "passthrough">, objectInputType<{
                prev_publish_time: ...;
                proof_available_time: ...;
                slot: ...;
            }, ZodTypeAny, "passthrough">>;
            price: ZodObject<{
                conf: ZodString;
                expo: ZodNumber;
                price: ZodString;
                publish_time: ZodNumber;
            }, "passthrough", ZodTypeAny, objectOutputType<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, ZodTypeAny, "passthrough">, objectInputType<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, ZodTypeAny, "passthrough">>;
        }, "passthrough", ZodTypeAny, objectOutputType<{
            ema_price: ZodObject<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
            id: ZodString;
            metadata: ZodObject<{
                prev_publish_time: ...;
                proof_available_time: ...;
                slot: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
            price: ZodObject<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
        }, ZodTypeAny, "passthrough">, objectInputType<{
            ema_price: ZodObject<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
            id: ZodString;
            metadata: ZodObject<{
                prev_publish_time: ...;
                proof_available_time: ...;
                slot: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
            price: ZodObject<{
                conf: ...;
                expo: ...;
                price: ...;
                publish_time: ...;
            }, "passthrough", ZodTypeAny, objectOutputType<(...), (...), (...)>, objectInputType<(...), (...), (...)>>;
        }, ZodTypeAny, "passthrough">>, "many">>>;
    }, ZodTypeAny, "passthrough">>

    PriceUpdate object containing the updates at the specified timestamp.

  • Fetch streaming price updates for a set of price feed IDs. This endpoint can be customized by specifying the encoding type, whether the results should include parsed updates, and if unordered updates or only benchmark updates are allowed. This will return an EventSource that can be used to listen to streaming updates. If an invalid hex-encoded ID is passed, it will throw an error.

    Parameters

    • ids: string[]

      Array of hex-encoded price feed IDs for which streaming updates are requested.

    • Optional options: {
          allowUnordered?: boolean;
          benchmarksOnly?: boolean;
          encoding?: "hex" | "base64";
          parsed?: boolean;
      }
      • Optional allowUnordered?: boolean
      • Optional benchmarksOnly?: boolean
      • Optional encoding?: "hex" | "base64"
      • Optional parsed?: boolean

    Returns Promise<EventSource>

    An EventSource instance for receiving streaming updates.