diff --git a/README.md b/README.md index d3d3c33..3455ba5 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,4 @@ See the language directories for specific documentation, usage and examples. ## [Go](go/README.md) [![go.dev reference](https://img.shields.io/badge/go-reference-blue)](https://pkg.go.dev/github.com/smartcontractkit/data-streams-sdk/go) [![Go Report Card](https://goreportcard.com/badge/github.com/smartcontractkit/data-streams-sdk/go)](https://goreportcard.com/report/github.com/smartcontractkit/data-streams-sdk/go) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smartcontractkit/data-streams-sdk/blob/main/LICENSE) -## [Rust](rust/README.md) ![Crates.io sdk](https://img.shields.io/crates/v/chainlink-data-streams-sdk?label=chainlink-data-streams-sdk) ![Crates.io report](https://img.shields.io/crates/v/chainlink-data-streams-report?label=chainlink-data-streams-report) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smartcontractkit/data-streams-sdk/blob/main/LICENSE) +## [Rust](rust/README.md) [![Crates.io sdk](https://img.shields.io/crates/v/chainlink-data-streams-sdk?label=chainlink-data-streams-sdk)](https://crates.io/crates/chainlink-data-streams-sdk) [![Crates.io report](https://img.shields.io/crates/v/chainlink-data-streams-report?label=chainlink-data-streams-report)](https://crates.io/crates/chainlink-data-streams-report) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smartcontractkit/data-streams-sdk/blob/main/LICENSE) diff --git a/rust/README.md b/rust/README.md index 603ebcb..a45898e 100644 --- a/rust/README.md +++ b/rust/README.md @@ -20,6 +20,7 @@ Add the following to your `Cargo.toml`: ```toml [dependencies] +chainlink-data-streams-report = "0.1.0" chainlink-data-streams-sdk = { version = "0.1.0", features = ["full"] } ``` diff --git a/rust/crates/report/examples/decode_report_data.rs b/rust/crates/report/examples/decode_report_data.rs index a2e80d8..9f687fa 100644 --- a/rust/crates/report/examples/decode_report_data.rs +++ b/rust/crates/report/examples/decode_report_data.rs @@ -1,4 +1,4 @@ -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; use std::error::Error; fn main() -> Result<(), Box> { diff --git a/rust/crates/report/src/feed_id.rs b/rust/crates/report/src/feed_id.rs index f5a8a64..1292b2b 100644 --- a/rust/crates/report/src/feed_id.rs +++ b/rust/crates/report/src/feed_id.rs @@ -25,7 +25,7 @@ pub enum IDError { /// # Examples /// /// ```rust -/// use data_streams_report::feed_id::ID; +/// use chainlink_data_streams_report::feed_id::ID; /// /// let id = ID::from_hex_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap(); /// println!("ID: {}", id); @@ -55,7 +55,7 @@ impl ID { /// # Examples /// /// ```rust - /// use data_streams_report::feed_id::ID; + /// use chainlink_data_streams_report::feed_id::ID; /// /// let id = ID::from_hex_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap(); /// ``` @@ -85,7 +85,7 @@ impl ID { /// # Examples /// /// ```rust - /// use data_streams_report::feed_id::ID; + /// use chainlink_data_streams_report::feed_id::ID; /// /// let id = ID::from_hex_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap(); /// let hex_string = id.to_hex_string(); @@ -113,7 +113,7 @@ impl FromStr for ID { /// # Examples /// /// ```rust - /// use data_streams_report::feed_id::ID; + /// use chainlink_data_streams_report::feed_id::ID; /// use std::str::FromStr; /// /// let id = ID::from_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap(); @@ -129,7 +129,7 @@ impl fmt::Display for ID { /// # Examples /// /// ```rust - /// use data_streams_report::feed_id::ID; + /// use chainlink_data_streams_report::feed_id::ID; /// /// let id = ID::from_hex_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap(); /// println!("{}", id); // Outputs: 0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472 @@ -145,7 +145,7 @@ impl fmt::Debug for ID { /// # Examples /// /// ```rust - /// use data_streams_report::feed_id::ID; + /// use chainlink_data_streams_report::feed_id::ID; /// /// let id = ID::from_hex_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap(); /// println!("{:?}", id); // Outputs: 0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472 @@ -163,7 +163,7 @@ impl Serialize for ID { /// # Examples /// /// ```rust - /// use data_streams_report::feed_id::ID; + /// use chainlink_data_streams_report::feed_id::ID; /// use serde_json; /// /// let id = ID::from_hex_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap(); @@ -185,7 +185,7 @@ impl<'de> Deserialize<'de> for ID { /// # Examples /// /// ```rust - /// use data_streams_report::feed_id::ID; + /// use chainlink_data_streams_report::feed_id::ID; /// use serde_json; /// /// let json = "\"0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472\""; diff --git a/rust/crates/report/src/report.rs b/rust/crates/report/src/report.rs index 00ff7d0..6a7521e 100644 --- a/rust/crates/report/src/report.rs +++ b/rust/crates/report/src/report.rs @@ -22,8 +22,8 @@ use serde::{Deserialize, Serialize}; /// # Examples /// /// ```rust -/// use data_streams_report::report::Report; -/// use data_streams_report::feed_id::ID; +/// use chainlink_data_streams_report::report::Report; +/// use chainlink_data_streams_report::feed_id::ID; /// /// let id = ID::from_hex_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap(); /// let report = Report { diff --git a/rust/crates/report/src/report/compress.rs b/rust/crates/report/src/report/compress.rs index 30164a7..8766a01 100644 --- a/rust/crates/report/src/report/compress.rs +++ b/rust/crates/report/src/report/compress.rs @@ -26,7 +26,7 @@ impl From for CompressionError { /// /// # Examples /// ```rust -/// use data_streams_report::report::compress::{compress_report_raw, CompressionError}; +/// use chainlink_data_streams_report::report::compress::{compress_report_raw, CompressionError}; /// /// fn main() -> Result<(), CompressionError> { /// let raw_report = "7b22666565644944223a22307830303033366234616137653537636137623638616531626634353635336635366236353666643361613333356566376661653639366236363366316238343732222c2276616c696446726f6d54696d657374616d70223a313731383838353737322c226f62736572766174696f6e7354696d657374616d70223a313731383838353737322c2266756c6c5265706f7274223a2230303036626438373833306435663333366532303563663563363333323961316461623866356435363831326561656237633639333030653636616238653232303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030636637656431333030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030306530303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303232303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303033303030313031303030313031303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303132303030303330616237643032666262613963363330346639383832343532343430376231663439343734313137343332306366643137613263323265656331646530303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303636613866356336303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303036366138663563363030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303035373831303635336464393030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303534313331356461373664363130303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303036366161343734363030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303039613639376565343233303335303430303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030396136353036643134323664303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303961373764303361653335356665303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303637326261633939316635323333646638396635383164633032613839646438643438343139653335353862323437643365363566343036396661343563333636353861356134383230646339346663343761383861323164383334373463323965653338333832633436623666396135373562396365386265346536383963303363373666616331396662656334613239646261373034633732636330303361366265316639366166313135653332323332316630363838653234373230613564396264373133366131643936383432656338393133333035386238383862326536353732623564343131346465323432363139356530333866316339613563653530303136623666356135646530376530383532396238343565316336323264636265666130636661326666643132386539393332656365653865666438363962633536643039613530636562333630613864333636636661386565666533663634323739633838626462633838373536306566613939343432333865623030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303036306532613830306631363966323631363435333363376661666636633930373363643664623234306438393434346433343837313133323332663963333134323261303939336262343764353638303764306463323637323865346338343234626239646237373531313030313930343335336631303232313638373233303130633436363237633839306265366537303165373636363739363030363936383636633838386563383065376462643432386635313632613234663264383236326638343662646230366439653436643239356464386538393666623233326265383035333462303034313636306665343435306137656465396263336232333037323233383137373361346165383132343135363838363761373539663533633262646430356433326232303965373838343566633538323033393439653530613630383934326232373063343536303031653537383232376164303038363163663566343762323762303931333761306334623766386234373436636566227d"; @@ -55,8 +55,8 @@ pub fn compress_report_raw(payload: &[u8]) -> Result, CompressionError> /// /// # Examples /// ```rust -/// use data_streams_report::report::{Report, compress::{compress_report, CompressionError}}; -/// use data_streams_report::feed_id::ID; +/// use chainlink_data_streams_report::report::{Report, compress::{compress_report, CompressionError}}; +/// use chainlink_data_streams_report::feed_id::ID; /// /// fn main() -> Result<(), CompressionError> { /// let feed_id = ID::from_hex_str("0x00036b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap(); diff --git a/rust/crates/report/src/report/v3.rs b/rust/crates/report/src/report/v3.rs index a48e0fe..1adb14d 100644 --- a/rust/crates/report/src/report/v3.rs +++ b/rust/crates/report/src/report/v3.rs @@ -61,7 +61,7 @@ impl ReportDataV3 { /// # Examples /// /// ```rust - /// use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; + /// use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; /// use std::error::Error; /// /// fn main() -> Result<(), Box> { diff --git a/rust/crates/sdk/benches/rest_benchmark.rs b/rust/crates/sdk/benches/rest_benchmark.rs index c8f1f5f..3fcf97d 100644 --- a/rust/crates/sdk/benches/rest_benchmark.rs +++ b/rust/crates/sdk/benches/rest_benchmark.rs @@ -1,11 +1,11 @@ -use data_streams_report::{ +use chainlink_data_streams_report::{ feed_id::ID, report::{ compress::{compress_report, compress_report_raw}, decode_full_report, }, }; -use data_streams_sdk::{client::Client, config::Config}; +use chainlink_data_streams_sdk::{client::Client, config::Config}; use criterion::{criterion_group, criterion_main, Criterion}; use dotenv::dotenv; diff --git a/rust/crates/sdk/benches/stream_benchmark.rs b/rust/crates/sdk/benches/stream_benchmark.rs index 10710e0..98a207d 100644 --- a/rust/crates/sdk/benches/stream_benchmark.rs +++ b/rust/crates/sdk/benches/stream_benchmark.rs @@ -1,5 +1,5 @@ -use data_streams_report::feed_id::ID; -use data_streams_sdk::{ +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_sdk::{ config::{Config, WebSocketHighAvailability}, stream::Stream, }; diff --git a/rust/crates/sdk/examples/compress_report.rs b/rust/crates/sdk/examples/compress_report.rs index ed24cce..acc6f85 100644 --- a/rust/crates/sdk/examples/compress_report.rs +++ b/rust/crates/sdk/examples/compress_report.rs @@ -1,7 +1,7 @@ -use data_streams_report::feed_id::ID; -use data_streams_report::report::compress::compress_report; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::compress::compress_report; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/crates/sdk/examples/get_feeds.rs b/rust/crates/sdk/examples/get_feeds.rs index 74609eb..63be951 100644 --- a/rust/crates/sdk/examples/get_feeds.rs +++ b/rust/crates/sdk/examples/get_feeds.rs @@ -1,5 +1,5 @@ -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/crates/sdk/examples/get_latest_report.rs b/rust/crates/sdk/examples/get_latest_report.rs index 5e96483..cc801f9 100644 --- a/rust/crates/sdk/examples/get_latest_report.rs +++ b/rust/crates/sdk/examples/get_latest_report.rs @@ -1,7 +1,7 @@ -use data_streams_report::feed_id::ID; -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/crates/sdk/examples/get_report.rs b/rust/crates/sdk/examples/get_report.rs index f89216e..241d47b 100644 --- a/rust/crates/sdk/examples/get_report.rs +++ b/rust/crates/sdk/examples/get_report.rs @@ -1,7 +1,7 @@ -use data_streams_report::feed_id::ID; -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/crates/sdk/examples/get_reports_bulk.rs b/rust/crates/sdk/examples/get_reports_bulk.rs index a30951c..83b016e 100644 --- a/rust/crates/sdk/examples/get_reports_bulk.rs +++ b/rust/crates/sdk/examples/get_reports_bulk.rs @@ -1,7 +1,7 @@ -use data_streams_report::feed_id::ID; -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/crates/sdk/examples/get_reports_page.rs b/rust/crates/sdk/examples/get_reports_page.rs index 13767aa..a4ea0f1 100644 --- a/rust/crates/sdk/examples/get_reports_page.rs +++ b/rust/crates/sdk/examples/get_reports_page.rs @@ -1,7 +1,7 @@ -use data_streams_report::feed_id::ID; -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/crates/sdk/examples/get_reports_page_with_limit.rs b/rust/crates/sdk/examples/get_reports_page_with_limit.rs index d1414f7..23cdae2 100644 --- a/rust/crates/sdk/examples/get_reports_page_with_limit.rs +++ b/rust/crates/sdk/examples/get_reports_page_with_limit.rs @@ -1,7 +1,7 @@ -use data_streams_report::feed_id::ID; -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/crates/sdk/examples/wss_multiple.rs b/rust/crates/sdk/examples/wss_multiple.rs index c2f573b..fd19dc8 100644 --- a/rust/crates/sdk/examples/wss_multiple.rs +++ b/rust/crates/sdk/examples/wss_multiple.rs @@ -1,8 +1,8 @@ -use data_streams_report::feed_id::ID; -use data_streams_report::report::decode_full_report; -use data_streams_report::report::v3::ReportDataV3; -use data_streams_sdk::config::{Config, WebSocketHighAvailability}; -use data_streams_sdk::stream::Stream; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::decode_full_report; +use chainlink_data_streams_report::report::v3::ReportDataV3; +use chainlink_data_streams_sdk::config::{Config, WebSocketHighAvailability}; +use chainlink_data_streams_sdk::stream::Stream; use tracing_subscriber::fmt::time::UtcTime; #[tokio::main] diff --git a/rust/crates/sdk/examples/wss_simple_stream.rs b/rust/crates/sdk/examples/wss_simple_stream.rs index 98afa23..958667f 100644 --- a/rust/crates/sdk/examples/wss_simple_stream.rs +++ b/rust/crates/sdk/examples/wss_simple_stream.rs @@ -1,6 +1,6 @@ -use data_streams_report::feed_id::ID; -use data_streams_sdk::config::Config; -use data_streams_sdk::stream::Stream; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_sdk::config::Config; +use chainlink_data_streams_sdk::stream::Stream; use tokio::signal; use tracing_subscriber::fmt::time::UtcTime; diff --git a/rust/crates/sdk/src/client.rs b/rust/crates/sdk/src/client.rs index 0593be4..565e959 100644 --- a/rust/crates/sdk/src/client.rs +++ b/rust/crates/sdk/src/client.rs @@ -5,8 +5,8 @@ use crate::endpoints::{ }; use crate::feed::Feed; -use data_streams_report::feed_id::ID; -use data_streams_report::report::Report; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::Report; use reqwest::Client as HttpClient; use serde::Deserialize; diff --git a/rust/crates/sdk/src/config.rs b/rust/crates/sdk/src/config.rs index 1b9a263..cf79612 100644 --- a/rust/crates/sdk/src/config.rs +++ b/rust/crates/sdk/src/config.rs @@ -87,7 +87,7 @@ impl Config { /// /// # Example /// ```rust - /// use data_streams_sdk::config::{Config, WebSocketHighAvailability, InsecureSkipVerify}; + /// use chainlink_data_streams_sdk::config::{Config, WebSocketHighAvailability, InsecureSkipVerify}; /// /// use std::error::Error; /// diff --git a/rust/crates/sdk/src/feed.rs b/rust/crates/sdk/src/feed.rs index 0a02783..7cc37a5 100644 --- a/rust/crates/sdk/src/feed.rs +++ b/rust/crates/sdk/src/feed.rs @@ -1,4 +1,4 @@ -use data_streams_report::feed_id::ID; +use chainlink_data_streams_report::feed_id::ID; use byteorder::{BigEndian, ByteOrder}; use serde::{Deserialize, Serialize}; @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize}; /// # Examples /// /// ```rust -/// use data_streams_sdk::feed::FeedVersion; +/// use chainlink_data_streams_sdk::feed::FeedVersion; /// /// let version = FeedVersion(1); /// println!("Feed version: {}", version.0); @@ -26,8 +26,8 @@ pub struct FeedVersion(pub u16); /// # Examples /// /// ```rust -/// use data_streams_sdk::feed::Feed; -/// use data_streams_report::feed_id::ID; +/// use chainlink_data_streams_sdk::feed::Feed; +/// use chainlink_data_streams_report::feed_id::ID; /// /// let id = ID::from_hex_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap(); /// let feed = Feed { feed_id: id }; @@ -49,8 +49,8 @@ impl Feed { /// # Examples /// /// ```rust - /// use data_streams_report::feed_id::ID; - /// use data_streams_sdk::feed::{Feed, FeedVersion}; + /// use chainlink_data_streams_report::feed_id::ID; + /// use chainlink_data_streams_sdk::feed::{Feed, FeedVersion}; /// /// let feed_id = ID::from_hex_str("0x00016b4aa7e57ca7b68ae1bf45653f56b656fd3aa335ef7fae696b663f1b8472").unwrap(); /// let feed = Feed { feed_id }; diff --git a/rust/crates/sdk/src/stream.rs b/rust/crates/sdk/src/stream.rs index 423141f..4c4006d 100644 --- a/rust/crates/sdk/src/stream.rs +++ b/rust/crates/sdk/src/stream.rs @@ -6,8 +6,8 @@ use monitor_connection::run_stream; use crate::config::Config; -use data_streams_report::feed_id::ID; -use data_streams_report::report::Report; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::Report; use serde::{Deserialize, Serialize}; use std::{ diff --git a/rust/crates/sdk/src/stream/establish_connection.rs b/rust/crates/sdk/src/stream/establish_connection.rs index 1a92624..a9828ea 100644 --- a/rust/crates/sdk/src/stream/establish_connection.rs +++ b/rust/crates/sdk/src/stream/establish_connection.rs @@ -7,7 +7,7 @@ use crate::{ stream::{DEFAULT_WS_CONNECT_TIMEOUT, MAX_WS_RECONNECT_INTERVAL, MIN_WS_RECONNECT_INTERVAL}, }; -use data_streams_report::feed_id::ID; +use chainlink_data_streams_report::feed_id::ID; use std::{ sync::{atomic::Ordering, Arc}, diff --git a/rust/crates/sdk/src/stream/monitor_connection.rs b/rust/crates/sdk/src/stream/monitor_connection.rs index 029e66b..1cd497b 100644 --- a/rust/crates/sdk/src/stream/monitor_connection.rs +++ b/rust/crates/sdk/src/stream/monitor_connection.rs @@ -2,7 +2,7 @@ use super::{Stats, StreamError, WebSocketReport}; use crate::{config::Config, stream::establish_connection::try_to_reconnect}; -use data_streams_report::feed_id::ID; +use chainlink_data_streams_report::feed_id::ID; use futures::SinkExt; use futures_util::StreamExt; diff --git a/rust/crates/sdk/tests/stream_integration_tests.rs b/rust/crates/sdk/tests/stream_integration_tests.rs index a8d549b..c0fc473 100644 --- a/rust/crates/sdk/tests/stream_integration_tests.rs +++ b/rust/crates/sdk/tests/stream_integration_tests.rs @@ -2,8 +2,10 @@ mod mock_websocket_server; use mock_websocket_server::MockWebSocketServer; -use data_streams_sdk::config::{Config, WebSocketHighAvailability}; -use data_streams_sdk::stream::{Stream, MAX_WS_RECONNECT_INTERVAL, MIN_WS_RECONNECT_INTERVAL}; +use chainlink_data_streams_sdk::config::{Config, WebSocketHighAvailability}; +use chainlink_data_streams_sdk::stream::{ + Stream, MAX_WS_RECONNECT_INTERVAL, MIN_WS_RECONNECT_INTERVAL, +}; use std::iter::repeat; use tokio::time::{sleep, Duration}; diff --git a/rust/docs/examples/compress_report.md b/rust/docs/examples/compress_report.md index 462490e..985a756 100644 --- a/rust/docs/examples/compress_report.md +++ b/rust/docs/examples/compress_report.md @@ -4,7 +4,7 @@ This example demonstrates how to compress a report the [Snappy compression algor ## Running the example -Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust` directory. +Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust/crates/sdk` directory. ```bash cargo run --example compress_report @@ -15,10 +15,10 @@ cargo run --example compress_report The code for this example can be found in the `compress_report.rs` file in the `crates/sdk/examples` directory of the `data-streams-sdk` repository. ```rust -use data_streams_report::feed_id::ID; -use data_streams_report::report::compress::compress_report; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::compress::compress_report; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] @@ -65,7 +65,7 @@ async fn main() -> Result<(), Box> { There is also a `compress_report_raw` function that compresseses a raw report payload. ```rust -use data_streams_report::report::compress::{compress_report_raw, CompressionError}; +use chainlink_data_streams_report::report::compress::{compress_report_raw, CompressionError}; fn main() -> Result<(), CompressionError> { let raw_report = "7b22666565644944223a22307830303033366234616137653537636137623638616531626634353635336635366236353666643361613333356566376661653639366236363366316238343732222c2276616c696446726f6d54696d657374616d70223a313731383838353737322c226f62736572766174696f6e7354696d657374616d70223a313731383838353737322c2266756c6c5265706f7274223a2230303036626438373833306435663333366532303563663563363333323961316461623866356435363831326561656237633639333030653636616238653232303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030636637656431333030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030306530303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303232303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303033303030313031303030313031303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303132303030303330616237643032666262613963363330346639383832343532343430376231663439343734313137343332306366643137613263323265656331646530303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303636613866356336303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303036366138663563363030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303035373831303635336464393030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303534313331356461373664363130303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303036366161343734363030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303039613639376565343233303335303430303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030396136353036643134323664303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303961373764303361653335356665303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303637326261633939316635323333646638396635383164633032613839646438643438343139653335353862323437643365363566343036396661343563333636353861356134383230646339346663343761383861323164383334373463323965653338333832633436623666396135373562396365386265346536383963303363373666616331396662656334613239646261373034633732636330303361366265316639366166313135653332323332316630363838653234373230613564396264373133366131643936383432656338393133333035386238383862326536353732623564343131346465323432363139356530333866316339613563653530303136623666356135646530376530383532396238343565316336323264636265666130636661326666643132386539393332656365653865666438363962633536643039613530636562333630613864333636636661386565666533663634323739633838626462633838373536306566613939343432333865623030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303036306532613830306631363966323631363435333363376661666636633930373363643664623234306438393434346433343837313133323332663963333134323261303939336262343764353638303764306463323637323865346338343234626239646237373531313030313930343335336631303232313638373233303130633436363237633839306265366537303165373636363739363030363936383636633838386563383065376462643432386635313632613234663264383236326638343662646230366439653436643239356464386538393666623233326265383035333462303034313636306665343435306137656465396263336232333037323233383137373361346165383132343135363838363761373539663533633262646430356433326232303965373838343566633538323033393439653530613630383934326232373063343536303031653537383232376164303038363163663566343762323762303931333761306334623766386234373436636566227d"; diff --git a/rust/docs/examples/decode_report_data.md b/rust/docs/examples/decode_report_data.md index 6e3e08d..c920fe3 100644 --- a/rust/docs/examples/decode_report_data.md +++ b/rust/docs/examples/decode_report_data.md @@ -4,7 +4,7 @@ This example demonstrates how to decode a signed report payload from a Data Stre ## Running the example -Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust` directory. +Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust/crates/sdk` directory. ```bash cargo run --example decode_report_data @@ -31,7 +31,7 @@ ReportDataV3 { The code for this example can be found in the `decode_report_data.rs` file in the `crates/report/examples` directory of the `data-streams-sdk` repository. ```rust -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; use std::error::Error; fn main() -> Result<(), Box> { diff --git a/rust/docs/examples/get_latest_report.md b/rust/docs/examples/get_latest_report.md index 3f2f840..c31afd9 100644 --- a/rust/docs/examples/get_latest_report.md +++ b/rust/docs/examples/get_latest_report.md @@ -4,7 +4,7 @@ This example demontstrates how to get the latest report for a ETH/USD feed on Ar ## Running the example -Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust` directory. +Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust/crates/sdk` directory. ```bash cargo run --example get_latest_report @@ -15,10 +15,10 @@ cargo run --example get_latest_report The code for this example can be found in the `get_latest_report.rs` file in the `crates/sdk/examples` directory of the `data-streams-sdk` repository. ```rust -use data_streams_report::feed_id::ID; -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/docs/examples/get_report.md b/rust/docs/examples/get_report.md index 58bdd8e..fe7aac6 100644 --- a/rust/docs/examples/get_report.md +++ b/rust/docs/examples/get_report.md @@ -4,7 +4,7 @@ This example demontstrates how to get the report for a ETH/USD feed at the examp ## Running the example -Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust` directory. +Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust/crates/sdk` directory. ```bash cargo run --example get_report @@ -15,10 +15,10 @@ cargo run --example get_report The code for this example can be found in the `get_report.rs` file in the `crates/sdk/examples` directory of the `data-streams-sdk` repository. ```rust -use data_streams_report::feed_id::ID; -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/docs/examples/get_reports_bulk.md b/rust/docs/examples/get_reports_bulk.md index da3a8fd..24f0a81 100644 --- a/rust/docs/examples/get_reports_bulk.md +++ b/rust/docs/examples/get_reports_bulk.md @@ -4,7 +4,7 @@ This example demonstrates how to get reports for ETH/USD and BTC/USD feeds at th ## Running the example -Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust` directory. +Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust/crates/sdk` directory. ```bash cargo run --example get_reports_bulk @@ -50,10 +50,10 @@ ReportDataV3 { The code for this example can be found in the `get_reports_bulk.rs` file in the `crates/sdk/examples` directory of the `data-streams-sdk` repository. ```rust -use data_streams_report::feed_id::ID; -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/docs/examples/get_reports_page.md b/rust/docs/examples/get_reports_page.md index 4a15aeb..56829bf 100644 --- a/rust/docs/examples/get_reports_page.md +++ b/rust/docs/examples/get_reports_page.md @@ -4,7 +4,7 @@ This example demonstrates how to get multiple sequential reports for a ETH/USD f ## Running the example -Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust` directory. +Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust/crates/sdk` directory. ```bash cargo run --example get_reports_page @@ -15,10 +15,10 @@ cargo run --example get_reports_page The code for this example can be found in the `get_reports_page.rs` file in the `crates/sdk/examples` directory of the `data-streams-sdk` repository. ```rust -use data_streams_report::feed_id::ID; -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/docs/examples/get_reports_page_with_limit.md b/rust/docs/examples/get_reports_page_with_limit.md index f545f3d..c9776eb 100644 --- a/rust/docs/examples/get_reports_page_with_limit.md +++ b/rust/docs/examples/get_reports_page_with_limit.md @@ -4,7 +4,7 @@ This example demonstrates how to get multiple sequential reports for a ETH/USD f ## Running the example -Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust` directory. +Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust/crates/sdk` directory. ```bash cargo run --example get_reports_page_with_limit @@ -15,10 +15,10 @@ cargo run --example get_reports_page_with_limit The code for this example can be found in the `get_reports_page_with_limit.rs` file in the `crates/sdk/examples` directory of the `data-streams-sdk` repository. ```rust -use data_streams_report::feed_id::ID; -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] diff --git a/rust/docs/examples/wss_multiple.md b/rust/docs/examples/wss_multiple.md index 61fe7b0..63e69f9 100644 --- a/rust/docs/examples/wss_multiple.md +++ b/rust/docs/examples/wss_multiple.md @@ -38,7 +38,7 @@ To enable HA mode, set the `ws_ha` parameter to `true` in the `Config` struct an ## Running the example -Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust` directory. +Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust/crates/sdk` directory. ```bash cargo run --example wss_multiple @@ -49,11 +49,11 @@ cargo run --example wss_multiple The code for this example can be found in the `wss_multiple.rs` file in the `crates/sdk/examples` directory of the `data-streams-sdk` repository. It will subscribe to the ETH/USD and BTC/USD feeds on Arbitrum Sepolia Stream and start reading reports. For each report it will log the feed ID, valid from timestamp, obesrvations timestamp and decode the report data to V3 Report, for 10 runs. After 5th run it will log current statistics. After 10th run it will exit the loop and gracefully close all streams. After that it will log the final statistics. ```rust -use data_streams_report::feed_id::ID; -use data_streams_report::report::decode_full_report; -use data_streams_report::report::v3::ReportDataV3; -use data_streams_sdk::config::{Config, WebSocketHighAvailability}; -use data_streams_sdk::stream::Stream; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::decode_full_report; +use chainlink_data_streams_report::report::v3::ReportDataV3; +use chainlink_data_streams_sdk::config::{Config, WebSocketHighAvailability}; +use chainlink_data_streams_sdk::stream::Stream; use tracing_subscriber::fmt::time::UtcTime; #[tokio::main] diff --git a/rust/docs/examples/wss_simple_stream.md b/rust/docs/examples/wss_simple_stream.md index cff9091..392aa8a 100644 --- a/rust/docs/examples/wss_simple_stream.md +++ b/rust/docs/examples/wss_simple_stream.md @@ -18,7 +18,7 @@ async fn main() -> Result<(), Box> { ## Running the example -Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust` directory. +Make sure you git cloned the [https://github.com/smartcontractkit/data-streams-sdk](https://github.com/smartcontractkit/data-streams-sdk) repository and navigated to the `rust/crates/sdk` directory. ```bash cargo run --example wss_simple_stream @@ -29,9 +29,9 @@ cargo run --example wss_simple_stream The code for this example can be found in the `wss_simple_stream.rs` file in the `crates/sdk/examples` directory of the `data-streams-sdk` repository. It will subscribe to the ETH/USD feed on Arbitrum Sepolia Stream and read & log RAW Reports. To terminate its execution press `Ctrl+C`. ```rust -use data_streams_report::feed_id::ID; -use data_streams_sdk::config::Config; -use data_streams_sdk::stream::Stream; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_sdk::config::Config; +use chainlink_data_streams_sdk::stream::Stream; use tokio::signal; use tracing_subscriber::fmt::time::UtcTime; diff --git a/rust/docs/guides/foundry.md b/rust/docs/guides/foundry.md index 2188341..e96d089 100644 --- a/rust/docs/guides/foundry.md +++ b/rust/docs/guides/foundry.md @@ -157,9 +157,9 @@ contract Example is OwnerIsCreator { In the root of the Foundry project create the new `get_latest_eth_usd_report.rs` file with the following content: ```rust -use data_streams_report::feed_id::ID; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use dotenv::dotenv; use std::env; use std::error::Error; @@ -217,8 +217,8 @@ version = "0.0.1" edition = "2021" [dependencies] -data-streams-report = { git = "https://github.com/smartcontractkit/data-streams-sdk.git", subdir = "rust/crates/report" } -data-streams-sdk = { git = "https://github.com/smartcontractkit/data-streams-sdk.git", subdir = "rust/crates/sdk", features = ["rest"] } +chainlink-data-streams-report = "0.1.0" +chainlink-data-streams-sdk = { version = "0.1.0", features = ["rest"] } dotenv = "0.15" tokio = { version = "1", features = ["full"] } diff --git a/rust/docs/introduction.md b/rust/docs/introduction.md index f7a3007..8f5e8b2 100644 --- a/rust/docs/introduction.md +++ b/rust/docs/introduction.md @@ -11,8 +11,8 @@ The Data Streams SDK is a Rust library that provides a convenient way to consume The project is organized into the following crates: -- `data-streams-report` - The crate that provides the data structures for the reports. -- `data-streams-sdk` - The main crate that provides the REST and WebSocket clients. +- `chainlink-data-streams-report` - The crate that provides the data structures for the reports. +- `chainlink-data-streams-sdk` - The main crate that provides the REST and WebSocket clients. ## Installation @@ -20,7 +20,8 @@ Add the following to your `Cargo.toml`: ```toml [dependencies] -data-streams-sdk = { git = "https://github.com/smartcontractkit/data-streams-sdk.git", subdir = "rust/crates/sdk" } +chainlink-data-streams-report = "0.1.0" +chainlink-data-streams-sdk = { version = "0.1.0", features = ["full"] } ``` #### Features @@ -37,10 +38,10 @@ data-streams-sdk = { git = "https://github.com/smartcontractkit/data-streams-sdk Here is the basic example that demontstrates how to get the latest report for a ETH/USD feed on Arbitrum Sepolia: ```rust -use data_streams_report::feed_id::ID; -use data_streams_report::report::{decode_full_report, v3::ReportDataV3}; -use data_streams_sdk::client::Client; -use data_streams_sdk::config::Config; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_report::report::{decode_full_report, v3::ReportDataV3}; +use chainlink_data_streams_sdk::client::Client; +use chainlink_data_streams_sdk::config::Config; use std::error::Error; #[tokio::main] @@ -94,9 +95,9 @@ async fn main() -> Result<(), Box> { Here is the basic example that demonstrates how to connect to the Data Streams WebSocket server and subscribe to a single stream of ETH/USD Feed Reports on Arbitrum Sepolia: ```rust -use data_streams_report::feed_id::ID; -use data_streams_sdk::config::Config; -use data_streams_sdk::stream::Stream; +use chainlink_data_streams_report::feed_id::ID; +use chainlink_data_streams_sdk::config::Config; +use chainlink_data_streams_sdk::stream::Stream; use tokio::signal; use tracing_subscriber::fmt::time::UtcTime;