Quellcode durchsuchen

fix(price_pusher): fixed typings

benduran vor 3 Wochen
Ursprung
Commit
0ed1db057c
34 geänderte Dateien mit 607 neuen und 254 gelöschten Zeilen
  1. 337 3
      apps/price_pusher/package.json
  2. 7 6
      apps/price_pusher/src/aptos/aptos.ts
  3. 7 7
      apps/price_pusher/src/aptos/balance-tracker.ts
  4. 10 10
      apps/price_pusher/src/aptos/command.ts
  5. 11 7
      apps/price_pusher/src/controller.ts
  6. 7 7
      apps/price_pusher/src/evm/balance-tracker.ts
  7. 13 13
      apps/price_pusher/src/evm/command.ts
  8. 7 5
      apps/price_pusher/src/evm/custom-gas-station.ts
  9. 15 15
      apps/price_pusher/src/evm/evm.ts
  10. 3 3
      apps/price_pusher/src/evm/pyth-contract.ts
  11. 10 10
      apps/price_pusher/src/evm/super-wallet.ts
  12. 10 7
      apps/price_pusher/src/fuel/command.ts
  13. 18 22
      apps/price_pusher/src/fuel/fuel.ts
  14. 9 9
      apps/price_pusher/src/index.ts
  15. 8 8
      apps/price_pusher/src/injective/command.ts
  16. 10 10
      apps/price_pusher/src/injective/injective.ts
  17. 5 5
      apps/price_pusher/src/interface.ts
  18. 3 3
      apps/price_pusher/src/metrics.ts
  19. 2 2
      apps/price_pusher/src/near/command.ts
  20. 9 9
      apps/price_pusher/src/near/near.ts
  21. 1 1
      apps/price_pusher/src/options.ts
  22. 8 4
      apps/price_pusher/src/price-config.ts
  23. 6 6
      apps/price_pusher/src/pyth-price-listener.ts
  24. 6 6
      apps/price_pusher/src/solana/balance-tracker.ts
  25. 16 16
      apps/price_pusher/src/solana/command.ts
  26. 9 8
      apps/price_pusher/src/solana/solana.ts
  27. 6 6
      apps/price_pusher/src/sui/balance-tracker.ts
  28. 9 9
      apps/price_pusher/src/sui/command.ts
  29. 16 11
      apps/price_pusher/src/sui/sui.ts
  30. 11 9
      apps/price_pusher/src/ton/command.ts
  31. 10 14
      apps/price_pusher/src/ton/ton.ts
  32. 2 2
      apps/price_pusher/src/utils.ts
  33. 2 1
      apps/price_pusher/tsconfig.build.json
  34. 4 0
      apps/price_pusher/tsconfig.json

+ 337 - 3
apps/price_pusher/package.json

@@ -3,8 +3,8 @@
   "version": "10.2.0",
   "description": "Pyth Price Pusher",
   "homepage": "https://pyth.network",
-  "main": "lib/index.js",
-  "types": "lib/index.d.ts",
+  "main": "./dist/cjs/index.js",
+  "types": "./dist/cjs/index.d.ts",
   "files": [
     "dist/**/*"
   ],
@@ -95,5 +95,339 @@
     "pnpm": ">=10.19.0"
   },
   "packageManager": "pnpm@10.19.0",
