Skip to content

Commit

Permalink
fix: update HexString type and fix import paths
Browse files Browse the repository at this point in the history
Co-Authored-By: Connor Prussin <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and cprussin committed Feb 13, 2025
1 parent e9b7ade commit 78e873c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion price_service/sdk/js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
18 changes: 18 additions & 0 deletions price_service/sdk/js/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
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 {
url: string;
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;
4 changes: 2 additions & 2 deletions target_chains/aptos/sdk/js/src/AptosPriceServiceConnection.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down

0 comments on commit 78e873c

Please sign in to comment.