Skip to content

Commit 33b3726

Browse files
authored
Lazer: Add inactive symbol state (#2831)
1 parent 2cd27d1 commit 33b3726

File tree

7 files changed

+46
-21
lines changed

7 files changed

+46
-21
lines changed

Cargo.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lazer/contracts/solana/Cargo.lock

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lazer/publisher_sdk/proto/state.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ message Publisher {
4444
optional bool is_active = 4;
4545
}
4646

47+
enum FeedState {
48+
COMING_SOON = 0; // Default value
49+
STABLE = 1;
50+
INACTIVE = 2;
51+
}
52+
4753
// Static data for a feed.
4854
message FeedMetadata {
4955
// [required] ID of the price feed.
@@ -86,6 +92,8 @@ message FeedMetadata {
8692
// [optional] Market schedule in Pythnet format.
8793
// If absent, the default schedule is used (market is always open).
8894
optional string market_schedule = 15;
95+
// [required] Feed state
96+
optional FeedState state = 16;
8997
}
9098

9199
// An item of the state describing a feed.

lazer/publisher_sdk/proto/transaction_envelope.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ enum RejectReason {
6464
PriceOverflow = 2;
6565
InvalidFeedId = 3;
6666
MissingFields = 4;
67+
InactiveFeedId = 5;
6768
}

lazer/publisher_sdk/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyth-lazer-publisher-sdk"
3-
version = "0.1.5"
3+
version = "0.1.6"
44
edition = "2021"
55
description = "Pyth Lazer Publisher SDK types."
66
license = "Apache-2.0"

lazer/sdk/rust/protocol/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyth-lazer-protocol"
3-
version = "0.7.2"
3+
version = "0.7.3"
44
edition = "2021"
55
description = "Pyth Lazer SDK - protocol types."
66
license = "Apache-2.0"

lazer/sdk/rust/protocol/src/symbol_state.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ use {
66
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
77
#[serde(rename_all = "snake_case")]
88
pub enum SymbolState {
9-
Stable,
109
ComingSoon,
10+
Stable,
11+
Inactive,
1112
}
1213

1314
impl Display for SymbolState {
1415
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1516
match self {
16-
SymbolState::Stable => write!(f, "stable"),
1717
SymbolState::ComingSoon => write!(f, "coming_soon"),
18+
SymbolState::Stable => write!(f, "stable"),
19+
SymbolState::Inactive => write!(f, "inactive"),
1820
}
1921
}
2022
}

0 commit comments

Comments
 (0)