-  "type": "module"
+  "type": "module",
+  "exports": {
+    "./aptos/aptos": {
+      "require": {
+        "default": "./dist/cjs/aptos/aptos.js",
+        "types": "./dist/cjs/aptos/aptos.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/aptos/aptos.js",
+        "types": "./dist/esm/aptos/aptos.d.ts"
+      }
+    },
+    "./aptos/balance-tracker": {
+      "require": {
+        "default": "./dist/cjs/aptos/balance-tracker.js",
+        "types": "./dist/cjs/aptos/balance-tracker.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/aptos/balance-tracker.js",
+        "types": "./dist/esm/aptos/balance-tracker.d.ts"
+      }
+    },
+    "./aptos/command": {
+      "require": {
+        "default": "./dist/cjs/aptos/command.js",
+        "types": "./dist/cjs/aptos/command.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/aptos/command.js",
+        "types": "./dist/esm/aptos/command.d.ts"
+      }
+    },
+    "./common": {
+      "require": {
+        "default": "./dist/cjs/common.js",
+        "types": "./dist/cjs/common.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/common.js",
+        "types": "./dist/esm/common.d.ts"
+      }
+    },
+    "./controller": {
+      "require": {
+        "default": "./dist/cjs/controller.js",
+        "types": "./dist/cjs/controller.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/controller.js",
+        "types": "./dist/esm/controller.d.ts"
+      }
+    },
+    "./evm/balance-tracker": {
+      "require": {
+        "default": "./dist/cjs/evm/balance-tracker.js",
+        "types": "./dist/cjs/evm/balance-tracker.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/evm/balance-tracker.js",
+        "types": "./dist/esm/evm/balance-tracker.d.ts"
+      }
+    },
+    "./evm/command": {
+      "require": {
+        "default": "./dist/cjs/evm/command.js",
+        "types": "./dist/cjs/evm/command.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/evm/command.js",
+        "types": "./dist/esm/evm/command.d.ts"
+      }
+    },
+    "./evm/custom-gas-station": {
+      "require": {
+        "default": "./dist/cjs/evm/custom-gas-station.js",
+        "types": "./dist/cjs/evm/custom-gas-station.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/evm/custom-gas-station.js",
+        "types": "./dist/esm/evm/custom-gas-station.d.ts"
+      }
+    },
+    "./evm/evm": {
+      "require": {
+        "default": "./dist/cjs/evm/evm.js",
+        "types": "./dist/cjs/evm/evm.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/evm/evm.js",
+        "types": "./dist/esm/evm/evm.d.ts"
+      }
+    },
+    "./evm/pyth-abi": {
+      "require": {
+        "default": "./dist/cjs/evm/pyth-abi.js",
+        "types": "./dist/cjs/evm/pyth-abi.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/evm/pyth-abi.js",
+        "types": "./dist/esm/evm/pyth-abi.d.ts"
+      }
+    },
+    "./evm/pyth-contract": {
+      "require": {
+        "default": "./dist/cjs/evm/pyth-contract.js",
+        "types": "./dist/cjs/evm/pyth-contract.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/evm/pyth-contract.js",
+        "types": "./dist/esm/evm/pyth-contract.d.ts"
+      }
+    },
+    "./evm/super-wallet": {
+      "require": {
+        "default": "./dist/cjs/evm/super-wallet.js",
+        "types": "./dist/cjs/evm/super-wallet.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/evm/super-wallet.js",
+        "types": "./dist/esm/evm/super-wallet.d.ts"
+      }
+    },
+    "./fuel/command": {
+      "require": {
+        "default": "./dist/cjs/fuel/command.js",
+        "types": "./dist/cjs/fuel/command.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/fuel/command.js",
+        "types": "./dist/esm/fuel/command.d.ts"
+      }
+    },
+    "./fuel/fuel": {
+      "require": {
+        "default": "./dist/cjs/fuel/fuel.js",
+        "types": "./dist/cjs/fuel/fuel.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/fuel/fuel.js",
+        "types": "./dist/esm/fuel/fuel.d.ts"
+      }
+    },
+    ".": {
+      "require": {
+        "default": "./dist/cjs/index.js",
+        "types": "./dist/cjs/index.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/index.js",
+        "types": "./dist/esm/index.d.ts"
+      }
+    },
+    "./injective/command": {
+      "require": {
+        "default": "./dist/cjs/injective/command.js",
+        "types": "./dist/cjs/injective/command.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/injective/command.js",
+        "types": "./dist/esm/injective/command.d.ts"
+      }
+    },
+    "./injective/injective": {
+      "require": {
+        "default": "./dist/cjs/injective/injective.js",
+        "types": "./dist/cjs/injective/injective.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/injective/injective.js",
+        "types": "./dist/esm/injective/injective.d.ts"
+      }
+    },
+    "./interface": {
+      "require": {
+        "default": "./dist/cjs/interface.js",
+        "types": "./dist/cjs/interface.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/interface.js",
+        "types": "./dist/esm/interface.d.ts"
+      }
+    },
+    "./metrics": {
+      "require": {
+        "default": "./dist/cjs/metrics.js",
+        "types": "./dist/cjs/metrics.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/metrics.js",
+        "types": "./dist/esm/metrics.d.ts"
+      }
+    },
+    "./near/command": {
+      "require": {
+        "default": "./dist/cjs/near/command.js",
+        "types": "./dist/cjs/near/command.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/near/command.js",
+        "types": "./dist/esm/near/command.d.ts"
+      }
+    },
+    "./near/near": {
+      "require": {
+        "default": "./dist/cjs/near/near.js",
+        "types": "./dist/cjs/near/near.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/near/near.js",
+        "types": "./dist/esm/near/near.d.ts"
+      }
+    },
+    "./options": {
+      "require": {
+        "default": "./dist/cjs/options.js",
+        "types": "./dist/cjs/options.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/options.js",
+        "types": "./dist/esm/options.d.ts"
+      }
+    },
+    "./price-config": {
+      "require": {
+        "default": "./dist/cjs/price-config.js",
+        "types": "./dist/cjs/price-config.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/price-config.js",
+        "types": "./dist/esm/price-config.d.ts"
+      }
+    },
+    "./pyth-price-listener": {
+      "require": {
+        "default": "./dist/cjs/pyth-price-listener.js",
+        "types": "./dist/cjs/pyth-price-listener.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/pyth-price-listener.js",
+        "types": "./dist/esm/pyth-price-listener.d.ts"
+      }
+    },
+    "./solana/balance-tracker": {
+      "require": {
+        "default": "./dist/cjs/solana/balance-tracker.js",
+        "types": "./dist/cjs/solana/balance-tracker.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/solana/balance-tracker.js",
+        "types": "./dist/esm/solana/balance-tracker.d.ts"
+      }
+    },
+    "./solana/command": {
+      "require": {
+        "default": "./dist/cjs/solana/command.js",
+        "types": "./dist/cjs/solana/command.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/solana/command.js",
+        "types": "./dist/esm/solana/command.d.ts"
+      }
+    },
+    "./solana/solana": {
+      "require": {
+        "default": "./dist/cjs/solana/solana.js",
+        "types": "./dist/cjs/solana/solana.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/solana/solana.js",
+        "types": "./dist/esm/solana/solana.d.ts"
+      }
+    },
+    "./sui/balance-tracker": {
+      "require": {
+        "default": "./dist/cjs/sui/balance-tracker.js",
+        "types": "./dist/cjs/sui/balance-tracker.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/sui/balance-tracker.js",
+        "types": "./dist/esm/sui/balance-tracker.d.ts"
+      }
+    },
+    "./sui/command": {
+      "require": {
+        "default": "./dist/cjs/sui/command.js",
+        "types": "./dist/cjs/sui/command.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/sui/command.js",
+        "types": "./dist/esm/sui/command.d.ts"
+      }
+    },
+    "./sui/sui": {
+      "require": {
+        "default": "./dist/cjs/sui/sui.js",
+        "types": "./dist/cjs/sui/sui.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/sui/sui.js",
+        "types": "./dist/esm/sui/sui.d.ts"
+      }
+    },
+    "./ton/command": {
+      "require": {
+        "default": "./dist/cjs/ton/command.js",
+        "types": "./dist/cjs/ton/command.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/ton/command.js",
+        "types": "./dist/esm/ton/command.d.ts"
+      }
+    },
+    "./ton/ton": {
+      "require": {
+        "default": "./dist/cjs/ton/ton.js",
+        "types": "./dist/cjs/ton/ton.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/ton/ton.js",
+        "types": "./dist/esm/ton/ton.d.ts"
+      }
+    },
+    "./utils": {
+      "require": {
+        "default": "./dist/cjs/utils.js",
+        "types": "./dist/cjs/utils.d.ts"
+      },
+      "import": {
+        "default": "./dist/esm/utils.js",
+        "types": "./dist/esm/utils.d.ts"
+      }
+    },
+    "./package.json": "./package.json"
+  },
+  "module": "./dist/esm/index.js"
 }

+ 7 - 6
apps/price_pusher/src/aptos/aptos.ts

@@ -1,13 +1,13 @@
 import {
   ChainPriceListener,
-  IPricePusher,
-  PriceInfo,
-  PriceItem,
-} from "../interface";
+  type IPricePusher,
+  type PriceInfo,
+  type PriceItem,
+} from "../interface.js";
 import { AptosAccount, AptosClient } from "aptos";
-import { DurationInSeconds } from "../utils";
+import type { DurationInSeconds } from "../utils.js";
 import { HermesClient } from "@pythnetwork/hermes-client";
