Skip to content

Conversation

jayantk
Copy link
Contributor

@jayantk jayantk commented Sep 12, 2025

I'm trying to make the onboarding journey for Lazer smoother. This PR adds some niceties to the js examples:

  • a nice README
  • make the access token configurable via the environment instead of a code edit
  • use the production Lazer endpoint instead of staging
  • use ./keypair.json for the Solana private key consistently across examples
  • move Solana examples to the solana/ directory to provide context for non-Solana users
  • renames "publish.ts" to "post_solana.ts" to avoid confusion around the term "publish" (could be interpreted to be a publisher)

@@ -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.
Copy link
Member

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 or verify price updates rather cryptographic messsages

Copy link
Member

Choose a reason for hiding this comment

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

maybe priceUpdates ? 🤔

## 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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.


**What it does:**
- Connects to the Pyth Lazer server
- Subscribes to price feeds (IDs 1 and 2)
Copy link
Member

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.

Copy link
Contributor Author

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 .

@jayantk jayantk merged commit 1d13c8d into main Sep 12, 2025
5 checks passed
@jayantk jayantk deleted the lazer_updates1 branch September 12, 2025 17:38
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.

2 participants