Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function getOneLeEcdsaUpdate(token: string) {
token,
});

const latestPrice = await lazer.get_latest_price({
const latestPrice = await lazer.getLatestPrice({
priceFeedIds: [1],
properties: ["price", "bestBidPrice", "bestAskPrice", "exponent"],
formats: ["leEcdsa"],
Expand Down
2 changes: 1 addition & 1 deletion lazer/contracts/sui/sdk/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/pyth-lazer-sui-js",
"version": "0.1.1",
"version": "0.1.2",
"description": "TypeScript SDK for the Pyth Lazer Sui contract",
"license": "Apache-2.0",
"type": "module",
Expand Down
6 changes: 3 additions & 3 deletions lazer/sdk/js/examples/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const client = await PythLazerClient.create({

// Example 1: Get latest price for BTC using feed IDs
console.log("\n=== Example 1: Latest BTC price (requested with feed ID) ===");
const response1 = await client.get_latest_price({
const response1 = await client.getLatestPrice({
priceFeedIds: [1],
properties: ["price", "confidence", "exponent"],
formats: [],
Expand All @@ -22,7 +22,7 @@ displayParsedPrices(response1);

// Example 2: Get latest price using symbols
console.log("\n=== Example 2: Latest ETH price (requested with symbols) ===");
const response2 = await client.get_latest_price({
const response2 = await client.getLatestPrice({
priceFeedIds: [2],
properties: ["price", "confidence", "exponent"],
formats: [],
Expand All @@ -37,7 +37,7 @@ const timestamp = 1_754_348_458_565_000;
console.log(
`Requesting price from timestamp: ${timestamp.toString()} (${new Date(timestamp / 1000).toISOString()})`,
);
const response3 = await client.get_price({
const response3 = await client.getPrice({
timestamp: timestamp,
priceFeedIds: [1],
properties: ["price", "confidence", "exponent"],
Expand Down
2 changes: 1 addition & 1 deletion lazer/sdk/js/examples/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const client = await PythLazerClient.create({
});

// Fetch current map of price feeds
void client.get_symbols().then((symbols) => {
void client.getSymbols().then((symbols) => {
for (const symbol of symbols) {
symbolsMap.set(symbol.pyth_lazer_id, symbol.symbol);
}
Expand Down
6 changes: 3 additions & 3 deletions lazer/sdk/js/examples/symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ const client = await PythLazerClient.create({

// Example 1: Get latest price for BTC using feed IDs
console.log("\n=== Example 1: Search feeds by name/symbol ===");
const response1 = await client.get_symbols({ query: "BTC" });
const response1 = await client.getSymbols({ query: "BTC" });
console.log(response1);

// Example 2: Get latest price using symbols
console.log("\n=== Example 2: Get feeds by asset type ===");
const response2 = await client.get_symbols({
const response2 = await client.getSymbols({
asset_type: "equity",
});
console.log(response2);

// Example 3: Get feeds by asset type and query
console.log("\n=== Example 3: Get feeds by asset type and name/symbol ===");
const response3 = await client.get_symbols({
const response3 = await client.getSymbols({
asset_type: "equity",
query: "AAPL",
});
Expand Down
2 changes: 1 addition & 1 deletion lazer/sdk/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/pyth-lazer-sdk",
"version": "3.0.1",
"version": "4.0.0",
"description": "Pyth Lazer SDK",
"publishConfig": {
"access": "public"
Expand Down
10 changes: 5 additions & 5 deletions lazer/sdk/js/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class PythLazerClient {
* @param params - Optional query parameters to filter symbols
* @returns Promise resolving to array of symbol information
*/
async get_symbols(params?: SymbolsQueryParams): Promise<SymbolResponse[]> {
async getSymbols(params?: SymbolsQueryParams): Promise<SymbolResponse[]> {
const url = new URL(`${this.metadataServiceUrl}/v1/symbols`);

if (params?.query) {
Expand Down Expand Up @@ -252,12 +252,12 @@ export class PythLazerClient {
* @param params - Parameters for the latest price request
* @returns Promise resolving to JsonUpdate with current price data
*/
async get_latest_price(params: LatestPriceRequest): Promise<JsonUpdate> {
async getLatestPrice(params: LatestPriceRequest): Promise<JsonUpdate> {
const url = `${this.priceServiceUrl}/v1/latest_price`;

try {
const body = JSON.stringify(params);
this.logger.debug("get_latest_price", { url, body });
this.logger.debug("getLatestPrice", { url, body });
const response = await this.authenticatedFetch(url, {
method: "POST",
headers: {
Expand All @@ -283,12 +283,12 @@ export class PythLazerClient {
* @param params - Parameters for the price request including timestamp
* @returns Promise resolving to JsonUpdate with price data at the specified time
*/
async get_price(params: PriceRequest): Promise<JsonUpdate> {
async getPrice(params: PriceRequest): Promise<JsonUpdate> {
const url = `${this.priceServiceUrl}/v1/price`;

try {
const body = JSON.stringify(params);
this.logger.debug("get_price", { url, body });
this.logger.debug("getPrice", { url, body });
const response = await this.authenticatedFetch(url, {
method: "POST",
headers: {
Expand Down
Loading