diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index 59ca84ec09b..dfc423af04f 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -434,43 +434,53 @@ export const SIDEBAR: Partial> = { url: "data-streams/reference/overview", }, { - title: "REST API", - url: "data-streams/reference/interface-api", - }, - { - title: "WebSocket", - url: "data-streams/reference/interface-ws", - }, - { - title: "Authentication", - url: "data-streams/reference/authentication", + title: "Data Streams Reference", + url: "data-streams/reference/data-streams-api", children: [ { - title: "JavaScript examples", - url: "data-streams/reference/authentication/javascript-examples", + title: "Authentication", + url: "data-streams/reference/data-streams-api/authentication", + children: [ + { + title: "JavaScript examples", + url: "data-streams/reference/data-streams-api/authentication/javascript-examples", + }, + { + title: "TypeScript examples", + url: "data-streams/reference/data-streams-api/authentication/typescript-examples", + }, + { + title: "Go examples", + url: "data-streams/reference/data-streams-api/authentication/go-examples", + }, + { + title: "Rust examples", + url: "data-streams/reference/data-streams-api/authentication/rust-examples", + }, + ], + }, + { + title: "API Reference", + url: "data-streams/reference/data-streams-api/interface-api", }, { - title: "TypeScript examples", - url: "data-streams/reference/authentication/typescript-examples", + title: "WebSocket Reference", + url: "data-streams/reference/data-streams-api/interface-ws", }, { - title: "Go examples", - url: "data-streams/reference/authentication/go-examples", + title: "SDK References", + url: "data-streams/reference/data-streams-api/go-sdk", + highlightAsCurrent: ["data-streams/reference/data-streams-api/rust-sdk"], }, { - title: "Rust examples", - url: "data-streams/reference/authentication/rust-examples", + title: "Onchain report verification (EVM chains)", + url: "data-streams/reference/data-streams-api/onchain-verification", }, ], }, { - title: "SDK References", - url: "data-streams/reference/go-sdk", - highlightAsCurrent: ["data-streams/reference/rust-sdk"], - }, - { - title: "Onchain report verification (EVM chains)", - url: "data-streams/reference/onchain-verification", + title: "Candlestick API", + url: "data-streams/reference/candlestick-api", }, ], }, diff --git a/src/content/data-streams/architecture.mdx b/src/content/data-streams/architecture.mdx index 47ad5909dae..231f03df117 100644 --- a/src/content/data-streams/architecture.mdx +++ b/src/content/data-streams/architecture.mdx @@ -123,7 +123,7 @@ Read the [Getting Started](/data-streams/getting-started) guide to learn how to Active-active is a system configuration strategy where redundant systems remain active simultaneously to serve requests. Incoming requests are distributed across all active resources and load-balanced to provide high availability, scalability, and fault tolerance. This strategy is the opposite of active-passive where a secondary system remains inactive until the primary system fails. -The Data Streams API services use an active-active setup as a highly available and resilient architecture across multiple distributed and fully isolated origins. This setup ensures that the services are operational even if one origin fails, which provides robust fault tolerance and high availability. This configuration applies to both the [REST API](/data-streams/reference/interface-api) and the [WebSocket API](/data-streams/reference/interface-ws). A global load balancer seamlessly manages the system to provide automated and transparent failovers. For advanced use cases, the service publishes available origins using HTTP headers, which enables you to interact directly with specific origin locations if necessary. +The Data Streams API services use an active-active setup as a highly available and resilient architecture across multiple distributed and fully isolated origins. This setup ensures that the services are operational even if one origin fails, which provides robust fault tolerance and high availability. This configuration applies to both the [REST API](/data-streams/reference/data-streams-api/interface-api) and the [WebSocket API](/data-streams/reference/data-streams-api/interface-ws). A global load balancer seamlessly manages the system to provide automated and transparent failovers. For advanced use cases, the service publishes available origins using HTTP headers, which enables you to interact directly with specific origin locations if necessary. ### Active-Active Setup diff --git a/src/content/data-streams/developer-responsibilities.mdx b/src/content/data-streams/developer-responsibilities.mdx index db352e26ccd..2ccb68ee2b2 100644 --- a/src/content/data-streams/developer-responsibilities.mdx +++ b/src/content/data-streams/developer-responsibilities.mdx @@ -85,8 +85,8 @@ Developers implementing Chainlink Data Streams are solely responsible for instit - **Code dependencies and imports:** Developers are responsible for ensuring the quality, reliability, and security of any dependencies or imported packages that they use with Chainlink Data Streams, and review and audit these dependencies and packages. - **Implementing Contingency Logic:** In extreme circumstances, including situations beyond the control of Chainlink node operators, Chainlink Data Streams may experience periods of unavailability or performance degradation. When a WebSocket connection is dropped, user systems must manage reconnections effectively. Developers are responsible for creating contingency plans tailored to their specific application needs, such as: - Implementing the [Data Streams Architecture](/data-streams/architecture), - - Adopting an [active-active](/data-streams/architecture#active-active-multi-site-deployment) deployment strategy and [configuring the SDK](/data-streams/reference/go-sdk#config-struct) to support multiple concurrent WebSocket connections, - - Retrieving any potentially missing reports via the [REST API](/data-streams/reference/interface-api). + - Adopting an [active-active](/data-streams/architecture#active-active-multi-site-deployment) deployment strategy and [configuring the SDK](/data-streams/reference/data-streams-api/go-sdk#config-struct) to support multiple concurrent WebSocket connections, + - Retrieving any potentially missing reports via the [REST API](/data-streams/reference/data-streams-api/interface-api). ### Additional Considerations on Data Usage and Verification diff --git a/src/content/data-streams/index.mdx b/src/content/data-streams/index.mdx index d74fd0662a3..f126bd2b511 100644 --- a/src/content/data-streams/index.mdx +++ b/src/content/data-streams/index.mdx @@ -78,9 +78,9 @@ You can access Chainlink Data Streams through SDKs and APIs, allowing you to bui Access data directly through REST APIs or WebSocket connections using our SDKs: -- **[Go SDK](/data-streams/reference/go-sdk)** - Full-featured SDK with comprehensive examples -- **[Rust SDK](/data-streams/reference/rust-sdk)** - High-performance SDK for Rust applications -- **[REST API](/data-streams/reference/interface-api)** or **[WebSocket](/data-streams/reference/interface-ws)** - Direct access to Data Streams endpoints +- **[Go SDK](/data-streams/reference/data-streams-api/go-sdk)** - Full-featured SDK with comprehensive examples +- **[Rust SDK](/data-streams/reference/data-streams-api/rust-sdk)** - High-performance SDK for Rust applications +- **[REST API](/data-streams/reference/data-streams-api/interface-api)** or **[WebSocket](/data-streams/reference/data-streams-api/interface-ws)** - Direct access to Data Streams endpoints ### Getting started @@ -90,7 +90,7 @@ Access data directly through REST APIs or WebSocket connections using our SDKs: 1. Try the API: Follow our [hands-on tutorial](/data-streams/tutorials/api-go) to fetch and decode your first report. -1. Implement Verification: Add [onchain verification](/data-streams/reference/onchain-verification) to ensure data authenticity in your smart contracts. +1. Implement Verification: Add [onchain verification](/data-streams/reference/data-streams-api/onchain-verification) to ensure data authenticity in your smart contracts. ### Streams Trade: An alternative implementation diff --git a/src/content/data-streams/reference/candlestick-api/index.mdx b/src/content/data-streams/reference/candlestick-api/index.mdx new file mode 100644 index 00000000000..0149066cd4a --- /dev/null +++ b/src/content/data-streams/reference/candlestick-api/index.mdx @@ -0,0 +1,303 @@ +--- +section: dataStreams +date: July 30, 2025 +title: "Data Streams Candlestick API" +metadata: + title: "Data Streams Candlestick API Reference | Chainlink Documentation" + description: "Reference for the Chainlink Data Streams Candlestick API. Learn how to authenticate, list available symbols, query historical candlestick (OHLC) data, and stream live price updates over HTTP." + keywords: ["Candlestick API", "OHLC", "HTTP Rest API", "API Client"] +--- + +import DataStreams from "@features/data-streams/common/DataStreams.astro" +import { CopyText } from "@components" + + + +The Candlestick API provides open-high-low-close (OHLC) aggregated trading data. + +OHLC data is provided in two formats: [the standard OHLCV format](#get-candlestick-data-row-format), widely used by retail crypto exchanges, ideal for human readability and compatibility; [and the columnar format](#get-candlestick-data-column-format), preferred by HFT systems, optimized for efficient, large-scale data processing. + +The API provides both historical candlestick data through the [history endpoints](#get-candlestick-data-column-format) (updated every minute) and live price updates through the [streaming endpoint](#get-streaming-price-updates) (updated every second). + +## Domains + +|
Description
| Testnet URL | Mainnet URL | +| :------------------------------------------- | :---------------------------------------------------------------------- | :-------------------------------------------------------------- | +| Candlestick API endpoint | | | + +## API Endpoints + +### Authorize and get token + +##### Endpoint + +**`/api/v1/authorize`** + +| Type | Description | Parameter(s) | +| :-------- | :------------------------------------------------ | :------------------------------------------------------------------------------ | +| HTTP POST | Authorizes a user and returns a JWT access token. |
  • `login`: The user ID.
  • `password`: The user's API key.
