Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lazer/sdk/rust): add rust client for Lazer #2310

Merged
merged 20 commits into from
Jan 31, 2025

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 30, 2025

Link to Devin run: https://app.devin.ai/sessions/554f91bb56fb4e7a89a56f1eb8b04c6b

Summary

This PR adds a Rust client for Pyth Lazer, providing a simple WebSocket client to subscribe to price feed updates. Will be used by Pyth Native to subscribe to Lazer feeds.

The implementation:

  • Creates a new crate pyth-lazer-client in lazer/sdk/rust/client
  • Provides a public API with start, subscribe, and unsubscribe methods
  • Handles binary message parsing for EVM and Solana chain formats
  • Uses existing protocol types from pyth-lazer-protocol

Manually tested against prod Lazer. Usage example in examples/

Up next

  • Maintain redundant websocket connections, similar to how the JS SDK does it
  • Connect to multiple routers for reliability instead of the single load balancer

Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

vercel bot commented Jan 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2025 6:40pm
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2025 6:40pm
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2025 6:40pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
component-library ⬜️ Ignored (Inspect) Visit Preview Jan 31, 2025 6:40pm
entropy-debugger ⬜️ Ignored (Inspect) Visit Preview Jan 31, 2025 6:40pm
insights ⬜️ Ignored (Inspect) Visit Preview Jan 31, 2025 6:40pm

…b64 encode. add parse and verify to the example.
Ok(())
}

fn parse_and_verify_solana_message(solana_message: &SolanaMessage) -> anyhow::Result<PayloadData> {
Copy link
Contributor

Choose a reason for hiding this comment

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

added parse_and_verify functions to the example to make it end-to-end. kept it as example code to match protocol/examples/parse_and_verify.rs, but i'm open to adding it as a library function. i think this is fine since this is simple signature verification using common crates.

@tejasbadadare
Copy link
Contributor

tejasbadadare commented Jan 31, 2025

Thanks all for the helpful insights on the binary protocol, round 2 is up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants