Skip to content
Merged
24 changes: 12 additions & 12 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ no-log-ix-name = []
idl-build = ["anchor-lang/idl-build"]

[dependencies]
pyth-lazer-protocol = { path = "../../../../sdk/rust/protocol", version = "0.15.2" }
pyth-lazer-protocol = { path = "../../../../sdk/rust/protocol", version = "0.16.0" }

anchor-lang = "0.31.1"
bytemuck = { version = "1.20.0", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions lazer/publisher_sdk/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "pyth-lazer-publisher-sdk"
version = "0.12.2"
version = "0.13.0"
edition = "2021"
description = "Pyth Lazer Publisher SDK types."
license = "Apache-2.0"
repository = "https://github.com/pyth-network/pyth-crosschain"

[dependencies]
pyth-lazer-protocol = { version = "0.15.2", path = "../../sdk/rust/protocol" }
pyth-lazer-protocol = { version = "0.16.0", path = "../../sdk/rust/protocol" }
anyhow = "1.0.98"
protobuf = "3.7.2"
serde_json = "1.0.140"
Expand Down
4 changes: 2 additions & 2 deletions lazer/sdk/rust/client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "pyth-lazer-client"
version = "8.1.1"
version = "8.2.0"
edition = "2021"
description = "A Rust client for Pyth Lazer"
license = "Apache-2.0"

[dependencies]
pyth-lazer-protocol = { path = "../protocol", version = "0.15.2" }
pyth-lazer-protocol = { path = "../protocol", version = "0.16.0" }
tokio = { version = "1", features = ["full"] }
tokio-tungstenite = { version = "0.20", features = ["native-tls"] }
futures-util = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion lazer/sdk/rust/protocol/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyth-lazer-protocol"
version = "0.15.2"
version = "0.16.0"
edition = "2021"
description = "Pyth Lazer SDK - protocol types."
license = "Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions lazer/sdk/rust/protocol/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ impl Channel {
Channel::FixedRate(fixed_rate) => match fixed_rate.duration().as_millis() {
50 => ChannelId::FIXED_RATE_50,
200 => ChannelId::FIXED_RATE_200,
1000 => ChannelId::FIXED_RATE_1000,
_ => panic!("unknown channel: {self:?}"),
},
Channel::RealTime => ChannelId::REAL_TIME,
Expand Down
1 change: 1 addition & 0 deletions lazer/sdk/rust/protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ impl ChannelId {
pub const REAL_TIME: ChannelId = ChannelId(1);
pub const FIXED_RATE_50: ChannelId = ChannelId(2);
pub const FIXED_RATE_200: ChannelId = ChannelId(3);
pub const FIXED_RATE_1000: ChannelId = ChannelId(4);
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
Expand Down
5 changes: 4 additions & 1 deletion lazer/sdk/rust/protocol/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,15 @@ impl FixedRate {
pub const RATE_200_MS: Self = Self {
rate: DurationUs::from_millis_u32(200),
};
pub const RATE_1000_MS: Self = Self {
rate: DurationUs::from_millis_u32(1000),
};

// Assumptions (tested below):
// - Values are sorted.
// - 1 second contains a whole number of each interval.
// - all intervals are divisable by the smallest interval.
pub const ALL: [Self; 2] = [Self::RATE_50_MS, Self::RATE_200_MS];
pub const ALL: [Self; 3] = [Self::RATE_50_MS, Self::RATE_200_MS, Self::RATE_1000_MS];
pub const MIN: Self = Self::ALL[0];

pub fn from_millis(millis: u32) -> Option<Self> {
Expand Down