| + +##### Sample request + +```bash +curl -X POST \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -d "login={YOUR_USER_ID}&password={YOUR_API_KEY}" \ + https://priceapi.testnet-dataengine.chain.link/api/v1/authorize +``` + +##### Response + +- **Status**: `200` + + ```json + { + "d": { + "access_token": "[ACCESS_TOKEN]", + "expiration": 1747203979 + }, + "s": "ok" + } + ``` + + | Field | Type | Description | + | :------------- | :------- | :---------------------------------------- | + | `s` | `string` | The status of the request. | + | `d` | `object` | The data returned by the API call. | + | `access_token` | `string` | The JWT token for subsequent requests. | + | `expiration` | `number` | The expiry timestamp (unix) of the token. | + +##### Error Responses + +| Status Code | Error Message | Description | +| :---------- | :------------------------------------------------------------------------------ | :---------------------------------------- | +| `400` | `Parse error - Login: missing required field, Password: missing required field` | A required field was missing. | +| `401` | `Unauthorized - Invalid credentials` | The user password (API key) is incorrect. | +| `404` | `Not found - user not found for id {USER_ID}` | The user login was not found. | +| `500` | `Error - Failed to generate token` | The server failed to create a token. | + +### Get list of supported symbols + +##### Endpoint + +**`/api/v1/symbol_info`** + +| Type | Description | Parameter(s) | +| :------- | :------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | +| HTTP GET | Gets a list of all supported symbols on the environment. |
  • `group` (optional): Filter symbols by group. Currently only supports "crypto".
| + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + https://priceapi.testnet-dataengine.chain.link/api/v1/symbol_info +``` + +##### Response + +- **Status**: `200` + + ```json + { + "s": "ok", + "symbol": ["ETHUSD", "BTCUSD"], + "currency": ["USD", "USD"], + "base-currency": ["ETH", "BTC"] + } + ``` + + | Field | Type | Description | + | :-------------- | :------- | :------------------------------- | + | `s` | `string` | The status of the request. | + | `symbol` | `array` | Array of supported symbols. | + | `currency` | `array` | Array of symbol currencies. | + | `base-currency` | `array` | Array of symbol base currencies. | + +##### Error Responses + +| Status Code | Error Message | Description | +| :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | +| `401` | `Unauthorized - Authorization header is required \|\| Invalid authorization header format \|\| token signature is invalid: signature is invalid \|\| ...` | The authorization header was missing or invalid. | +| `500` | `Error - Something went wrong` | An unexpected server error occurred. | + +### Get candlestick data (column format) + +##### Endpoint + +**`/api/v1/history`** + +| Type | Description | Parameter(s) | +| :------- | :-------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| HTTP GET | Gets candlestick data in column format. |
  • `symbol`: The symbol to query.
  • `resolution`: Resolution of the data (required but not used, use "1m").
  • `from`: Unix timestamp of the leftmost required bar (inclusive).
  • `to`: Unix timestamp of the rightmost required bar (inclusive).
| + +**Note**: The resolution of the data is currently based on the size of the time window: + +| Max time window size | Resolution of candles | +| :------------------- | :-------------------- | +| \<= 24 hours | 1 minute | +| \<= 5 days | 5 minutes | +| \<= 30 days | 30 minutes | +| \<= 90 days | 1 hour | +| \<= 6 months | 2 hours | +| > 6 months | 1 day | + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + "https://priceapi.testnet-dataengine.chain.link/api/v1/history?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" +``` + +##### Response + +- **Status**: `200` + + ```json + { + "s": "ok", + "t": [1746158460, 1746158400, 1746158340], + "c": [1.84685e21, 1.848515087189567e21, 1.8490380305e21, 1.8481266e21], + "o": [1.8483674e21, 1.848602513e21, 1.8481267e21], + "h": [1.8498753129131415e21, 1.848875387e21, 1.8490380305e21], + "l": [1.8468008021426886e21, 1.848243519e21, 1.8475677870725296e21], + "v": [] + } + ``` + + | Field | Type | Description | + | :---- | :------- | :--------------------------------------------------------------------- | + | `s` | `string` | The status of the request. | + | `t` | `array` | Array of unix timestamps (the time of each candle). | + | `c` | `array` | Array of numbers (the close (last) value of each candle). | + | `o` | `array` | Array of numbers (the open (first) value of each candle). | + | `h` | `array` | Array of numbers (the high (max) value of each candle). | + | `l` | `array` | Array of numbers (the low (min) value of each candle). | + | `v` | `array` | Array of numbers (the volume of each candle. Not currently supported). | + + > **Note**: If candles cannot be found for the given symbol/time period, a response with empty arrays will be provided. E.g., `{ "s": "ok", "t": [], "c": [], "o": [], "h": [], "l": [], "v": [] }` + +##### Error Responses + +| Status Code | Error Message | Description | +| :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | +| `400` | `Parse error xxx: missing required field` | A required parameter was missing. | +| `401` | `Unauthorized - Authorization header is required \|\| Invalid authorization header format \|\| token signature is invalid: signature is invalid \|\| ...` | The authorization header was missing or invalid. | +| `404` | `Not found- Could not find feedID for symbol` | The provided symbol is not supported. | +| `500` | `Something went wrong. Please try again later.` | An unexpected server error occurred. | + +### Get candlestick data (row format) + +##### Endpoint + +**`/api/v1/history/rows`** + +| Type | Description | Parameter(s) | +| :------- | :----------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| HTTP GET | Gets candlestick data in row format. |
  • `symbol`: The symbol to query.
  • `resolution`: Resolution of the data (required but not used, use "1m").
  • `from`: Unix timestamp of the leftmost required bar (inclusive).
  • `to`: Unix timestamp of the rightmost required bar (inclusive).
| + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + "https://priceapi.testnet-dataengine.chain.link/api/v1/history/rows?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468" +``` + +##### Response + +- **Status**: `200` + + ```json + { + "s": "ok", + "candles": [ + [1746158460, 1.8483674e21, 1.8498753129131415e21, 1.8468008021426886e21, 1.84685e21, 0], + [1746158400, 1.848602513e21, 1.848875387e21, 1.848243519e21, 1.848515087189567e21, 0], + [1746158340, 1.8481267e21, 1.8490380305e21, 1.8475677870725296e21, 1.8490380305e21, 0] + ] + } + ``` + + |
Field
|
Type
| Description | + | :------------------------------------ | :----------------------------------- | :-------------------------------------------------------------------------------------------------- | + | `s` | `string` | The status of the request. | + | `candles` | `array` | Array of arrays of numbers. Each array candle contains: `[ time, open, high, low, close, volume ]`. | + + > **Note**: If candles cannot be found for the given symbol/time period, a response with an empty `candles` array is provided. E.g., `{ "s": "ok", "candles": [] }` + +##### Error Responses + +| Status Code | Error Message | Description | +| :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | +| `400` | `Parse error xxx: missing required field` | A required parameter was missing. | +| `401` | `Unauthorized - Authorization header is required \|\| Invalid authorization header format \|\| token signature is invalid: signature is invalid \|\| ...` | The authorization header was missing or invalid. | +| `404` | `Not found- Could not find feedID for symbol` | The provided symbol is not supported. | +| `500` | `Something went wrong. Please try again later.` | An unexpected server error occurred. | + +### Get streaming price updates + +##### Endpoint + +**`/api/v1/streaming`** + +| Type | Description | Parameter(s) | +| :------- | :-------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | +| HTTP GET | Gets streaming price updates using HTTP chunked encoding. |
  • `symbol` or `feedId`: A comma-separated list of symbols or feed IDs to stream.
