-
Notifications
You must be signed in to change notification settings - Fork 17
Clean up lazer JS examples #63
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,113 @@ | ||||||
# Pyth Lazer JavaScript SDK Examples | ||||||
|
||||||
This directory contains JavaScript/TypeScript examples demonstrating how to use the Pyth Lazer SDK to interact with real-time price feeds and verify cryptographic messages on the Solana blockchain. | ||||||
|
||||||
## What is Pyth Lazer? | ||||||
|
||||||
Pyth Lazer is a high-performance, low-latency price feed service that provides real-time financial market data to blockchain applications. It supports multiple blockchain networks and offers both JSON and binary message formats for optimal performance. | ||||||
|
||||||
## Prerequisites | ||||||
|
||||||
Before running these examples, make sure you have the following installed: | ||||||
|
||||||
- **Node.js** (version 18 or higher) | ||||||
- **pnpm** package manager | ||||||
- A Lazer Access Token -- please see the TODO. | ||||||
|
||||||
## Installation | ||||||
|
||||||
1. Navigate to the `lazer/js` directory: | ||||||
```bash | ||||||
cd lazer/js | ||||||
``` | ||||||
|
||||||
2. Install dependencies: | ||||||
```bash | ||||||
pnpm install | ||||||
``` | ||||||
3. Configure your access token: | ||||||
```bash | ||||||
export ACCESS_TOKEN=your_actual_token | ||||||
``` | ||||||
|
||||||
## Basic Examples | ||||||
|
||||||
### 1. WebSocket Client Example (`src/index.ts`) | ||||||
Demonstrates how to connect to the Pyth Lazer WebSocket stream and receive real-time price feed updates. | ||||||
|
Demonstrates how to connect to the Pyth Lazer WebSocket stream and receive real-time price feed updates. | |
Demonstrates how to connect to the Pyth Lazer WebSocket stream and receive real-time price updates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a TODO to the link to price feeds ID table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the thing to do is to actually use the client to query the symbols for these ids and then print it out nicely. Unfortunately that's not in the SDK right now but i'll push to get it added .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just say
verify prices
orverify price updates
rathercryptographic messsages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe priceUpdates ? 🤔