1- import { PriceServiceConnection } from "@pythnetwork/price-service -client" ;
1+ import { HermesClient } from "@pythnetwork/hermes -client" ;
22import * as options from "../options" ;
33import { readPriceConfigFile } from "../price-config" ;
44import fs from "fs" ;
@@ -33,43 +33,33 @@ export default {
3333 default : 2 ,
3434 } as Options ,
3535 ...options . priceConfigFile ,
36- ...options . priceServiceEndpoint ,
36+ ...options . hermesEndpoint ,
3737 ...options . mnemonicFile ,
3838 ...options . pythContractAddress ,
3939 ...options . pollingFrequency ,
4040 ...options . pushingFrequency ,
4141 ...options . logLevel ,
42- ...options . priceServiceConnectionLogLevel ,
4342 ...options . controllerLogLevel ,
4443 } ,
4544 handler : function ( argv : any ) {
4645 // FIXME: type checks for this
4746 const {
4847 endpoint,
4948 priceConfigFile,
50- priceServiceEndpoint ,
49+ hermesEndpoint ,
5150 mnemonicFile,
5251 pythContractAddress,
5352 pushingFrequency,
5453 pollingFrequency,
5554 overrideGasPriceMultiplier,
5655 logLevel,
57- priceServiceConnectionLogLevel,
5856 controllerLogLevel,
5957 } = argv ;
6058
6159 const logger = pino ( { level : logLevel } ) ;
6260
6361 const priceConfigs = readPriceConfigFile ( priceConfigFile ) ;
64- const priceServiceConnection = new PriceServiceConnection (
65- priceServiceEndpoint ,
66- {
67- logger : logger . child (
68- { module : "PriceServiceConnection" } ,
69- { level : priceServiceConnectionLogLevel }
70- ) ,
71- }
72- ) ;
62+ const hermesClient = new HermesClient ( hermesEndpoint ) ;
7363
7464 const mnemonic = fs . readFileSync ( mnemonicFile , "utf-8" ) . trim ( ) ;
7565 const account = AptosAccount . fromDerivePath (
@@ -81,7 +71,7 @@ export default {
8171 const priceItems = priceConfigs . map ( ( { id, alias } ) => ( { id, alias } ) ) ;
8272
8373 const pythListener = new PythPriceListener (
84- priceServiceConnection ,
74+ hermesClient ,
8575 priceItems ,
8676 logger . child ( { module : "PythPriceListener" } )
8777 ) ;
@@ -95,7 +85,7 @@ export default {
9585 ) ;
9686
9787 const aptosPusher = new AptosPricePusher (
98- priceServiceConnection ,
88+ hermesClient ,
9989 logger . child ( { module : "AptosPricePusher" } ) ,
10090 pythContractAddress ,
10191 endpoint ,
0 commit comments