| + +##### Sample request + +```bash +curl -X GET \ + -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \ + -H "Connection: keep-alive" \ + "https://priceapi.testnet-dataengine.chain.link/api/v1/streaming?symbol=ETHUSD,BTCUSD" +``` + +##### Response + +- **Status**: `200` (Streaming) + + A stream of JSON objects. + + **Trade Response:** + + ```json + { + "f": "t", + "i": "ETHUSD", + "fid": "[FEED_ID]", + "p": 2.68312e21, + "t": 1748525526, + "s": 1 + } + ``` + + | Field | Type | Description | + | :---- | :-------- | :------------------------------------------------------------- | + | `f` | `string` | Message type. Will always be “t” to indicate a trade response. | + | `i` | `string` | Identifier. The symbol for this response. | + | `fid` | `string` | The hex-encoded feed ID for this response. | + | `p` | `float64` | The latest price update for the symbol/feedId. | + | `t` | `float64` | The time of the price as a unix timestamp. | + | `s` | `float64` | Size of the trade. This will always be 1. | + + **Heartbeat (sent every 5 seconds):** + + ```json + { "heartbeat": 1748525528 } + ``` + + | Field | Type | Description | + | :---------- | :-------- | :----------------------------------------------------- | + | `heartbeat` | `float64` | The time of the heartbeat message as a unix timestamp. | + +##### Error Responses + +| Status Code | Error Message | Description | +| :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------- | +| `400` | `Parse error xxx: One of symbol or feedId must be provided` | A required parameter was missing. | +| `401` | `Unauthorized - Authorization header is required \|\| Invalid authorization header format \|\| token signature is invalid: signature is invalid \|\| ...` | The authorization header was missing or invalid. | +| `404` | `Not found- Could not find feedID for symbol` | The provided symbol is not supported. | +| `500` | `Something went wrong. Please try again later.` | An unexpected server error occurred. | diff --git a/src/content/data-streams/reference/authentication/go-examples.mdx b/src/content/data-streams/reference/data-streams-api/authentication/go-examples.mdx similarity index 96% rename from src/content/data-streams/reference/authentication/go-examples.mdx rename to src/content/data-streams/reference/data-streams-api/authentication/go-examples.mdx index 13b9b6a54de..e51d4aec446 100644 --- a/src/content/data-streams/reference/authentication/go-examples.mdx +++ b/src/content/data-streams/reference/data-streams-api/authentication/go-examples.mdx @@ -15,9 +15,9 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" Below are complete examples for authenticating with the Data Streams API in Go. Each example shows how to properly generate the required headers and make a request. -To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/authentication) page. +To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/go-sdk) or [Rust SDK](/data-streams/reference/rust-sdk), you don't need to implement the authentication logic manually. +**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) or [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk), you don't need to implement the authentication logic manually. ## API Authentication Example @@ -223,7 +223,7 @@ While this example demonstrates the authentication mechanism, production applica - **Error types**: Define custom error types for better error handling - **Testing**: Add unit tests for HMAC generation and integration tests -For production use, consider using the [Go SDK](/data-streams/reference/go-sdk) which handles authentication automatically and provides built-in fault tolerance. +For production use, consider using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) which handles authentication automatically and provides built-in fault tolerance. ## WebSocket Authentication Example @@ -508,4 +508,4 @@ While this example already includes many production-ready features (keepalive, t - **Health checks**: Expose WebSocket connection status for monitoring systems - **Testing**: Add unit tests for HMAC generation and mock WebSocket server for integration tests -For production use, consider using the [Go SDK](/data-streams/reference/go-sdk) which handles authentication automatically and provides built-in fault tolerance for streaming connections. +For production use, consider using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) which handles authentication automatically and provides built-in fault tolerance for streaming connections. diff --git a/src/content/data-streams/reference/authentication/index.mdx b/src/content/data-streams/reference/data-streams-api/authentication/index.mdx similarity index 86% rename from src/content/data-streams/reference/authentication/index.mdx rename to src/content/data-streams/reference/data-streams-api/authentication/index.mdx index dbc96df440d..1d754cbeb85 100644 --- a/src/content/data-streams/reference/authentication/index.mdx +++ b/src/content/data-streams/reference/data-streams-api/authentication/index.mdx @@ -8,10 +8,10 @@ metadata: keywords: ["Authentication", "HMAC", "API Key", "API Secret", "Signature", "Security", "Data Streams"] whatsnext: { - "Learn about the REST API Interface": "/data-streams/reference/interface-api", - "Learn about the WebSocket Interface": "/data-streams/reference/interface-ws", - "Explore the Go SDK": "/data-streams/reference/go-sdk", - "Explore the Rust SDK": "/data-streams/reference/rust-sdk", + "Learn about the REST API Interface": "/data-streams/reference/data-streams-api/interface-api", + "Learn about the WebSocket Interface": "/data-streams/reference/data-streams-api/interface-ws", + "Explore the Go SDK": "/data-streams/reference/data-streams-api/go-sdk", + "Explore the Rust SDK": "/data-streams/reference/data-streams-api/rust-sdk", } isIndex: true --- @@ -26,8 +26,9 @@ This page explains how to authenticate with the Chainlink Data Streams API, cove ## Authentication Requirements @@ -114,10 +115,10 @@ Even for GET requests and WebSocket connections, you need to include a body hash Below are complete examples for authenticating with the Data Streams API in various languages. Each example shows how to properly generate the required headers and make a request. -- [JavaScript examples](/data-streams/reference/authentication/javascript-examples) -- [TypeScript examples](/data-streams/reference/authentication/typescript-examples) -- [Go examples](/data-streams/reference/authentication/go-examples) -- [Rust examples](/data-streams/reference/authentication/rust-examples) +- [JavaScript examples](/data-streams/reference/data-streams-api/authentication/javascript-examples) +- [TypeScript examples](/data-streams/reference/data-streams-api/authentication/typescript-examples) +- [Go examples](/data-streams/reference/data-streams-api/authentication/go-examples) +- [Rust examples](/data-streams/reference/data-streams-api/authentication/rust-examples) ## Common Authentication Errors @@ -130,8 +131,8 @@ When working with the Data Streams API, the most common authentication issues in For complete information on all possible error responses: -- [REST API Error Response Codes](/data-streams/reference/interface-api#error-response-codes) -- [WebSocket Error Response Codes](/data-streams/reference/interface-ws#error-response-codes) +- [REST API Error Response Codes](/data-streams/reference/data-streams-api/interface-api#error-response-codes) +- [WebSocket Error Response Codes](/data-streams/reference/data-streams-api/interface-ws#error-response-codes) ## Troubleshooting Authentication diff --git a/src/content/data-streams/reference/authentication/javascript-examples.mdx b/src/content/data-streams/reference/data-streams-api/authentication/javascript-examples.mdx similarity index 98% rename from src/content/data-streams/reference/authentication/javascript-examples.mdx rename to src/content/data-streams/reference/data-streams-api/authentication/javascript-examples.mdx index f0b5384435d..ed71c834d58 100644 --- a/src/content/data-streams/reference/authentication/javascript-examples.mdx +++ b/src/content/data-streams/reference/data-streams-api/authentication/javascript-examples.mdx @@ -15,9 +15,9 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" Below are complete examples for authenticating with the Data Streams API in JavaScript, using Node.js. Each example shows how to properly generate the required headers and make a request. -To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/authentication) page. +To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/go-sdk) or [Rust SDK](/data-streams/reference/rust-sdk), you don't need to implement the authentication logic manually. +**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) or [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk), you don't need to implement the authentication logic manually. ## API Authentication Example diff --git a/src/content/data-streams/reference/authentication/rust-examples.mdx b/src/content/data-streams/reference/data-streams-api/authentication/rust-examples.mdx similarity index 97% rename from src/content/data-streams/reference/authentication/rust-examples.mdx rename to src/content/data-streams/reference/data-streams-api/authentication/rust-examples.mdx index 05dd5f2628f..cb5ce048b26 100644 --- a/src/content/data-streams/reference/authentication/rust-examples.mdx +++ b/src/content/data-streams/reference/data-streams-api/authentication/rust-examples.mdx @@ -15,9 +15,9 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" Below are complete examples for authenticating with the Data Streams API in Rust. Each example shows how to properly generate the required headers and make a request. -To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/authentication) page. +To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/go-sdk) or [Rust SDK](/data-streams/reference/rust-sdk), you don't need to implement the authentication logic manually. +**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) or [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk), you don't need to implement the authentication logic manually. ## API Authentication Example @@ -229,7 +229,7 @@ While this example demonstrates the authentication mechanism, production applica - **Resource management**: Implement graceful shutdown for long-running connections - **Testing**: Add unit tests for HMAC generation and integration tests for API calls -For production use, consider using the [Rust SDK](/data-streams/reference/rust-sdk) which handles authentication automatically and provides built-in fault tolerance. +For production use, consider using the [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk) which handles authentication automatically and provides built-in fault tolerance. ## WebSocket Authentication Example @@ -530,4 +530,4 @@ While this example demonstrates WebSocket authentication, production application - **Graceful shutdown**: Properly close WebSocket connections with close frames - **Testing**: Add tests for connection handling and message parsing -For production use, consider using the [Rust SDK](/data-streams/reference/rust-sdk) which handles authentication automatically and provides built-in fault tolerance. +For production use, consider using the [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk) which handles authentication automatically and provides built-in fault tolerance. diff --git a/src/content/data-streams/reference/authentication/typescript-examples.mdx b/src/content/data-streams/reference/data-streams-api/authentication/typescript-examples.mdx similarity index 98% rename from src/content/data-streams/reference/authentication/typescript-examples.mdx rename to src/content/data-streams/reference/data-streams-api/authentication/typescript-examples.mdx index 7045a8746e8..ca48796733e 100644 --- a/src/content/data-streams/reference/authentication/typescript-examples.mdx +++ b/src/content/data-streams/reference/data-streams-api/authentication/typescript-examples.mdx @@ -15,9 +15,9 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" Below are complete examples for authenticating with the Data Streams API in TypeScript, using Node.js. Each example shows how to properly generate the required headers and make a request. -To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/authentication) page. +To learn more about the Data Streams API authentication, see the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/go-sdk) or [Rust SDK](/data-streams/reference/rust-sdk), you don't need to implement the authentication logic manually. +**Note**: The Data Streams SDKs handle authentication automatically. If you're using the [Go SDK](/data-streams/reference/data-streams-api/go-sdk) or [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk), you don't need to implement the authentication logic manually. ## API Authentication Example diff --git a/src/content/data-streams/reference/go-sdk.mdx b/src/content/data-streams/reference/data-streams-api/go-sdk.mdx similarity index 97% rename from src/content/data-streams/reference/go-sdk.mdx rename to src/content/data-streams/reference/data-streams-api/go-sdk.mdx index d8d35a725b6..9cdadc65606 100644 --- a/src/content/data-streams/reference/go-sdk.mdx +++ b/src/content/data-streams/reference/data-streams-api/go-sdk.mdx @@ -24,12 +24,12 @@ import { PageTabs } from "@components" pages={[ { name: "Go SDK", - url: "/data-streams/reference/go-sdk", + url: "/data-streams/reference/data-streams-api/go-sdk", icon: "/images/tutorial-icons/go_logo_black.png", }, { name: "Rust SDK", - url: "/data-streams/reference/rust-sdk", + url: "/data-streams/reference/data-streams-api/rust-sdk", icon: "/images/tutorial-icons/rust_logo_blk.svg", }, ]} @@ -49,7 +49,7 @@ import streams "github.com/smartcontractkit/data-streams-sdk/go" #### `Client` interface -[Interface](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L21) for interacting with the Data Streams API. Use the [`New`](/data-streams/reference/go-sdk#new) function to create a new instance of the client. +[Interface](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L21) for interacting with the Data Streams API. Use the [`New`](/data-streams/reference/data-streams-api/go-sdk#new) function to create a new instance of the client. ###### Interface Methods @@ -141,7 +141,7 @@ type ReportPage struct { #### `ReportResponse` struct -Implements the report envelope that contains the full report payload, its stream ID and timestamps. Use the [`Decode`](/data-streams/reference/go-sdk#decode) function to decode the report payload. +Implements the report envelope that contains the full report payload, its stream ID and timestamps. Use the [`Decode`](/data-streams/reference/data-streams-api/go-sdk#decode) function to decode the report payload. ```go type ReportResponse struct { diff --git a/src/content/data-streams/reference/data-streams-api/index.mdx b/src/content/data-streams/reference/data-streams-api/index.mdx new file mode 100644 index 00000000000..632a323211f --- /dev/null +++ b/src/content/data-streams/reference/data-streams-api/index.mdx @@ -0,0 +1,43 @@ +--- +section: dataStreams +date: Last Modified +title: "Data Streams Reference" +isIndex: true +metadata: + title: "Data Streams Reference | API, SDK, and Integration Guide" + description: "Access comprehensive reference documentation for Chainlink Data Streams including API interfaces, SDK libraries, authentication guides, and report schemas." + keywords: ["Data Streams", "API Reference", "SDK", "WebSocket", "REST API", "Integration Guide"] +--- + +import DataStreams from "@features/data-streams/common/DataStreams.astro" + + + +### API Interfaces + +- [REST API](/data-streams/reference/data-streams-api/interface-api) - HTTP-based interface for simple integrations +- [WebSocket](/data-streams/reference/data-streams-api/interface-ws) - Real-time data streaming via WebSocket connection + +### SDK Integration + +- [Go SDK](/data-streams/reference/data-streams-api/go-sdk) - Native Go language integration +- [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk) - Native Rust language integration + +### Authentication + +- [Authentication](/data-streams/reference/data-streams-api/authentication) - Learn how to authenticate with the Data Streams API (not required if using the SDKs) + - [JavaScript examples](/data-streams/reference/data-streams-api/authentication/javascript-examples) + - [TypeScript examples](/data-streams/reference/data-streams-api/authentication/typescript-examples) + - [Go examples](/data-streams/reference/data-streams-api/authentication/go-examples) + - [Rust examples](/data-streams/reference/data-streams-api/authentication/rust-examples) + +### Verification + +#### EVM chains + +- [Onchain report data verification](/data-streams/reference/data-streams-api/onchain-verification) - Verify the authenticity of received data on EVM chains + +#### Solana + +- [Verify reports using the onchain integration method](/data-streams/tutorials/solana-onchain-report-verification) +- [Verify reports using the offchain integration method](/data-streams/tutorials/solana-offchain-report-verification) diff --git a/src/content/data-streams/reference/interface-api.mdx b/src/content/data-streams/reference/data-streams-api/interface-api.mdx similarity index 93% rename from src/content/data-streams/reference/interface-api.mdx rename to src/content/data-streams/reference/data-streams-api/interface-api.mdx index 9507efeab0f..15968e84401 100644 --- a/src/content/data-streams/reference/interface-api.mdx +++ b/src/content/data-streams/reference/data-streams-api/interface-api.mdx @@ -9,20 +9,21 @@ metadata: --- import DataStreams from "@features/data-streams/common/DataStreams.astro" +import { CopyText } from "@components" ## Domains -| Description | Testnet URL | Mainnet URL | -| --------------------------------------- | ----------------------------------------- | --------------------------------- | -| REST endpoint to query specific reports | https://api.testnet-dataengine.chain.link | https://api.dataengine.chain.link | +| Description | Testnet URL | Mainnet URL | +| :------------ | :----------------------------------------------------------------- | :--------------------------------------------------------- | +| REST endpoint | | | ## Authentication -All requests to the Data Streams REST API require authentication. For comprehensive documentation on generating authentication headers and implementing the HMAC authentication process, please refer to the [Data Streams Authentication](/data-streams/reference/authentication) page. +All requests to the Data Streams REST API require authentication. For comprehensive documentation on generating authentication headers and implementing the HMAC authentication process, please refer to the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: If you're using a [Data Streams SDK](/data-streams/reference/go-sdk), you don't need to manually generate authentication headers. +**Note**: If you're using a [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk), you don't need to manually generate authentication headers. ### Headers diff --git a/src/content/data-streams/reference/interface-ws.mdx b/src/content/data-streams/reference/data-streams-api/interface-ws.mdx similarity index 87% rename from src/content/data-streams/reference/interface-ws.mdx rename to src/content/data-streams/reference/data-streams-api/interface-ws.mdx index e9d15e0ac92..43355395f54 100644 --- a/src/content/data-streams/reference/interface-ws.mdx +++ b/src/content/data-streams/reference/data-streams-api/interface-ws.mdx @@ -10,20 +10,21 @@ metadata: --- import DataStreams from "@features/data-streams/common/DataStreams.astro" +import { CopyText } from "@components" ## Domains -| Description | Testnet URL | Mainnet URL | -| ------------------------------------------------ | -------------------------------------- | ------------------------------ | -| WebSocket endpoint to subscribe to price updates | wss://ws.testnet-dataengine.chain.link | wss://ws.dataengine.chain.link | +| Description | Testnet URL | Mainnet URL | +| :----------------- | :-------------------------------------------------------------- | :------------------------------------------------------ | +| WebSocket endpoint | | | ## Authentication -All connections to the Data Streams WebSocket API require authentication. For comprehensive documentation on generating authentication headers and implementing the HMAC authentication process, please refer to the [Data Streams Authentication](/data-streams/reference/authentication) page. +All connections to the Data Streams WebSocket API require authentication. For comprehensive documentation on generating authentication headers and implementing the HMAC authentication process, please refer to the [Data Streams Authentication](/data-streams/reference/data-streams-api/authentication) page. -**Note**: If you're using a [Data Streams SDK](/data-streams/reference/go-sdk), you don't need to manually generate authentication headers. +**Note**: If you're using a [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk), you don't need to manually generate authentication headers. ### Headers diff --git a/src/content/data-streams/reference/onchain-verification.mdx b/src/content/data-streams/reference/data-streams-api/onchain-verification.mdx similarity index 100% rename from src/content/data-streams/reference/onchain-verification.mdx rename to src/content/data-streams/reference/data-streams-api/onchain-verification.mdx diff --git a/src/content/data-streams/reference/rust-sdk.mdx b/src/content/data-streams/reference/data-streams-api/rust-sdk.mdx similarity index 98% rename from src/content/data-streams/reference/rust-sdk.mdx rename to src/content/data-streams/reference/data-streams-api/rust-sdk.mdx index 5e1277e4856..a57e34cc929 100644 --- a/src/content/data-streams/reference/rust-sdk.mdx +++ b/src/content/data-streams/reference/data-streams-api/rust-sdk.mdx @@ -24,12 +24,12 @@ import { PageTabs } from "@components" pages={[ { name: "Go SDK", - url: "/data-streams/reference/go-sdk", + url: "/data-streams/reference/data-streams-api/go-sdk", icon: "/images/tutorial-icons/go_logo_black.png", }, { name: "Rust SDK", - url: "/data-streams/reference/rust-sdk", + url: "/data-streams/reference/data-streams-api/rust-sdk", icon: "/images/tutorial-icons/rust_logo_blk.svg", }, ]} diff --git a/src/content/data-streams/reference/overview.mdx b/src/content/data-streams/reference/overview.mdx index 32a5bc9e69c..23005d27422 100644 --- a/src/content/data-streams/reference/overview.mdx +++ b/src/content/data-streams/reference/overview.mdx @@ -4,40 +4,73 @@ date: Last Modified title: "Data Streams Reference" isIndex: true metadata: - title: "Data Streams Reference | API, SDK, and Integration Guide" + title: "Data Streams Reference" description: "Access comprehensive reference documentation for Chainlink Data Streams including API interfaces, SDK libraries, authentication guides, and report schemas." keywords: ["Data Streams", "API Reference", "SDK", "WebSocket", "REST API", "Integration Guide"] --- -import DataStreams from "@features/data-streams/common/DataStreams.astro" +Chainlink Data Streams offers two distinct solutions for accessing low-latency market data. Choose the solution that best fits your use case. - +### Which solution should I use? -### API Interfaces +| Feature | [Data Streams API](#data-streams-api) | [Candlestick API](#candlestick-api) | +| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Primary Use Case** | Low-latency data for smart contracts | OHLC data for analytics, charting, and dashboards | +| **Data Format** | Signed, verifiable data reports | Aggregated OHLC (candlestick) data | +| **Interfaces** | SDKs ([Go](/data-streams/reference/data-streams-api/go-sdk), [Rust](/data-streams/reference/data-streams-api/rust-sdk)), [REST API](/data-streams/reference/data-streams-api/interface-api) & [WebSocket](/data-streams/reference/data-streams-api/interface-ws) | [REST API](/data-streams/reference/candlestick-api) (including a [streaming endpoint](/data-streams/reference/candlestick-api#get-streaming-price-updates)) | +| **Authentication** | [HMAC Signature](/data-streams/reference/data-streams-api/authentication) (automatic with SDKs) | [JWT](/data-streams/reference/candlestick-api#authorize-and-get-token) (token-based) | +| **Cryptographic Proof** | ✅ Yes (See [Verification methods](#verification)) | ❌ No | -- [REST API](/data-streams/reference/interface-api) - HTTP-based interface for simple integrations -- [WebSocket](/data-streams/reference/interface-ws) - Real-time data streaming via WebSocket connection +--- -### SDK Integration +## Data Streams API -- [Go SDK](/data-streams/reference/go-sdk) - Native Go language integration -- [Rust SDK](/data-streams/reference/rust-sdk) - Native Rust language integration +The [Data Streams API](/data-streams/reference/data-streams-api) provides cryptographically signed, verifiable data reports that can be used for onchain consumption by smart contracts. This comprehensive solution offers multiple integration paths to support applications that require low-latency, tamper-proof data. -### Authentication +### Integration Methods + +#### SDKs (Recommended) + +- [Go SDK](/data-streams/reference/data-streams-api/go-sdk) - Native Go language integration +- [Rust SDK](/data-streams/reference/data-streams-api/rust-sdk) - Native Rust language integration + +#### Direct API Access + +- [REST API](/data-streams/reference/data-streams-api/interface-api) - HTTP-based interface for simple integrations +- [WebSocket](/data-streams/reference/data-streams-api/interface-ws) - Real-time data streaming via WebSocket connection + +#### Authentication + +- [Authentication Guides](/data-streams/reference/data-streams-api/authentication) - HMAC signature implementation examples (not required when using SDKs) + +#### Verification + +##### EVM chains -- [Authentication](/data-streams/reference/authentication) - Learn how to authenticate with the Data Streams API (not required if using the SDKs) - - [JavaScript examples](/data-streams/reference/authentication/javascript-examples) - - [TypeScript examples](/data-streams/reference/authentication/typescript-examples) - - [Go examples](/data-streams/reference/authentication/go-examples) - - [Rust examples](/data-streams/reference/authentication/rust-examples) +- [Onchain report data verification](/data-streams/reference/data-streams-api/onchain-verification) - Verify the authenticity of received data on EVM chains -### Verification +##### Solana -#### EVM chains +- [Verify reports using the onchain integration method](/data-streams/tutorials/solana-onchain-report-verification) - Verify reports directly within your Solana program +- [Verify reports using the offchain integration method](/data-streams/tutorials/solana-offchain-report-verification) - Verify reports client-side using the Rust SDK -- [Onchain report data verification](/data-streams/reference/onchain-verification) - Verify the authenticity of received data on EVM chains +**[View the Data Streams API Reference →](/data-streams/reference/data-streams-api)** + +--- + +## Candlestick API + +The [Candlestick API](/data-streams/reference/candlestick-api) provides historical and real-time OHLC (Open-High-Low-Close) data designed for offchain applications. This API has been optimized for analytics, charting, and dashboard applications. + +### Integration Methods + +#### Direct API Access + +- [REST API](/data-streams/reference/candlestick-api) - Access historical OHLC data via HTTP + - [Streaming Endpoint](/data-streams/reference/candlestick-api#get-streaming-price-updates) - Get real-time price updates + +### Authentication -#### Solana +- [Authentication Endpoint](/data-streams/reference/candlestick-api#authorize-and-get-token) - JWT token-based authentication -- [Verify reports using the onchain integration method](/data-streams/tutorials/solana-onchain-report-verification) -- [Verify reports using the offchain integration method](/data-streams/tutorials/solana-offchain-report-verification) +**[View the Candlestick API Reference →](/data-streams/reference/candlestick-api)** diff --git a/src/content/data-streams/tutorials/api-go.mdx b/src/content/data-streams/tutorials/api-go.mdx index b6b6bdd7b4c..e762b7807d6 100644 --- a/src/content/data-streams/tutorials/api-go.mdx +++ b/src/content/data-streams/tutorials/api-go.mdx @@ -9,7 +9,7 @@ metadata: whatsnext: { "Learn how to stream and decode reports via a WebSocket connection": "/data-streams/tutorials/ws-go", - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/crypto-streams", } --- @@ -44,7 +44,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/go-sdk) for Go to fetch and decode [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) from the Data Streams Aggregation Network. You'll set up your Go project, retrieve reports, decode them, and log their attributes. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk) for Go to fetch and decode [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) from the Data Streams Aggregation Network. You'll set up your Go project, retrieve reports, decode them, and log their attributes. @@ -214,9 +214,9 @@ You'll start with the set up of your Go project. Next, you'll fetch and decode r Replace `` and `` with your API credentials. - - `RestURL` is the REST endpoint to poll for specific reports. See the [Data Streams Interface](/data-streams/reference/interface-api#domains) page for more information. + - `RestURL` is the REST endpoint to poll for specific reports. See the [Data Streams Interface](/data-streams/reference/data-streams-api/interface-api#domains) page for more information. - See the [SDK Reference](/data-streams/reference/go-sdk#config-struct) page for more configuration options. + See the [SDK Reference](/data-streams/reference/data-streams-api/go-sdk#config-struct) page for more configuration options. 1. For this example, you will read from the ETH/USD crypto stream. This stream ID is . See the [Stream Addresses](/data-streams/crypto-streams) page for a complete list of available crypto assets. diff --git a/src/content/data-streams/tutorials/api-rust.mdx b/src/content/data-streams/tutorials/api-rust.mdx index d63e42d7f60..21710985e7f 100644 --- a/src/content/data-streams/tutorials/api-rust.mdx +++ b/src/content/data-streams/tutorials/api-rust.mdx @@ -9,7 +9,7 @@ metadata: whatsnext: { "Learn how to stream and decode reports via a WebSocket connection": "/data-streams/tutorials/ws-rust", - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/crypto-streams", } --- @@ -44,7 +44,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/rust-sdk) for Rust to fetch and decode [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) from the Data Streams Aggregation Network. You'll set up your Rust project, retrieve reports, decode them, and log their attributes. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/rust-sdk) for Rust to fetch and decode [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) from the Data Streams Aggregation Network. You'll set up your Rust project, retrieve reports, decode them, and log their attributes. diff --git a/src/content/data-streams/tutorials/api-rwa-go.mdx b/src/content/data-streams/tutorials/api-rwa-go.mdx index a683ff3df5d..66d1502c3d4 100644 --- a/src/content/data-streams/tutorials/api-rwa-go.mdx +++ b/src/content/data-streams/tutorials/api-rwa-go.mdx @@ -9,7 +9,7 @@ metadata: whatsnext: { "Learn how to stream and decode reports via a WebSocket connection": "/data-streams/tutorials/ws-rwa-go", - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/rwa-streams", } --- @@ -44,7 +44,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/go-sdk) for Go to fetch and decode [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) from the Data Streams Aggregation Network. You'll set up your Go project, retrieve reports, decode them, and log their attributes. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk) for Go to fetch and decode [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) from the Data Streams Aggregation Network. You'll set up your Go project, retrieve reports, decode them, and log their attributes. @@ -216,9 +216,9 @@ You'll start with the set up of your Go project. Next, you'll fetch and decode r Replace `` and `` with your API credentials. - - `RestURL` is the REST endpoint to poll for specific reports. See the [Data Streams Interface](/data-streams/reference/interface-api#domains) page for more information. + - `RestURL` is the REST endpoint to poll for specific reports. See the [Data Streams Interface](/data-streams/reference/data-streams-api/interface-api#domains) page for more information. - See the [SDK Reference](/data-streams/reference/go-sdk#config-struct) page for more configuration options. + See the [SDK Reference](/data-streams/reference/data-streams-api/go-sdk#config-struct) page for more configuration options. 1. For this example, you will read from an RWA stream. See the [Data Streams RWA streams](/data-streams/rwa-streams) page for a complete list of available Real World Assets. diff --git a/src/content/data-streams/tutorials/api-rwa-rust.mdx b/src/content/data-streams/tutorials/api-rwa-rust.mdx index 269ffef79f6..61e0702bee1 100644 --- a/src/content/data-streams/tutorials/api-rwa-rust.mdx +++ b/src/content/data-streams/tutorials/api-rwa-rust.mdx @@ -10,7 +10,7 @@ metadata: whatsnext: { "Learn how to stream and decode reports via a WebSocket connection": "/data-streams/tutorials/ws-rwa-rust", - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/rwa-streams", } --- @@ -45,7 +45,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/rust-sdk) for Rust to fetch and decode [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) from the Data Streams Aggregation Network. You'll set up your Rust project, retrieve reports, decode them, and log their attributes. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/rust-sdk) for Rust to fetch and decode [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) from the Data Streams Aggregation Network. You'll set up your Rust project, retrieve reports, decode them, and log their attributes. diff --git a/src/content/data-streams/tutorials/evm-onchain-report-verification.mdx b/src/content/data-streams/tutorials/evm-onchain-report-verification.mdx index 7bd0e8cad66..dcffb29b792 100644 --- a/src/content/data-streams/tutorials/evm-onchain-report-verification.mdx +++ b/src/content/data-streams/tutorials/evm-onchain-report-verification.mdx @@ -42,7 +42,7 @@ In this tutorial, you'll learn how to verify onchain the integrity of reports by ## Before you begin -Make sure you understand how to fetch reports via the [REST API](/data-streams/reference/interface-api) or [WebSocket](/data-streams/reference/interface-ws) connection. Refer to the following tutorials for more information: +Make sure you understand how to fetch reports via the [REST API](/data-streams/reference/data-streams-api/interface-api) or [WebSocket](/data-streams/reference/data-streams-api/interface-ws) connection. Refer to the following tutorials for more information: - [Fetch and decode reports via a REST API](/data-streams/tutorials/api-go) - [Stream and decode reports via WebSocket](/data-streams/tutorials/ws-go) diff --git a/src/content/data-streams/tutorials/overview.mdx b/src/content/data-streams/tutorials/overview.mdx index 956f15d3ebe..b1f1227f053 100644 --- a/src/content/data-streams/tutorials/overview.mdx +++ b/src/content/data-streams/tutorials/overview.mdx @@ -18,14 +18,15 @@ Explore several tutorials to learn how to use the Data Streams. ## Fetch, Stream, and Decode Reports -- [Fetch and decode reports](/data-streams/tutorials/api-go): Learn how to fetch and decode reports from the Data Streams Aggregation Network, using the [Go](/data-streams/reference/go-sdk) or [Rust](/data-streams/reference/rust-sdk) SDKs. -- [Stream and decode reports (WebSocket)](/data-streams/tutorials/ws-go): Learn how to listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes, using the [Go](/data-streams/reference/go-sdk) or [Rust](/data-streams/reference/rust-sdk) SDKs. +- [Fetch and decode reports](/data-streams/tutorials/api-go): Learn how to fetch and decode reports from the Data Streams Aggregation Network, using the [Go](/data-streams/reference/data-streams-api/go-sdk) or [Rust](/data-streams/reference/data-streams-api/rust-sdk) SDKs. +- [Stream and decode reports (WebSocket)](/data-streams/tutorials/ws-go): Learn how to listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes, using the [Go](/data-streams/reference/data-streams-api/go-sdk) or [Rust](/data-streams/reference/data-streams-api/rust-sdk) SDKs. ## Verify Reports diff --git a/src/content/data-streams/tutorials/ws-go.mdx b/src/content/data-streams/tutorials/ws-go.mdx index 4e2fd2027a2..fc53afb53f9 100644 --- a/src/content/data-streams/tutorials/ws-go.mdx +++ b/src/content/data-streams/tutorials/ws-go.mdx @@ -8,7 +8,7 @@ metadata: keywords: ["WebSocket", "Go SDK", "Golang", "Real-time", "Streaming", "Crypto Data", "V3 Reports", "Data Streams"] whatsnext: { - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/crypto-streams", } --- @@ -43,7 +43,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/go-sdk) for Go to subscribe to real-time [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) via a [WebSocket connection](/data-streams/reference/interface-ws). You'll set up your Go project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk) for Go to subscribe to real-time [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) via a [WebSocket connection](/data-streams/reference/data-streams-api/interface-ws). You'll set up your Go project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. @@ -219,9 +219,9 @@ In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/r Replace `` and `` with your API credentials. - - `WsURL` is the [WebSocket URL](/data-streams/reference/interface-ws#domains) for the Data Streams Aggregation Network. Use for the testnet environment. + - `WsURL` is the [WebSocket URL](/data-streams/reference/data-streams-api/interface-ws#domains) for the Data Streams Aggregation Network. Use for the testnet environment. - See the [SDK Reference](/data-streams/reference/go-sdk#config-struct) page for more configuration options. + See the [SDK Reference](/data-streams/reference/data-streams-api/go-sdk#config-struct) page for more configuration options. 1. For this example, you'll subscribe to the ETH/USD Data Streams crypto stream. This stream ID is . See the [Crypto Streams](/data-streams/crypto-streams) page for a complete list of available crypto assets. @@ -323,7 +323,7 @@ production environment, you should verify the data to ensure its integrity and a ### Establishing a WebSocket connection and listening for reports -Your application uses the [Stream](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L98) function in the [Data Streams SDK](/data-streams/reference/go-sdk)'s client package to establish a real-time WebSocket connection with the Data Streams Aggregation Network. +Your application uses the [Stream](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L98) function in the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk)'s client package to establish a real-time WebSocket connection with the Data Streams Aggregation Network. Once the WebSocket connection is established, your application subscribes to one or more streams by passing an array of `feed.IDs` to the `Stream` function. This subscription lets the client receive real-time updates whenever new report data is available for the specified streams. diff --git a/src/content/data-streams/tutorials/ws-rust.mdx b/src/content/data-streams/tutorials/ws-rust.mdx index ff49af1f018..06216ec73af 100644 --- a/src/content/data-streams/tutorials/ws-rust.mdx +++ b/src/content/data-streams/tutorials/ws-rust.mdx @@ -8,7 +8,7 @@ metadata: keywords: ["WebSocket", "Rust SDK", "Data Streams", "Real-time data", "Crypto pricing", "Tutorial"] whatsnext: { - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/crypto-streams", } --- @@ -43,7 +43,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/rust-sdk) for Rust to subscribe to real-time [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) via a [WebSocket connection](/data-streams/reference/interface-ws). You'll set up your Rust project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/rust-sdk) for Rust to subscribe to real-time [V3 reports](/data-streams/reference/report-schema-v3) for [Crypto streams](/data-streams/crypto-streams) via a [WebSocket connection](/data-streams/reference/data-streams-api/interface-ws). You'll set up your Rust project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. diff --git a/src/content/data-streams/tutorials/ws-rwa-go.mdx b/src/content/data-streams/tutorials/ws-rwa-go.mdx index 95441edf9fa..bad7bba4a44 100644 --- a/src/content/data-streams/tutorials/ws-rwa-go.mdx +++ b/src/content/data-streams/tutorials/ws-rwa-go.mdx @@ -8,7 +8,7 @@ metadata: keywords: ["WebSocket", "Go SDK", "Real World Assets", "RWA", "V8 reports", "Data Streams", "Real-time data"] whatsnext: { - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/rwa-streams", } --- @@ -43,7 +43,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/go-sdk) for Go to subscribe to real-time [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) via a [WebSocket connection](/data-streams/reference/interface-ws). You'll set up your Go project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk) for Go to subscribe to real-time [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWAs) streams](/data-streams/rwa-streams) via a [WebSocket connection](/data-streams/reference/data-streams-api/interface-ws). You'll set up your Go project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. @@ -217,9 +217,9 @@ In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/r Replace `` and `` with your API credentials. - - `WsURL` is the [WebSocket URL](/data-streams/reference/interface-ws#domains) for the Data Streams Aggregation Network. Use for the testnet environment. + - `WsURL` is the [WebSocket URL](/data-streams/reference/data-streams-api/interface-ws#domains) for the Data Streams Aggregation Network. Use for the testnet environment. - See the [SDK Reference](/data-streams/reference/go-sdk#config-struct) page for more configuration options. + See the [SDK Reference](/data-streams/reference/data-streams-api/go-sdk#config-struct) page for more configuration options. 1. For this example, you'll subscribe to an RWA stream. See the [RWA Streams](/data-streams/rwa-streams) page for a complete list of available Real World Assets. @@ -321,7 +321,7 @@ production environment, you should verify the data to ensure its integrity and a ### Establishing a WebSocket connection and listening for reports -Your application uses the [Stream](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L98) function in the [Data Streams SDK](/data-streams/reference/go-sdk)'s client package to establish a real-time WebSocket connection with the Data Streams Aggregation Network. +Your application uses the [Stream](https://github.com/smartcontractkit/data-streams-sdk/blob/main/go/client.go#L98) function in the [Data Streams SDK](/data-streams/reference/data-streams-api/go-sdk)'s client package to establish a real-time WebSocket connection with the Data Streams Aggregation Network. Once the WebSocket connection is established, your application subscribes to one or more streams by passing an array of `feed.IDs` to the `Stream` function. This subscription lets the client receive real-time updates whenever new report data is available for the specified streams. diff --git a/src/content/data-streams/tutorials/ws-rwa-rust.mdx b/src/content/data-streams/tutorials/ws-rwa-rust.mdx index da0a79a843e..7856a1db2ba 100644 --- a/src/content/data-streams/tutorials/ws-rwa-rust.mdx +++ b/src/content/data-streams/tutorials/ws-rwa-rust.mdx @@ -8,7 +8,7 @@ metadata: keywords: ["WebSocket", "Rust SDK", "Real World Assets", "RWA", "V8 reports", "Data Streams"] whatsnext: { - "Learn how to verify your data onchain": "/data-streams/reference/onchain-verification", + "Learn how to verify your data onchain": "/data-streams/reference/data-streams-api/onchain-verification", "Find the list of available Stream IDs": "/data-streams/rwa-streams", } --- @@ -43,7 +43,7 @@ import DataStreams from "@features/data-streams/common/DataStreams.astro" ]} /> -In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/rust-sdk) for Rust to subscribe to real-time [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWA) streams](/data-streams/rwa-streams) via a [WebSocket connection](/data-streams/reference/interface-ws). You'll set up your Rust project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. +In this tutorial, you'll learn how to use the [Data Streams SDK](/data-streams/reference/data-streams-api/rust-sdk) for Rust to subscribe to real-time [V8 reports](/data-streams/reference/report-schema-v8) for [Real World Assets (RWA) streams](/data-streams/rwa-streams) via a [WebSocket connection](/data-streams/reference/data-streams-api/interface-ws). You'll set up your Rust project, listen for real-time reports from the Data Streams Aggregation Network, decode the report data, and log their attributes to your terminal. diff --git a/src/features/data-streams/common/asideOnChainVerification.mdx b/src/features/data-streams/common/asideOnChainVerification.mdx index 9c3bb209e7d..4b7c5c9abc4 100644 --- a/src/features/data-streams/common/asideOnChainVerification.mdx +++ b/src/features/data-streams/common/asideOnChainVerification.mdx @@ -3,5 +3,5 @@ import { Aside } from "@components" diff --git a/src/features/redirects/redirects.json b/src/features/redirects/redirects.json index 51a93f5fcab..65438d9da8e 100644 --- a/src/features/redirects/redirects.json +++ b/src/features/redirects/redirects.json @@ -1870,6 +1870,36 @@ "destination": "data-streams/reference/streams-direct/streams-direct-onchain-verification", "statuscode": 301 }, + { + "source": "data-streams/reference/interface-api", + "destination": "data-streams/reference/data-streams-api/interface-api", + "statusCode": 301 + }, + { + "source": "data-streams/reference/interface-ws", + "destination": "data-streams/reference/data-streams-api/interface-ws", + "statusCode": 301 + }, + { + "source": "data-streams/reference/onchain-verification", + "destination": "data-streams/reference/data-streams-api/onchain-verification", + "statusCode": 301 + }, + { + "source": "data-streams/reference/authentication", + "destination": "data-streams/reference/data-streams-api/authentication", + "statusCode": 301 + }, + { + "source": "data-streams/reference/go-sdk", + "destination": "data-streams/reference/data-streams-api/go-sdk", + "statusCode": 301 + }, + { + "source": "data-streams/reference/rust-sdk", + "destination": "data-streams/reference/data-streams-api/rust-sdk", + "statusCode": 301 + }, { "source": "chainlink-nodes/oracle-jobs/v1/job-specifications", "destination": "chainlink-nodes/oracle-jobs/migration-v1-v2",