-import { Logger } from "pino";
+import type { Logger } from "pino";
 
 export class AptosPriceListener extends ChainPriceListener {
   constructor(
@@ -94,6 +94,7 @@ export class AptosPricePusher implements IPricePusher {
     private pythContractAddress: string,
     private endpoint: string,
     private mnemonic: string,
+    // @ts-expect-error - TODO: this class member is unused. remove this exception when it is
     private overrideGasPriceMultiplier: number,
   ) {
     this.sequenceNumberLocked = false;

+ 7 - 7
apps/price_pusher/src/aptos/balance-tracker.ts

@@ -1,12 +1,12 @@
 import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
 import {
   BaseBalanceTracker,
-  BaseBalanceTrackerConfig,
-  IBalanceTracker,
-} from "../interface";
-import { DurationInSeconds } from "../utils";
-import { PricePusherMetrics } from "../metrics";
-import { Logger } from "pino";
+  type BaseBalanceTrackerConfig,
+  type IBalanceTracker,
+} from "../interface.js";
+import type { DurationInSeconds } from "../utils.js";
+import { PricePusherMetrics } from "../metrics.js";
+import type { Logger } from "pino";
 
 /**
  * Aptos-specific configuration for balance tracker
@@ -104,5 +104,5 @@ export function createAptosBalanceTracker(
     metrics: params.metrics,
     logger: params.logger,
     decimals: params.decimals,
-  });
+  } as AptosBalanceTrackerConfig);
 }

+ 10 - 10
apps/price_pusher/src/aptos/command.ts

@@ -1,20 +1,20 @@
 import { HermesClient } from "@pythnetwork/hermes-client";
-import * as options from "../options";
-import { readPriceConfigFile } from "../price-config";
+import * as options from "../options.js";
+import { readPriceConfigFile } from "../price-config.js";
 import fs from "fs";
-import { PythPriceListener } from "../pyth-price-listener";
-import { Controller } from "../controller";
-import { Options } from "yargs";
+import { PythPriceListener } from "../pyth-price-listener.js";
+import { Controller } from "../controller.js";
+import type { Options } from "yargs";
 import {
   AptosPriceListener,
   AptosPricePusher,
   APTOS_ACCOUNT_HD_PATH,
-} from "./aptos";
+} from "./aptos.js";
 import { AptosAccount } from "aptos";
 import pino from "pino";
-import { filterInvalidPriceItems } from "../utils";
-import { PricePusherMetrics } from "../metrics";
-import { createAptosBalanceTracker } from "./balance-tracker";
+import { filterInvalidPriceItems } from "../utils.js";
+import { PricePusherMetrics } from "../metrics.js";
+import { createAptosBalanceTracker } from "./balance-tracker.js";
 
 export default {
   command: "aptos",
@@ -130,7 +130,7 @@ export default {
       logger.child({ module: "Controller" }, { level: controllerLogLevel }),
       {
         pushingFrequency,
-        metrics,
+        metrics: metrics!,
       },
     );
 

+ 11 - 7
apps/price_pusher/src/controller.ts

@@ -1,13 +1,17 @@
-import { UnixTimestamp } from "@pythnetwork/hermes-client";
-import { DurationInSeconds, sleep } from "./utils";
-import { IPriceListener, IPricePusher } from "./interface";
-import { PriceConfig, shouldUpdate, UpdateCondition } from "./price-config";
-import { Logger } from "pino";
-import { PricePusherMetrics } from "./metrics";
+import type { UnixTimestamp } from "@pythnetwork/hermes-client";
+import { type DurationInSeconds, sleep } from "./utils.js";
+import type { IPriceListener, IPricePusher } from "./interface.js";
+import {
+  type PriceConfig,
+  shouldUpdate,
+  UpdateCondition,
+} from "./price-config.js";
+import type { Logger } from "pino";
+import { PricePusherMetrics } from "./metrics.js";
 
 export class Controller {
   private pushingFrequency: DurationInSeconds;
-  private metrics?: PricePusherMetrics;
+  private metrics?: PricePusherMetrics | undefined;
 
   constructor(
     private priceConfigs: PriceConfig[],

+ 7 - 7
apps/price_pusher/src/evm/balance-tracker.ts

@@ -1,12 +1,12 @@
-import { SuperWalletClient } from "./super-wallet";
+import type { SuperWalletClient } from "./super-wallet.js";
 import {
   BaseBalanceTracker,
-  BaseBalanceTrackerConfig,
-  IBalanceTracker,
-} from "../interface";
-import { DurationInSeconds } from "../utils";
-import { PricePusherMetrics } from "../metrics";
-import { Logger } from "pino";
+  type BaseBalanceTrackerConfig,
+  type IBalanceTracker,
+} from "../interface.js";
+import type { DurationInSeconds } from "../utils.js";
+import { PricePusherMetrics } from "../metrics.js";
+import type { Logger } from "pino";
 
 /**
  * EVM-specific configuration for balance tracker

+ 13 - 13
apps/price_pusher/src/evm/command.ts

@@ -1,18 +1,18 @@
 import { HermesClient } from "@pythnetwork/hermes-client";
 import fs from "fs";
-import { Options } from "yargs";
-import * as options from "../options";
-import { readPriceConfigFile } from "../price-config";
-import { PythPriceListener } from "../pyth-price-listener";
-import { Controller } from "../controller";
-import { EvmPriceListener, EvmPricePusher } from "./evm";
-import { getCustomGasStation } from "./custom-gas-station";
+import type { Options } from "yargs";
+import * as options from "../options.js";
+import { readPriceConfigFile } from "../price-config.js";
+import { PythPriceListener } from "../pyth-price-listener.js";
+import { Controller } from "../controller.js";
+import { EvmPriceListener, EvmPricePusher } from "./evm.js";
+import { getCustomGasStation } from "./custom-gas-station.js";
 import pino from "pino";
-import { createClient } from "./super-wallet";
-import { createPythContract } from "./pyth-contract";
-import { isWsEndpoint, filterInvalidPriceItems } from "../utils";
-import { PricePusherMetrics } from "../metrics";
-import { createEvmBalanceTracker } from "./balance-tracker";
+import { createClient } from "./super-wallet.js";
+import { createPythContract } from "./pyth-contract.js";
+import { isWsEndpoint, filterInvalidPriceItems } from "../utils.js";
+import { PricePusherMetrics } from "../metrics.js";
+import { createEvmBalanceTracker } from "./balance-tracker.js";
 
 export default {
   command: "evm",
@@ -198,7 +198,7 @@ export default {
       logger.child({ module: "Controller" }, { level: controllerLogLevel }),
       {
         pushingFrequency,
-        metrics,
+        metrics: metrics!,
       },
     );
 

+ 7 - 5
apps/price_pusher/src/evm/custom-gas-station.ts

@@ -1,11 +1,11 @@
 import {
-  CustomGasChainId,
-  TxSpeed,
+  type CustomGasChainId,
+  type TxSpeed,
   verifyValidOption,
   txSpeeds,
   customGasChainIds,
-} from "../utils";
-import { Logger } from "pino";
+} from "../utils.js";
+import type { Logger } from "pino";
 import { parseGwei } from "viem";
 
 type chainMethods = Record<CustomGasChainId, () => Promise<bigint | undefined>>;
@@ -30,7 +30,8 @@ export class CustomGasStation {
   private async fetchMaticMainnetGasPrice() {
     try {
       const res = await fetch("https://gasstation.polygon.technology/v2");
-      const jsonRes = await res.json();
+      // TODO: improve the typing specificity here
+      const jsonRes = (await res.json()) as any;
       const gasPrice = jsonRes[this.speed].maxFee;
       return parseGwei(gasPrice.toFixed(2));
     } catch (err) {
@@ -51,4 +52,5 @@ export function getCustomGasStation(
   if (customGasStation && txSpeed) {
     return new CustomGasStation(logger, customGasStation, txSpeed);
   }
+  return;
 }

+ 15 - 15
apps/price_pusher/src/evm/evm.ts

@@ -1,26 +1,26 @@
 import {
-  IPricePusher,
-  PriceInfo,
+  type IPricePusher,
+  type PriceInfo,
   ChainPriceListener,
-  PriceItem,
-} from "../interface";
+  type PriceItem,
+} from "../interface.js";
 import {
   addLeading0x,
   assertDefined,
-  DurationInSeconds,
+  type DurationInSeconds,
   removeLeading0x,
-} from "../utils";
-import { PythAbi } from "./pyth-abi";
-import { Logger } from "pino";
+} from "../utils.js";
+import { PythAbi } from "./pyth-abi.js";
+import type { Logger } from "pino";
 import {
   HermesClient,
-  HexString,
-  UnixTimestamp,
+  type HexString,
+  type UnixTimestamp,
 } from "@pythnetwork/hermes-client";
 import { CustomGasStation } from "./custom-gas-station";
-import { PushAttempt } from "../common";
+import type { PushAttempt } from "../common.js";
 import {
-  WatchContractEventOnLogsParameter,
+  type WatchContractEventOnLogsParameter,
   TransactionExecutionError,
   BaseError,
   ContractFunctionRevertedError,
@@ -30,8 +30,8 @@ import {
   ContractFunctionExecutionError,
 } from "viem";
 
-import { PythContract } from "./pyth-contract";
-import { SuperWalletClient } from "./super-wallet";
+import type { PythContract } from "./pyth-contract.js";
+import type { SuperWalletClient } from "./super-wallet.js";
 
 export class EvmPriceListener extends ChainPriceListener {
   constructor(
@@ -51,7 +51,7 @@ export class EvmPriceListener extends ChainPriceListener {
 
   // This method should be awaited on and once it finishes it has the latest value
   // for the given price feeds (if they exist).
-  async start() {
+  override async start() {
     if (this.watchEvents) {
       this.logger.info("Watching target network pyth contract events...");
       this.startWatching();

+ 3 - 3
apps/price_pusher/src/evm/pyth-contract.ts

@@ -1,6 +1,6 @@
-import { getContract, Address, GetContractReturnType } from "viem";
-import { PythAbi } from "./pyth-abi";
-import { SuperWalletClient } from "./super-wallet";
+import { getContract, type Address, type GetContractReturnType } from "viem";
+import { PythAbi } from "./pyth-abi.js";
+import type { SuperWalletClient } from "./super-wallet.js";
 
 export type PythContract = GetContractReturnType<
   typeof PythAbi,

+ 10 - 10
apps/price_pusher/src/evm/super-wallet.ts

@@ -4,20 +4,20 @@ import {
   defineChain,
   http,
   webSocket,
-  Account,
-  Chain,
+  type Account,
+  type Chain,
   publicActions,
-  Client,
-  RpcSchema,
-  WalletActions,
-  PublicActions,
-  WebSocketTransport,
-  HttpTransport,
-  Transport,
+  type Client,
+  type RpcSchema,
+  type WalletActions,
+  type PublicActions,
+  type WebSocketTransport,
+  type HttpTransport,
+  type Transport,
 } from "viem";
 import { mnemonicToAccount } from "viem/accounts";
 import * as chains from "viem/chains";
-import { isWsEndpoint } from "../utils";
+import { isWsEndpoint } from "../utils.js";
 
 const UNKNOWN_CHAIN_CONFIG = {
   name: "Unknown",

+ 10 - 7
apps/price_pusher/src/fuel/command.ts

@@ -1,14 +1,15 @@
-import { Options } from "yargs";
-import * as options from "../options";
-import { readPriceConfigFile } from "../price-config";
+import type { Options } from "yargs";
+import * as options from "../options.js";
+import { readPriceConfigFile } from "../price-config.js";
 import { HermesClient } from "@pythnetwork/hermes-client";
-import { PythPriceListener } from "../pyth-price-listener";
-import { FuelPriceListener, FuelPricePusher } from "./fuel";
-import { Controller } from "../controller";
+import { PythPriceListener } from "../pyth-price-listener.js";
+import { FuelPriceListener, FuelPricePusher } from "./fuel.js";
+import { Controller } from "../controller.js";
 import { Provider, Wallet } from "fuels";
 import fs from "fs";
 import pino from "pino";
-import { filterInvalidPriceItems } from "../utils";
+import { filterInvalidPriceItems } from "../utils.js";
+
 export default {
   command: "fuel",
   describe: "run price pusher for Fuel",
@@ -76,6 +77,8 @@ export default {
       logger.child({ module: "PythPriceListener" }),
     );
 
+    // @ts-expect-error - TODO: this dependency's typings are mismatched and there isn't a create() function on the Provider
+    // which may blow up at runtime (but this was existing behavior as of 29 Oct 2025)
     const provider = await Provider.create(endpoint);
     const privateKey = fs.readFileSync(privateKeyFile, "utf8").trim();
     const wallet = Wallet.fromPrivateKey(privateKey, provider);

+ 18 - 22
apps/price_pusher/src/fuel/fuel.ts

@@ -1,12 +1,12 @@
 import { HermesClient } from "@pythnetwork/hermes-client";
 import {
   ChainPriceListener,
-  IPricePusher,
-  PriceInfo,
-  PriceItem,
-} from "../interface";
-import { addLeading0x, DurationInSeconds } from "../utils";
-import { Logger } from "pino";
+  type IPricePusher,
+  type PriceInfo,
+  type PriceItem,
+} from "../interface.js";
+import { addLeading0x, type DurationInSeconds } from "../utils.js";
+import type { Logger } from "pino";
 import { Provider, Contract, hexlify, arrayify, Wallet, BN } from "fuels";
 import {
   PYTH_CONTRACT_ABI,
@@ -45,13 +45,13 @@ export class FuelPriceListener extends ChainPriceListener {
     try {
       const formattedPriceId = addLeading0x(priceId);
       const priceInfo = await this.contract.functions
-        .price_unsafe(formattedPriceId)
+        .price_unsafe?.(formattedPriceId)
         .get();
 
       console.log({
-        conf: priceInfo.value.confidence.toString(),
-        price: priceInfo.value.price.toString(),
-        publishTime: tai64ToUnix(priceInfo.value.publish_time),
+        conf: priceInfo?.value.confidence.toString(),
+        price: priceInfo?.value.price.toString(),
+        publishTime: tai64ToUnix(priceInfo?.value.publish_time),
       });
 
       this.logger.debug(
@@ -61,9 +61,9 @@ export class FuelPriceListener extends ChainPriceListener {
       );
 
       return {
-        conf: priceInfo.value.confidence.toString(),
-        price: priceInfo.value.price.toString(),
-        publishTime: tai64ToUnix(priceInfo.value.publish_time),
+        conf: priceInfo?.value.confidence.toString() ?? "",
+        price: priceInfo?.value.price.toString() ?? "",
+        publishTime: tai64ToUnix(priceInfo?.value.publish_time),
       };
     } catch (err) {
       this.logger.error({ err, priceId }, `Polling on-chain price failed.`);
@@ -88,11 +88,7 @@ export class FuelPricePusher implements IPricePusher {
     );
   }
 
-  async updatePriceFeed(
-    priceIds: string[],
-    // eslint-disable-next-line @typescript-eslint/no-unused-vars
-    pubTimesToPush: number[],
-  ): Promise<void> {
+  async updatePriceFeed(priceIds: string[], _: number[]): Promise<void> {
     if (priceIds.length === 0) {
       return;
     }
@@ -113,18 +109,18 @@ export class FuelPricePusher implements IPricePusher {
 
     try {
       const updateFee = await this.contract.functions
-        .update_fee(updateData)
+        .update_fee?.(updateData)
         .get();
 
       const result = await this.contract.functions
-        .update_price_feeds(updateData)
+        .update_price_feeds?.(updateData)
         .callParams({
-          forward: [updateFee.value, hexlify(FUEL_ETH_ASSET_ID)],
+          forward: [updateFee?.value, hexlify(FUEL_ETH_ASSET_ID)],
         })
         .call();
 
       this.logger.info(
-        { transactionId: result.transactionId },
+        { transactionId: result?.transactionId },
         "updatePriceFeed successful",
       );
     } catch (err: any) {

+ 9 - 9
apps/price_pusher/src/index.ts

@@ -1,15 +1,15 @@
 #!/usr/bin/env node
 import yargs from "yargs";
 import { hideBin } from "yargs/helpers";
-import injective from "./injective/command";
-import evm from "./evm/command";
-import aptos from "./aptos/command";
-import sui from "./sui/command";
-import near from "./near/command";
-import solana from "./solana/command";
-import fuel from "./fuel/command";
-import ton from "./ton/command";
-import { enableMetrics, metricsPort } from "./options";
+import injective from "./injective/command.js";
+import evm from "./evm/command.js";
+import aptos from "./aptos/command.js";
+import sui from "./sui/command.js";
+import near from "./near/command.js";
+import solana from "./solana/command.js";
+import fuel from "./fuel/command.js";
+import ton from "./ton/command.js";
+import { enableMetrics, metricsPort } from "./options.js";
 
 yargs(hideBin(process.argv))
   .parserConfiguration({

+ 8 - 8
apps/price_pusher/src/injective/command.ts

@@ -1,14 +1,14 @@
 import { HermesClient } from "@pythnetwork/hermes-client";
-import * as options from "../options";
-import { readPriceConfigFile } from "../price-config";
+import * as options from "../options.js";
+import { readPriceConfigFile } from "../price-config.js";
 import fs from "fs";
-import { InjectivePriceListener, InjectivePricePusher } from "./injective";
-import { PythPriceListener } from "../pyth-price-listener";
-import { Controller } from "../controller";
-import { Options } from "yargs";
+import { InjectivePriceListener, InjectivePricePusher } from "./injective.js";
+import { PythPriceListener } from "../pyth-price-listener.js";
+import { Controller } from "../controller.js";
+import type { Options } from "yargs";
 import { getNetworkInfo } from "@injectivelabs/networks";
-import pino from "pino";
-import { filterInvalidPriceItems } from "../utils";
+import { pino } from "pino";
+import { filterInvalidPriceItems } from "../utils.js";
 export default {
   command: "injective",
   describe: "run price pusher for injective",

+ 10 - 10
apps/price_pusher/src/injective/injective.ts

@@ -1,15 +1,15 @@
-import { HexString, HermesClient } from "@pythnetwork/hermes-client";
+import { type HexString, HermesClient } from "@pythnetwork/hermes-client";
 import {
-  PriceItem,
-  PriceInfo,
-  IPricePusher,
+  type PriceItem,
+  type PriceInfo,
+  type IPricePusher,
   ChainPriceListener,
-} from "../interface";
-import { DurationInSeconds } from "../utils";
+} from "../interface.js";
+import type { DurationInSeconds } from "../utils.js";
 import {
-  Msgs,
-  Account,
-  TxResponse,
+  type Msgs,
+  type Account,
+  type TxResponse,
   PrivateKey,
   TxGrpcApi,
   ChainGrpcAuthApi,
@@ -18,7 +18,7 @@ import {
   createTransactionFromMsg,
 } from "@injectivelabs/sdk-ts";
 import { splitArrayToChunks } from "@injectivelabs/utils";
-import { Logger } from "pino";
+import type { Logger } from "pino";
 
 const DEFAULT_GAS_PRICE = 160000000;
 const DEFAULT_GAS_MULTIPLIER = 1.05;

+ 5 - 5
apps/price_pusher/src/interface.ts

@@ -1,7 +1,7 @@
-import { HexString, UnixTimestamp } from "@pythnetwork/hermes-client";
-import { DurationInSeconds } from "./utils";
-import { Logger } from "pino";
-import { PricePusherMetrics } from "./metrics";
+import type { HexString, UnixTimestamp } from "@pythnetwork/hermes-client";
+import type { DurationInSeconds } from "./utils.js";
+import type { Logger } from "pino";
+import { PricePusherMetrics } from "./metrics.js";
 
 export type PriceItem = {
   id: HexString;
@@ -152,7 +152,7 @@ export abstract class BaseBalanceTracker implements IBalanceTracker {
 
   private async startUpdateLoop(): Promise<void> {
     // We're using dynamic import to avoid circular dependencies
-    const { sleep } = await import("./utils");
+    const { sleep } = await import("./utils.js");
 
     // Run in a loop to regularly update the balance
     for (;;) {

+ 3 - 3
apps/price_pusher/src/metrics.ts

@@ -1,7 +1,7 @@
 import { Registry, Counter, Gauge } from "prom-client";
 import express from "express";
-import { Logger } from "pino";
-import { UpdateCondition } from "./price-config";
+import type { Logger } from "pino";
+import { UpdateCondition } from "./price-config.js";
 
 // Define the metrics we want to track
 export class PricePusherMetrics {
@@ -86,7 +86,7 @@ export class PricePusherMetrics {
     });
 
     // Setup the metrics endpoint
-    this.server.get("/metrics", async (req, res) => {
+    this.server.get("/metrics", async (_, res) => {
       res.set("Content-Type", this.registry.contentType);
       res.end(await this.registry.metrics());
     });

+ 2 - 2
apps/price_pusher/src/near/command.ts

@@ -3,9 +3,9 @@ import * as options from "../options";
 import { readPriceConfigFile } from "../price-config";
 import { PythPriceListener } from "../pyth-price-listener";
 import { Controller } from "../controller";
-import { Options } from "yargs";
+import type { Options } from "yargs";
 import { NearAccount, NearPriceListener, NearPricePusher } from "./near";
-import pino from "pino";
+import { pino } from "pino";
 import { filterInvalidPriceItems } from "../utils";
 
 export default {

+ 9 - 9
apps/price_pusher/src/near/near.ts

@@ -3,22 +3,22 @@ import path from "path";
 import fs from "fs";
 
 import {
-  IPricePusher,
-  PriceInfo,
+  type IPricePusher,
+  type PriceInfo,
   ChainPriceListener,
-  PriceItem,
-} from "../interface";
-import { HermesClient, HexString } from "@pythnetwork/hermes-client";
-import { DurationInSeconds } from "../utils";
+  type PriceItem,
+} from "../interface.js";
+import { HermesClient, type HexString } from "@pythnetwork/hermes-client";
+import type { DurationInSeconds } from "../utils.js";
 
 import { Account, Connection, KeyPair } from "near-api-js";
 import {
-  ExecutionStatus,
+  type ExecutionStatus,
   ExecutionStatusBasic,
-  FinalExecutionOutcome,
+  type FinalExecutionOutcome,
 } from "near-api-js/lib/providers/provider";
 import { InMemoryKeyStore } from "near-api-js/lib/key_stores";
-import { Logger } from "pino";
+import type { Logger } from "pino";
 
 export class NearPriceListener extends ChainPriceListener {
   constructor(

+ 1 - 1
apps/price_pusher/src/options.ts

@@ -1,4 +1,4 @@
-import { Options } from "yargs";
+import type { Options } from "yargs";
 
 export const priceServiceEndpoint = {
   "price-service-endpoint": {

+ 8 - 4
apps/price_pusher/src/price-config.ts

@@ -1,10 +1,14 @@
-import { HexString } from "@pythnetwork/hermes-client";
+import type { HexString } from "@pythnetwork/hermes-client";
 import Joi from "joi";
 import YAML from "yaml";
 import fs from "fs";
-import { Logger } from "pino";
-import { DurationInSeconds, PctNumber, removeLeading0x } from "./utils";
-import { PriceInfo } from "./interface";
+import type { Logger } from "pino";
+import {
+  type DurationInSeconds,
+  type PctNumber,
+  removeLeading0x,
+} from "./utils.js";
+import type { PriceInfo } from "./interface.js";
 
 const PriceConfigFileSchema: Joi.Schema = Joi.array()
   .items(

+ 6 - 6
apps/price_pusher/src/pyth-price-listener.ts

@@ -1,11 +1,11 @@
 import {
-  HexString,
+  type HexString,
   HermesClient,
-  PriceUpdate,
+  type PriceUpdate,
 } from "@pythnetwork/hermes-client";
-import { PriceInfo, IPriceListener, PriceItem } from "./interface";
-import { Logger } from "pino";
-import { sleep } from "./utils";
+import type { PriceInfo, IPriceListener, PriceItem } from "./interface.js";
+import type { Logger } from "pino";
+import { sleep } from "./utils.js";
 
 type TimestampInMs = number & { readonly _: unique symbol };
 
@@ -60,7 +60,7 @@ export class PythPriceListener implements IPriceListener {
         ignoreInvalidPriceIds: true,
       },
     );
-    eventSource.onmessage = (event: MessageEvent<string>) => {
+    eventSource.onmessage = (event: MessageEvent) => {
       const priceUpdates = JSON.parse(event.data) as PriceUpdate;
       priceUpdates.parsed?.forEach((priceUpdate) => {
         this.logger.debug(

+ 6 - 6
apps/price_pusher/src/solana/balance-tracker.ts

@@ -1,12 +1,12 @@
 import { Connection, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js";
 import {
   BaseBalanceTracker,
-  BaseBalanceTrackerConfig,
-  IBalanceTracker,
-} from "../interface";
-import { DurationInSeconds } from "../utils";
-import { PricePusherMetrics } from "../metrics";
-import { Logger } from "pino";
+  type BaseBalanceTrackerConfig,
+  type IBalanceTracker,
+} from "../interface.js";
+import type { DurationInSeconds } from "../utils.js";
+import { PricePusherMetrics } from "../metrics.js";
+import type { Logger } from "pino";
 
 /**
  * Solana-specific configuration for balance tracker

+ 16 - 16
apps/price_pusher/src/solana/command.ts

@@ -1,29 +1,29 @@
-import { Options } from "yargs";
-import * as options from "../options";
-import { readPriceConfigFile } from "../price-config";
-import { PythPriceListener } from "../pyth-price-listener";
+import type { Options } from "yargs";
+import * as options from "../options.js";
+import { readPriceConfigFile } from "../price-config.js";
+import { PythPriceListener } from "../pyth-price-listener.js";
 import {
   SolanaPriceListener,
   SolanaPricePusher,
   SolanaPricePusherJito,
-} from "./solana";
-import { Controller } from "../controller";
+} from "./solana.js";
+import { Controller } from "../controller.js";
 import { PythSolanaReceiver } from "@pythnetwork/pyth-solana-receiver";
-import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
 import { Keypair, Connection, LAMPORTS_PER_SOL } from "@solana/web3.js";
 import fs from "fs";
 import { PublicKey } from "@solana/web3.js";
+import { pino } from "pino";
+import type { Logger } from "pino";
+import { HermesClient } from "@pythnetwork/hermes-client";
 import {
-  SearcherClient,
   searcherClient,
+  SearcherClient,
 } from "jito-ts/dist/sdk/block-engine/searcher";
-import pino from "pino";
-import { Logger } from "pino";
-import { HermesClient } from "@pythnetwork/hermes-client";
-import { filterInvalidPriceItems } from "../utils";
-import { PricePusherMetrics } from "../metrics";
-import { createSolanaBalanceTracker } from "./balance-tracker";
-import { IBalanceTracker } from "../interface";
+import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet.js";
+import { filterInvalidPriceItems } from "../utils.js";
+import { PricePusherMetrics } from "../metrics.js";
+import { createSolanaBalanceTracker } from "./balance-tracker.js";
+import type { IBalanceTracker } from "../interface.js";
 
 export default {
   command: "solana",
@@ -265,7 +265,7 @@ export default {
       logger.child({ module: "Controller" }, { level: controllerLogLevel }),
       {
         pushingFrequency,
-        metrics,
+        metrics: metrics!,
       },
     );
 

+ 9 - 8
apps/price_pusher/src/solana/solana.ts

@@ -1,11 +1,11 @@
 import { PythSolanaReceiver } from "@pythnetwork/pyth-solana-receiver";
 import {
   ChainPriceListener,
-  IPricePusher,
-  PriceInfo,
-  PriceItem,
-} from "../interface";
-import { DurationInSeconds } from "../utils";
+  type IPricePusher,
+  type PriceInfo,
+  type PriceItem,
+} from "../interface.js";
+import type { DurationInSeconds } from "../utils.js";
 import { HermesClient } from "@pythnetwork/hermes-client";
 import {
   sendTransactions,
@@ -13,7 +13,7 @@ import {
 } from "@pythnetwork/solana-utils";
 import { SearcherClient } from "jito-ts/dist/sdk/block-engine/searcher";
 import { sliceAccumulatorUpdateData } from "@pythnetwork/price-service-sdk";
-import { Logger } from "pino";
+import type { Logger } from "pino";
 import { AddressLookupTableAccount, LAMPORTS_PER_SOL } from "@solana/web3.js";
 
 const HEALTH_CHECK_TIMEOUT_SECONDS = 60;
@@ -55,7 +55,7 @@ export class SolanaPriceListener extends ChainPriceListener {
     }
   }
 
-  async start() {
+  override async start() {
     // Frequently check the RPC connection to ensure it is healthy
     setInterval(this.checkHealth.bind(this), 5000);
 
@@ -184,7 +184,8 @@ export class SolanaPricePusherJito implements IPricePusher {
         );
         return undefined;
       }
-      const data = await response.json();
+      // TODO: fix this type here to be more specific
+      const data = (await response.json()) as any[];
       return Math.floor(
         Number(data[0].landed_tips_50th_percentile) * LAMPORTS_PER_SOL,
       );

+ 6 - 6
apps/price_pusher/src/sui/balance-tracker.ts

@@ -1,12 +1,12 @@
 import { SuiClient } from "@mysten/sui/client";
 import {
   BaseBalanceTracker,
-  BaseBalanceTrackerConfig,
-  IBalanceTracker,
-} from "../interface";
-import { DurationInSeconds } from "../utils";
-import { PricePusherMetrics } from "../metrics";
-import { Logger } from "pino";
+  type BaseBalanceTrackerConfig,
+  type IBalanceTracker,
+} from "../interface.js";
+import type { DurationInSeconds } from "../utils.js";
+import { PricePusherMetrics } from "../metrics.js";
+import type { Logger } from "pino";
 
 /**
  * Sui-specific configuration for balance tracker

+ 9 - 9
apps/price_pusher/src/sui/command.ts

@@ -1,16 +1,16 @@
 import { HermesClient } from "@pythnetwork/hermes-client";
-import * as options from "../options";
+import * as options from "../options.js";
 import { readPriceConfigFile } from "../price-config";
 import fs from "fs";
-import { PythPriceListener } from "../pyth-price-listener";
-import { Controller } from "../controller";
-import { Options } from "yargs";
-import { SuiPriceListener, SuiPricePusher } from "./sui";
+import { PythPriceListener } from "../pyth-price-listener.js";
+import { Controller } from "../controller.js";
+import type { Options } from "yargs";
+import { SuiPriceListener, SuiPricePusher } from "./sui.js";
 import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
 import pino from "pino";
-import { filterInvalidPriceItems } from "../utils";
-import { PricePusherMetrics } from "../metrics";
-import { createSuiBalanceTracker } from "./balance-tracker";
+import { filterInvalidPriceItems } from "../utils.js";
+import { PricePusherMetrics } from "../metrics.js";
+import { createSuiBalanceTracker } from "./balance-tracker.js";
 import { SuiClient } from "@mysten/sui/client";
 
 export default {
@@ -172,7 +172,7 @@ export default {
       logger.child({ module: "Controller" }, { level: controllerLogLevel }),
       {
         pushingFrequency,
-        metrics,
+        metrics: metrics!,
       },
     );
 

+ 16 - 11
apps/price_pusher/src/sui/sui.ts

@@ -1,15 +1,19 @@
 import {
   ChainPriceListener,
-  IPricePusher,
-  PriceInfo,
-  PriceItem,
-} from "../interface";
-import { DurationInSeconds } from "../utils";
+  type IPricePusher,
+  type PriceInfo,
+  type PriceItem,
+} from "../interface.js";
+import type { DurationInSeconds } from "../utils.js";
 import { SuiPythClient } from "@pythnetwork/pyth-sui-js";
 import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
 import { Transaction } from "@mysten/sui/transactions";
-import { SuiClient, SuiObjectRef, PaginatedCoins } from "@mysten/sui/client";
-import { Logger } from "pino";
+import {
+  SuiClient,
+  type SuiObjectRef,
+  type PaginatedCoins,
+} from "@mysten/sui/client";
+import type { Logger } from "pino";
 import { HermesClient } from "@pythnetwork/hermes-client";
 const GAS_FEE_FOR_SPLIT = 2_000_000_000;
 // TODO: read this from on chain config
@@ -237,7 +241,7 @@ export class SuiPricePusher implements IPricePusher {
         const tx = new Transaction();
         await this.pythClient.updatePriceFeeds(
           tx,
-          [Buffer.from(vaa, "base64")],
+          [Buffer.from(vaa ?? "", "base64")],
           priceIdChunk,
         );
         txBlocks.push(tx);
@@ -429,7 +433,7 @@ export class SuiPricePusher implements IPricePusher {
     );
 
     tx.transferObjects(
-      Array.from({ length: numGasObjects }, (_, i) => coins[i]),
+      Array.from({ length: numGasObjects }, (_, i) => coins[i]!),
       tx.pure.address(signerAddress),
     );
     tx.setGasPayment([gasCoin]);
@@ -463,7 +467,7 @@ export class SuiPricePusher implements IPricePusher {
     const gasCoins = await SuiPricePusher.getAllGasCoins(provider, owner);
     // skip merging if there is only one coin
     if (gasCoins.length === 1) {
-      return gasCoins[0];
+      return gasCoins[0]!;
     }
 
     const gasCoinsChunks = chunkArray<SuiObjectRef>(
@@ -476,7 +480,8 @@ export class SuiPricePusher implements IPricePusher {
     for (let i = 0; i < gasCoinsChunks.length; i++) {
       const mergeTx = new Transaction();
       let coins = gasCoinsChunks[i];
-      coins = coins.filter((coin) => !lockedAddresses.has(coin.objectId));
+      coins =
+        coins?.filter((coin) => !lockedAddresses.has(coin.objectId)) ?? [];
       if (finalCoin) {
         coins = [finalCoin, ...coins];
       }

+ 11 - 9
apps/price_pusher/src/ton/command.ts

@@ -1,14 +1,15 @@
-import { Options } from "yargs";
-import * as options from "../options";
-import { readPriceConfigFile } from "../price-config";
-import { PythPriceListener } from "../pyth-price-listener";
-import { TonPriceListener, TonPricePusher } from "./ton";
-import { Controller } from "../controller";
+import { pino } from "pino";
+import type { Options } from "yargs";
+import * as options from "../options.js";
+import { readPriceConfigFile } from "../price-config.js";
+import { PythPriceListener } from "../pyth-price-listener.js";
+import { TonPriceListener, TonPricePusher } from "./ton.js";
+import { Controller } from "../controller.js";
 import { Address, TonClient } from "@ton/ton";
 import fs from "fs";
-import pino from "pino";
 import { HermesClient } from "@pythnetwork/hermes-client";
-import { filterInvalidPriceItems } from "../utils";
+import { filterInvalidPriceItems } from "../utils.js";
+import type { IPriceListener } from "../interface.js";
 
 export default {
   command: "ton",
@@ -101,7 +102,8 @@ export default {
     const controller = new Controller(
       priceConfigs,
       pythListener,
-      tonPriceListener,
+      // TODO: This is very unsafe, but matches existing behavior with looser types
+      tonPriceListener as unknown as IPriceListener,
       tonPricePusher,
       logger.child({ module: "Controller" }, { level: controllerLogLevel }),
       { pushingFrequency },

+ 10 - 14
apps/price_pusher/src/ton/ton.ts

@@ -1,17 +1,17 @@
 import { HermesClient } from "@pythnetwork/hermes-client";
 import {
   ChainPriceListener,
-  IPricePusher,
-  PriceInfo,
-  PriceItem,
-} from "../interface";
-import { addLeading0x, DurationInSeconds } from "../utils";
-import { Logger } from "pino";
+  type IPricePusher,
+  type PriceInfo,
+  type PriceItem,
+} from "../interface.js";
+import { addLeading0x, type DurationInSeconds } from "../utils.js";
+import type { Logger } from "pino";
 import {
   Address,
-  ContractProvider,
-  OpenedContract,
-  Sender,
+  type ContractProvider,
+  type OpenedContract,
+  type Sender,
   TonClient,
   WalletContractV4,
 } from "@ton/ton";
@@ -85,11 +85,7 @@ export class TonPricePusher implements IPricePusher {
     this.sender = provider.sender(keyPair.secretKey);
   }
 
-  async updatePriceFeed(
-    priceIds: string[],
-    // eslint-disable-next-line @typescript-eslint/no-unused-vars
-    pubTimesToPush: number[],
-  ): Promise<void> {
+  async updatePriceFeed(priceIds: string[], _: number[]): Promise<void> {
     if (priceIds.length === 0) {
       return;
     }

+ 2 - 2
apps/price_pusher/src/utils.ts

@@ -1,5 +1,5 @@
-import { HermesClient, HexString } from "@pythnetwork/hermes-client";
-import { PriceItem } from "./interface";
+import { HermesClient, type HexString } from "@pythnetwork/hermes-client";
+import type { PriceItem } from "./interface.js";
 
 export type PctNumber = number;
 export type DurationInSeconds = number;

+ 2 - 1
apps/price_pusher/tsconfig.build.json

@@ -3,7 +3,8 @@
   "compilerOptions": {
     "noEmit": false,
     "incremental": false,
-    "declaration": true
+    "declaration": true,
+    "isolatedModules": false
   },
   "exclude": [
     "node_modules",

+ 4 - 0
apps/price_pusher/tsconfig.json

@@ -1,5 +1,9 @@
 {
   "extends": "@cprussin/tsconfig/base.json",
   "include": ["src"],
+  "compilerOptions": {
+    "module": "preserve",
+    "moduleResolution": "node"
+  },
   "exclude": ["node_modules", "**/__tests__/*"]
 }