Skip to content

Commit c2c1de8

Browse files
committed
fix types
1 parent 6dd6551 commit c2c1de8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Types describing Lazer's metadata APIs.
22
3-
use crate::time::TimestampUs;
3+
use crate::time::{DurationUs, TimestampUs};
44
use crate::FeedKind;
55
use crate::{symbol_state::SymbolState, PriceFeedId, SymbolV3};
66
use serde::{Deserialize, Serialize};
@@ -68,7 +68,8 @@ pub struct FeedResponseV3 {
6868
pub base_asset_id: String,
6969
/// The Asset ID of the quote asset.
7070
/// Example: `"USD"`
71-
pub quote_asset_id: String,
71+
#[serde(skip_serializing_if = "Option::is_none")]
72+
pub quote_asset_id: Option<String>,
7273
/// The pricing context. Should be one of the values in the InstrumentType enum.
7374
/// Example: `"spot"`
7475
pub instrument_type: String,
@@ -83,10 +84,10 @@ pub struct FeedResponseV3 {
8384
pub exponent: i32,
8485
/// Funding rate interval. Only applies to feeds with instrument type `funding_rate`.
8586
/// Example: `10`
86-
pub update_interval_seconds: i32,
87+
pub update_interval: DurationUs,
8788
/// The minimum number of publishers contributing component prices to the aggregate price.
8889
/// Example: `3`
89-
pub min_publishers: i32,
90+
pub min_publishers: u32,
9091
/// Status of the feed.
9192
/// Example: `"active"`
9293
pub state: SymbolState,
@@ -160,12 +161,12 @@ mod tests {
160161
symbol,
161162
description: "Pyth Network Aggregate Price for spot BTC/USD".to_string(),
162163
base_asset_id: "BTC".to_string(),
163-
quote_asset_id: "USD".to_string(),
164+
quote_asset_id: Some("USD".to_string()),
164165
instrument_type: "spot".to_string(),
165166
source: "pyth".to_string(),
166167
schedule: "America/New_York;O,O,O,O,O,O,O;".to_string(),
167168
exponent: -8,
168-
update_interval_seconds: 10,
169+
update_interval: DurationUs::from_secs_u32(10),
169170
min_publishers: 3,
170171
state: SymbolState::Stable,
171172
asset_type: "crypto".to_string(),

0 commit comments

Comments
 (0)