Parcourir la source

fix: update HexString type and fix import paths

Co-Authored-By: Connor Prussin <connor@dourolabs.xyz>
Devin AI il y a 9 mois
Parent
commit
78e873c4af

+ 1 - 1
price_service/sdk/js/src/index.ts

@@ -22,9 +22,9 @@ export type {
   PriceFeedRequestConfig,
   PriceServiceConnectionConfig,
   PriceFeedUpdateCallback,
-  HexString,
 } from "./types.js";
 export { PriceServiceConnection } from "./client/PriceServiceConnection.js";
+export { HexString } from "./types.js";
 
 /**
  * A Pyth Price represented as `${price} ± ${conf} * 10^${expo}` published at `publishTime`.

+ 18 - 0
price_service/sdk/js/src/types.ts

@@ -1,7 +1,17 @@
+export const HexString = String as { new(...args: any[]): string };
 export type HexString = string;
 
 export interface PriceFeedRequestConfig {
   binary?: boolean;
+  verbose?: boolean;
+  allowOutOfOrder?: boolean;
+  logger?: {
+    trace: (...args: any[]) => void;
+    debug: (...args: any[]) => void;
+    info: (...args: any[]) => void;
+    warn: (...args: any[]) => void;
+    error: (...args: any[]) => void;
+  };
 }
 
 export interface PriceServiceConnectionConfig {
@@ -9,6 +19,14 @@ export interface PriceServiceConnectionConfig {
   priceFeedRequestConfig?: PriceFeedRequestConfig;
   timeout?: number;
   httpRetries?: number;
+  verbose?: boolean;
+  logger?: {
+    trace: (...args: any[]) => void;
+    debug: (...args: any[]) => void;
+    info: (...args: any[]) => void;
+    warn: (...args: any[]) => void;
+    error: (...args: any[]) => void;
+  };
 }
 
 export type PriceFeedUpdateCallback = (priceFeed: any) => void;

+ 2 - 2
target_chains/aptos/sdk/js/src/AptosPriceServiceConnection.ts

@@ -1,5 +1,5 @@
-import { PriceServiceConnection } from "@pythnetwork/price-service-sdk";
-import type { HexString } from "@pythnetwork/price-service-sdk";
+import { PriceServiceConnection } from "@pythnetwork/price-service-sdk/lib/client/PriceServiceConnection.js";
+import { HexString } from "@pythnetwork/price-service-sdk/lib/types.js";
 import { BCS } from "aptos";
 import { Buffer } from "buffer";