Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c194872
feat(lazer): add ignoreInvalidFeeds flag to SDK
devin-ai-integration[bot] Mar 27, 2025
7d7078f
feat(lazer): update protocol types for ignore_invalid_feeds
devin-ai-integration[bot] Mar 27, 2025
a8e1e90
fix: update example to include ignore_invalid_feeds field
devin-ai-integration[bot] Mar 27, 2025
2d4f5b7
refactor: rename ignore_invalid_feeds to ignore_invalid_feed_ids
devin-ai-integration[bot] Mar 27, 2025
6b736af
refactor: rename FailedFeedsDetails to InvalidFeedSubscriptionDetails
devin-ai-integration[bot] Mar 27, 2025
c436bff
refactor: rename comingSoon to unstable in InvalidFeedSubscriptionDet…
devin-ai-integration[bot] Mar 28, 2025
23b6f5d
refactor: change successful_feeds type from Vec<u64> to Vec<u32>
devin-ai-integration[bot] Mar 28, 2025
be328ab
refactor: add subscribedWithIgnoredFailures response type
devin-ai-integration[bot] Mar 28, 2025
545cfbb
refactor: rename subscribedWithIgnoredFailures to subscribedWithInval…
devin-ai-integration[bot] Mar 28, 2025
9b1d540
refactor: rename subscribedWithInvalidFeeds to subscribedWithIgnoredI…
devin-ai-integration[bot] Mar 28, 2025
ba506a5
refactor: rename response types to subscribedWithInvalidFeedIdsIgnored
devin-ai-integration[bot] Mar 28, 2025
8d96275
refactor: rename fields to subscribedFeedIds and ignoredInvalidFeedIds
devin-ai-integration[bot] Mar 28, 2025
2d89de1
refactor: rename enum variant to SubscribedWithInvalidFeedIdsIgnored
devin-ai-integration[bot] Mar 28, 2025
99b6bd1
refactor: move ignore_invalid_feed_ids to SubscriptionParamsRepr
devin-ai-integration[bot] Mar 28, 2025
ebd4a93
refactor: change ignore_invalid_feed_ids from Option<bool> to bool
devin-ai-integration[bot] Mar 28, 2025
62eeb1c
refactor: update InvalidFeedSubscriptionDetails to use proper types
devin-ai-integration[bot] Mar 31, 2025
82728e3
refactor: use local SymbolState instead of external dependency
devin-ai-integration[bot] Mar 31, 2025
e7e626e
fix: update protocol.ts formatting to fix CI
devin-ai-integration[bot] Mar 31, 2025
3f30ea2
Undo change ot returned ignored ids
darunrs Mar 31, 2025
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
13 changes: 13 additions & 0 deletions lazer/sdk/js/src/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type Request =
deliveryFormat?: DeliveryFormat;
jsonBinaryEncoding?: JsonBinaryEncoding;
parsed?: boolean;
ignoreInvalidFeedIds?: boolean;
channel: Channel;
}
| {
Expand Down Expand Up @@ -47,6 +48,12 @@ export type JsonBinaryData = {
data: string;
};

export type InvalidFeedSubscriptionDetails = {
unknownIds: number[];
unsupportedChannels: number[];
unstable: number[];
};

export type Response =
| {
type: "error";
Expand All @@ -56,6 +63,12 @@ export type Response =
type: "subscribed";
subscriptionId: number;
}
| {
type: "subscribedWithIgnoredFailures";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err sorry let's actually do "subscribedWithInvalidFeeds" instead.

subscriptionId: number;
successfulFeeds: number[];
failedFeeds: InvalidFeedSubscriptionDetails;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename successfulFeeds to "subscribedFeedIds" and rename failedFeeds to "ignoredInvalidFeedIds"

}
| {
type: "unsubscribed";
subscriptionId: number;
Expand Down
2 changes: 2 additions & 0 deletions lazer/sdk/rust/client/examples/subscribe_price_feeds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ async fn main() -> anyhow::Result<()> {
),
})
.expect("invalid subscription params"),
ignore_invalid_feed_ids: Some(false),
},
// Example subscription: binary feed targeting Solana and EVM
SubscribeRequest {
Expand All @@ -70,6 +71,7 @@ async fn main() -> anyhow::Result<()> {
),
})
.expect("invalid subscription params"),
ignore_invalid_feed_ids: Some(false),
},
];

Expand Down
6 changes: 6 additions & 0 deletions lazer/sdk/rust/protocol/src/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pub struct SubscribeRequest {
pub subscription_id: SubscriptionId,
#[serde(flatten)]
pub params: SubscriptionParams,
#[serde(default)]
pub ignore_invalid_feed_ids: Option<bool>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand All @@ -50,6 +52,10 @@ pub enum Response {
#[serde(rename_all = "camelCase")]
pub struct SubscribedResponse {
Copy link
Contributor

@darunrs darunrs Mar 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SubscribedResponse should be unchanged. Add a new struct called SubscribedWithInvalidFeedIdsIgnored. It should match the new structure that is in the JS protocol.

pub subscription_id: SubscriptionId,
#[serde(skip_serializing_if = "Option::is_none")]
pub successful_feeds: Option<Vec<u32>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub failed_feeds: Option<serde_json::Value>,
}

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
Expand Down
Loading