@pythnetwork/pyth-lazer-sdk 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.d.ts +3 -3
- package/dist/cjs/client.js +5 -5
- package/dist/cjs/protocol.d.ts +1 -0
- package/dist/esm/client.d.ts +3 -3
- package/dist/esm/client.js +5 -5
- package/dist/esm/protocol.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/client.d.ts
CHANGED
|
@@ -70,17 +70,17 @@ export declare class PythLazerClient {
|
|
|
70
70
|
* @param params - Optional query parameters to filter symbols
|
|
71
71
|
* @returns Promise resolving to array of symbol information
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
getSymbols(params?: SymbolsQueryParams): Promise<SymbolResponse[]>;
|
|
74
74
|
/**
|
|
75
75
|
* Queries the latest price endpoint to get current price data.
|
|
76
76
|
* @param params - Parameters for the latest price request
|
|
77
77
|
* @returns Promise resolving to JsonUpdate with current price data
|
|
78
78
|
*/
|
|
79
|
-
|
|
79
|
+
getLatestPrice(params: LatestPriceRequest): Promise<JsonUpdate>;
|
|
80
80
|
/**
|
|
81
81
|
* Queries the price endpoint to get historical price data at a specific timestamp.
|
|
82
82
|
* @param params - Parameters for the price request including timestamp
|
|
83
83
|
* @returns Promise resolving to JsonUpdate with price data at the specified time
|
|
84
84
|
*/
|
|
85
|
-
|
|
85
|
+
getPrice(params: PriceRequest): Promise<JsonUpdate>;
|
|
86
86
|
}
|
package/dist/cjs/client.js
CHANGED
|
@@ -161,7 +161,7 @@ class PythLazerClient {
|
|
|
161
161
|
* @param params - Optional query parameters to filter symbols
|
|
162
162
|
* @returns Promise resolving to array of symbol information
|
|
163
163
|
*/
|
|
164
|
-
async
|
|
164
|
+
async getSymbols(params) {
|
|
165
165
|
const url = new URL(`${this.metadataServiceUrl}/v1/symbols`);
|
|
166
166
|
if (params?.query) {
|
|
167
167
|
url.searchParams.set("query", params.query);
|
|
@@ -185,11 +185,11 @@ class PythLazerClient {
|
|
|
185
185
|
* @param params - Parameters for the latest price request
|
|
186
186
|
* @returns Promise resolving to JsonUpdate with current price data
|
|
187
187
|
*/
|
|
188
|
-
async
|
|
188
|
+
async getLatestPrice(params) {
|
|
189
189
|
const url = `${this.priceServiceUrl}/v1/latest_price`;
|
|
190
190
|
try {
|
|
191
191
|
const body = JSON.stringify(params);
|
|
192
|
-
this.logger.debug("
|
|
192
|
+
this.logger.debug("getLatestPrice", { url, body });
|
|
193
193
|
const response = await this.authenticatedFetch(url, {
|
|
194
194
|
method: "POST",
|
|
195
195
|
headers: {
|
|
@@ -211,11 +211,11 @@ class PythLazerClient {
|
|
|
211
211
|
* @param params - Parameters for the price request including timestamp
|
|
212
212
|
* @returns Promise resolving to JsonUpdate with price data at the specified time
|
|
213
213
|
*/
|
|
214
|
-
async
|
|
214
|
+
async getPrice(params) {
|
|
215
215
|
const url = `${this.priceServiceUrl}/v1/price`;
|
|
216
216
|
try {
|
|
217
217
|
const body = JSON.stringify(params);
|
|
218
|
-
this.logger.debug("
|
|
218
|
+
this.logger.debug("getPrice", { url, body });
|
|
219
219
|
const response = await this.authenticatedFetch(url, {
|
|
220
220
|
method: "POST",
|
|
221
221
|
headers: {
|
package/dist/cjs/protocol.d.ts
CHANGED
package/dist/esm/client.d.ts
CHANGED
|
@@ -70,17 +70,17 @@ export declare class PythLazerClient {
|
|
|
70
70
|
* @param params - Optional query parameters to filter symbols
|
|
71
71
|
* @returns Promise resolving to array of symbol information
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
getSymbols(params?: SymbolsQueryParams): Promise<SymbolResponse[]>;
|
|
74
74
|
/**
|
|
75
75
|
* Queries the latest price endpoint to get current price data.
|
|
76
76
|
* @param params - Parameters for the latest price request
|
|
77
77
|
* @returns Promise resolving to JsonUpdate with current price data
|
|
78
78
|
*/
|
|
79
|
-
|
|
79
|
+
getLatestPrice(params: LatestPriceRequest): Promise<JsonUpdate>;
|
|
80
80
|
/**
|
|
81
81
|
* Queries the price endpoint to get historical price data at a specific timestamp.
|
|
82
82
|
* @param params - Parameters for the price request including timestamp
|
|
83
83
|
* @returns Promise resolving to JsonUpdate with price data at the specified time
|
|
84
84
|
*/
|
|
85
|
-
|
|
85
|
+
getPrice(params: PriceRequest): Promise<JsonUpdate>;
|
|
86
86
|
}
|
package/dist/esm/client.js
CHANGED
|
@@ -156,7 +156,7 @@ export class PythLazerClient {
|
|
|
156
156
|
* @param params - Optional query parameters to filter symbols
|
|
157
157
|
* @returns Promise resolving to array of symbol information
|
|
158
158
|
*/
|
|
159
|
-
async
|
|
159
|
+
async getSymbols(params) {
|
|
160
160
|
const url = new URL(`${this.metadataServiceUrl}/v1/symbols`);
|
|
161
161
|
if (params?.query) {
|
|
162
162
|
url.searchParams.set("query", params.query);
|
|
@@ -180,11 +180,11 @@ export class PythLazerClient {
|
|
|
180
180
|
* @param params - Parameters for the latest price request
|
|
181
181
|
* @returns Promise resolving to JsonUpdate with current price data
|
|
182
182
|
*/
|
|
183
|
-
async
|
|
183
|
+
async getLatestPrice(params) {
|
|
184
184
|
const url = `${this.priceServiceUrl}/v1/latest_price`;
|
|
185
185
|
try {
|
|
186
186
|
const body = JSON.stringify(params);
|
|
187
|
-
this.logger.debug("
|
|
187
|
+
this.logger.debug("getLatestPrice", { url, body });
|
|
188
188
|
const response = await this.authenticatedFetch(url, {
|
|
189
189
|
method: "POST",
|
|
190
190
|
headers: {
|
|
@@ -206,11 +206,11 @@ export class PythLazerClient {
|
|
|
206
206
|
* @param params - Parameters for the price request including timestamp
|
|
207
207
|
* @returns Promise resolving to JsonUpdate with price data at the specified time
|
|
208
208
|
*/
|
|
209
|
-
async
|
|
209
|
+
async getPrice(params) {
|
|
210
210
|
const url = `${this.priceServiceUrl}/v1/price`;
|
|
211
211
|
try {
|
|
212
212
|
const body = JSON.stringify(params);
|
|
213
|
-
this.logger.debug("
|
|
213
|
+
this.logger.debug("getPrice", { url, body });
|
|
214
214
|
const response = await this.authenticatedFetch(url, {
|
|
215
215
|
method: "POST",
|
|
216
216
|
headers: {
|
package/dist/esm/protocol.d.ts
CHANGED