Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# data-streams-sdk

Chainlink Data Streams client SDK implementation.

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)
74 changes: 37 additions & 37 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ 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

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-sdk = { version = "0.1.0", features = ["full"] }
```

#### Features
Expand All @@ -37,10 +37,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]
Expand Down Expand Up @@ -94,9 +94,9 @@ async fn main() -> Result<(), Box<dyn Error>> {
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;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Manual Chainlink Data Streams Report Crate Publish

on:
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
environment: publish

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Setup crates.io authentication
run: cargo login ${{ secrets.CARGO_DATA_STREAMS_SDK }}

- name: Publish chainlink-data-streams-report
run: |
cd rust/crates/report
cargo publish
if cargo owner --list | grep -q "github:smartcontractkit:RustCrates"; then
echo "github:smartcontractkit:RustCrates is already set as an owner."
else
cargo owner --add github:smartcontractkit:RustCrates
fi
4 changes: 2 additions & 2 deletions rust/crates/report/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "data-streams-report"
version = "0.0.1"
name = "chainlink-data-streams-report"
version = "0.1.0"
edition = "2021"
description = "Chainlink Data Streams Report"
license = "MIT"
Expand Down
29 changes: 29 additions & 0 deletions rust/crates/sdk/.github/workflows/publish-rust-sdk-crate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Manual Chainlink Data Streams SDK Crate Publish

on:
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
environment: publish

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Setup crates.io authentication
run: cargo login ${{ secrets.CARGO_DATA_STREAMS_SDK }}

- name: Publish chainlink-data-streams-sdk
run: |
cd rust/crates/sdk
cargo publish
if cargo owner --list | grep -q "github:smartcontractkit:RustCrates"; then
echo "github:smartcontractkit:RustCrates is already set as an owner."
else
cargo owner --add github:smartcontractkit:RustCrates
fi
6 changes: 3 additions & 3 deletions rust/crates/sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "data-streams-sdk"
version = "0.0.1"
name = "chainlink-data-streams-sdk"
version = "0.1.0"
edition = "2021"
rust-version = "1.70"
description = "Chainlink Data Streams client SDK"
Expand All @@ -11,7 +11,7 @@ exclude = ["/target/*", "examples/*", "tests/*", "docs/*", "book/*"]
keywords = ["chainlink"]

[dependencies]
data-streams-report = { git = "https://github.com/smartcontractkit/data-streams-sdk.git", subdir = "rust/crates/report" }
chainlink-data-streams-report = "0.1.0"
reqwest = { version = "0.11.20", features = ["json", "rustls-tls"] }
tokio = { version = "1.29.1", features = ["full"] }
tokio-tungstenite = { version = "0.20.1", features = [
Expand Down
Loading