diff --git a/lazer/contracts/sui/sdk/js/examples/fetch-and-verify-update.ts b/lazer/contracts/sui/sdk/js/examples/fetch-and-verify-update.ts index 47a3c0dd76..7dabeb7b6e 100644 --- a/lazer/contracts/sui/sdk/js/examples/fetch-and-verify-update.ts +++ b/lazer/contracts/sui/sdk/js/examples/fetch-and-verify-update.ts @@ -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"], diff --git a/lazer/contracts/sui/sdk/js/package.json b/lazer/contracts/sui/sdk/js/package.json index 19c61b3ce7..283b0cb56e 100644 --- a/lazer/contracts/sui/sdk/js/package.json +++ b/lazer/contracts/sui/sdk/js/package.json @@ -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", diff --git a/lazer/sdk/js/examples/history.ts b/lazer/sdk/js/examples/history.ts index 7798618aff..f65e35cff0 100644 --- a/lazer/sdk/js/examples/history.ts +++ b/lazer/sdk/js/examples/history.ts @@ -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: [], @@ -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: [], @@ -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"], diff --git a/lazer/sdk/js/examples/streaming.ts b/lazer/sdk/js/examples/streaming.ts index 1fdbfc5631..890e13d48f 100644 --- a/lazer/sdk/js/examples/streaming.ts +++ b/lazer/sdk/js/examples/streaming.ts @@ -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); } diff --git a/lazer/sdk/js/examples/symbols.ts b/lazer/sdk/js/examples/symbols.ts index afe9e8ef88..abf8ae1844 100644 --- a/lazer/sdk/js/examples/symbols.ts +++ b/lazer/sdk/js/examples/symbols.ts @@ -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", }); diff --git a/lazer/sdk/js/package.json b/lazer/sdk/js/package.json index 85dece8006..809427f2d0 100644 --- a/lazer/sdk/js/package.json +++ b/lazer/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-lazer-sdk", - "version": "3.0.1", + "version": "4.0.0", "description": "Pyth Lazer SDK", "publishConfig": { "access": "public" diff --git a/lazer/sdk/js/src/client.ts b/lazer/sdk/js/src/client.ts index 7bdc16c4bc..56c220955a 100644 --- a/lazer/sdk/js/src/client.ts +++ b/lazer/sdk/js/src/client.ts @@ -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 { + async getSymbols(params?: SymbolsQueryParams): Promise { const url = new URL(`${this.metadataServiceUrl}/v1/symbols`); if (params?.query) { @@ -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 { + async getLatestPrice(params: LatestPriceRequest): Promise { 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: { @@ -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 { + async getPrice(params: PriceRequest): Promise { 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: {