From c8de25dfda0414ea380e6a6ce35b006e8f41597a Mon Sep 17 00:00:00 2001 From: 0xfirefist Date: Mon, 27 Feb 2023 23:54:59 +0530 Subject: [PATCH 1/4] refactor index page --- price_pusher/package-lock.json | 53 ----------- price_pusher/package.json | 1 - price_pusher/src/evm.ts | 23 +++-- price_pusher/src/index.ts | 158 ++++++++++++++++----------------- price_pusher/src/interface.ts | 1 + 5 files changed, 94 insertions(+), 142 deletions(-) diff --git a/price_pusher/package-lock.json b/price_pusher/package-lock.json index f33962381f..902c358e0b 100644 --- a/price_pusher/package-lock.json +++ b/price_pusher/package-lock.json @@ -11,7 +11,6 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.0.457", "@pythnetwork/pyth-common-js": "^1.4.0", - "@pythnetwork/pyth-evm-js": "^1.1.0", "@pythnetwork/pyth-sdk-solidity": "^2.2.0", "@truffle/hdwallet-provider": "^2.1.3", "joi": "^17.6.0", @@ -2514,38 +2513,6 @@ "ws": "^8.6.0" } }, - "node_modules/@pythnetwork/pyth-evm-js": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-evm-js/-/pyth-evm-js-1.1.0.tgz", - "integrity": "sha512-cfxzJ6u6THJ4pyAlfdJ4pw1MbXPAaRqTPPzpjopiuUmme8M3m7HK7wKP9TIxHEnGyCqTw3MnWG1r+TS2zbO13g==", - "dependencies": { - "@pythnetwork/pyth-common-js": "^1.2.0", - "buffer": "^6.0.3" - } - }, - "node_modules/@pythnetwork/pyth-evm-js/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/@pythnetwork/pyth-sdk-js": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sdk-js/-/pyth-sdk-js-1.2.0.tgz", @@ -14922,26 +14889,6 @@ "ws": "^8.6.0" } }, - "@pythnetwork/pyth-evm-js": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-evm-js/-/pyth-evm-js-1.1.0.tgz", - "integrity": "sha512-cfxzJ6u6THJ4pyAlfdJ4pw1MbXPAaRqTPPzpjopiuUmme8M3m7HK7wKP9TIxHEnGyCqTw3MnWG1r+TS2zbO13g==", - "requires": { - "@pythnetwork/pyth-common-js": "^1.2.0", - "buffer": "^6.0.3" - }, - "dependencies": { - "buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - } - } - }, "@pythnetwork/pyth-sdk-js": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sdk-js/-/pyth-sdk-js-1.2.0.tgz", diff --git a/price_pusher/package.json b/price_pusher/package.json index 5c690a17b2..89dcf6428c 100644 --- a/price_pusher/package.json +++ b/price_pusher/package.json @@ -45,7 +45,6 @@ "dependencies": { "@injectivelabs/sdk-ts": "^1.0.457", "@pythnetwork/pyth-common-js": "^1.4.0", - "@pythnetwork/pyth-evm-js": "^1.1.0", "@pythnetwork/pyth-sdk-solidity": "^2.2.0", "@truffle/hdwallet-provider": "^2.1.3", "joi": "^17.6.0", diff --git a/price_pusher/src/evm.ts b/price_pusher/src/evm.ts index 8bee5eda5d..5ebb32da6d 100644 --- a/price_pusher/src/evm.ts +++ b/price_pusher/src/evm.ts @@ -1,8 +1,3 @@ -import { - EvmPriceServiceConnection, - HexString, - UnixTimestamp, -} from "@pythnetwork/pyth-evm-js"; import { Contract, EventData } from "web3-eth-contract"; import { PriceConfig } from "./price-config"; import { ChainPricePusher, PriceInfo, ChainPriceListener } from "./interface"; @@ -13,6 +8,11 @@ import HDWalletProvider from "@truffle/hdwallet-provider"; import { Provider } from "web3/providers"; import Web3 from "web3"; import { isWsEndpoint } from "./utils"; +import { + PriceServiceConnection, + HexString, + UnixTimestamp, +} from "@pythnetwork/pyth-common-js"; export class EvmPriceListener extends ChainPriceListener { private pythContractFactory: PythContractFactory; @@ -116,7 +116,7 @@ export class EvmPriceListener extends ChainPriceListener { export class EvmPricePusher implements ChainPricePusher { constructor( - private connection: EvmPriceServiceConnection, + private connection: PriceServiceConnection, private pythContract: Contract ) {} // The pubTimes are passed here to use the values that triggered the push. @@ -135,7 +135,7 @@ export class EvmPricePusher implements ChainPricePusher { const priceIdsWith0x = priceIds.map((priceId) => addLeading0x(priceId)); - const priceFeedUpdateData = await this.connection.getPriceFeedsUpdateData( + const priceFeedUpdateData = await this.getPriceFeedsUpdateData( priceIdsWith0x ); @@ -198,6 +198,15 @@ export class EvmPricePusher implements ChainPricePusher { throw err; }); } + + private async getPriceFeedsUpdateData( + priceIds: HexString[] + ): Promise { + const latestVaas = await this.connection.getLatestVaas(priceIds); + return latestVaas.map( + (vaa) => "0x" + Buffer.from(vaa, "base64").toString("hex") + ); + } } export class PythContractFactory { diff --git a/price_pusher/src/index.ts b/price_pusher/src/index.ts index 0fea3c8af5..ffc728ec72 100644 --- a/price_pusher/src/index.ts +++ b/price_pusher/src/index.ts @@ -4,10 +4,6 @@ // FIXME: release a new version import yargs from "yargs"; import { hideBin } from "yargs/helpers"; -import { - EvmPriceServiceConnection, - CONTRACT_ADDR, -} from "@pythnetwork/pyth-evm-js"; import { Controller } from "./controller"; import { EvmPriceListener, EvmPricePusher, PythContractFactory } from "./evm"; import { PythPriceListener } from "./pyth-price-listener"; @@ -15,6 +11,7 @@ import fs from "fs"; import { readPriceConfigFile } from "./price-config"; import { PriceServiceConnection } from "@pythnetwork/pyth-common-js"; import { InjectivePriceListener, InjectivePricePusher } from "./injective"; +import { ChainPricePusher, IPriceListener } from "./interface"; const argv = yargs(hideBin(process.argv)) .option("network", { @@ -27,7 +24,7 @@ const argv = yargs(hideBin(process.argv)) description: "RPC endpoint URL for the network. If you provide a normal HTTP endpoint, the pusher " + "will periodically poll for updates. The polling interval is configurable via the " + - "`polling-frequency` command-line argument. for the evm chains, if you provide a websocket RPC " + + "`polling-frequency` command-line argument. For the evm chains, if you provide a websocket RPC " + "endpoint (`ws[s]://...`), the price pusher will use event subscriptions to read " + "the current EVM price in addition to polling. ", type: "string", @@ -81,100 +78,99 @@ const argv = yargs(hideBin(process.argv)) let pythContractAddr: string; -if (CONTRACT_ADDR[argv.pythContract] !== undefined) { - pythContractAddr = CONTRACT_ADDR[argv.pythContract]; -} else { - pythContractAddr = argv.pythContract; -} - const priceConfigs = readPriceConfigFile(argv.priceConfigFile); -async function injectiveRun() { - const connection = new PriceServiceConnection(argv.priceEndpoint, { - logger: console, - }); - - const pythPriceListener = new PythPriceListener(connection, priceConfigs); - - const injectivePriceListener = new InjectivePriceListener( - pythContractAddr, - argv.endpoint, - priceConfigs, - { pollingFrequency: argv.pollingFrequency } - ); - - const injectivePricePusher = new InjectivePricePusher( - connection, - argv.pythContract, - argv.endpoint, - fs.readFileSync(argv.mnemonicFile, "utf-8").trim() - ); - +// TODO: name ChainPricePusher -> IPricePusher in a clean up PR +// TODO: update listeners to not depend on the whole priceConfig +async function start({ + sourcePriceListener, + targetPriceListener, + targetPricePusher, +}: { + sourcePriceListener: IPriceListener; + targetPriceListener: IPriceListener; + targetPricePusher: ChainPricePusher; +}) { const handler = new Controller( priceConfigs, - pythPriceListener, - injectivePriceListener, - injectivePricePusher, + sourcePriceListener, + targetPriceListener, + targetPricePusher, { cooldownDuration: argv.cooldownDuration, } ); - await injectivePriceListener.start(); - await pythPriceListener.start(); + await sourcePriceListener.start(); + await targetPriceListener.start(); // Handler starts after the above listeners are started // which means that they have fetched their initial price information. await handler.start(); } -async function evmRun() { - const connection = new EvmPriceServiceConnection(argv.priceEndpoint, { - logger: console, - }); - - const pythContractFactory = new PythContractFactory( - argv.endpoint, - fs.readFileSync(argv.mnemonicFile, "utf-8").trim(), - pythContractAddr - ); - - const evmPriceListener = new EvmPriceListener( - pythContractFactory, - priceConfigs, - { - pollingFrequency: argv.pollingFrequency, - } - ); - - const pythPriceListener = new PythPriceListener(connection, priceConfigs); - - const evmPricePusher = new EvmPricePusher( - connection, - pythContractFactory.createPythContractWithPayer() - ); - - const handler = new Controller( - priceConfigs, - pythPriceListener, - evmPriceListener, - evmPricePusher, - { - cooldownDuration: argv.cooldownDuration, +const priceServiceConnection = new PriceServiceConnection(argv.priceEndpoint, { + logger: console, +}); + +const pythPriceListener = new PythPriceListener( + priceServiceConnection, + priceConfigs +); + +function getNetworkPriceListener(network: string): IPriceListener { + switch (network) { + case "evm": { + const pythContractFactory = new PythContractFactory( + argv.endpoint, + fs.readFileSync(argv.mnemonicFile, "utf-8").trim(), + pythContractAddr + ); + + return new EvmPriceListener(pythContractFactory, priceConfigs, { + pollingFrequency: argv.pollingFrequency, + }); } - ); - await evmPriceListener.start(); - await pythPriceListener.start(); - - // Handler starts after the above listeners are started - // which means that they have fetched their initial price information. - await handler.start(); + case "injective": + return new InjectivePriceListener( + pythContractAddr, + argv.endpoint, + priceConfigs, + { pollingFrequency: argv.pollingFrequency } + ); + default: + throw new Error("invalid network"); + } } -function run() { - if (argv.network === "injective") injectiveRun(); - else if (argv.network === "evm") evmRun(); +function getNetworkPricePusher(network: string): ChainPricePusher { + switch (network) { + case "evm": { + const pythContractFactory = new PythContractFactory( + argv.endpoint, + fs.readFileSync(argv.mnemonicFile, "utf-8").trim(), + pythContractAddr + ); + return new EvmPricePusher( + priceServiceConnection, + pythContractFactory.createPythContractWithPayer() + ); + } + case "injective": + return new InjectivePricePusher( + priceServiceConnection, + argv.pythContract, + argv.endpoint, + fs.readFileSync(argv.mnemonicFile, "utf-8").trim() + ); + default: + throw new Error("invalid network"); + } } -run(); +start({ + sourcePriceListener: pythPriceListener, + targetPriceListener: getNetworkPriceListener(argv.network), + targetPricePusher: getNetworkPricePusher(argv.network), +}); diff --git a/price_pusher/src/interface.ts b/price_pusher/src/interface.ts index a7399b7b80..0a44ae2334 100644 --- a/price_pusher/src/interface.ts +++ b/price_pusher/src/interface.ts @@ -8,6 +8,7 @@ export type PriceInfo = { }; export interface IPriceListener { + start(): Promise; getLatestPriceInfo(priceId: string): PriceInfo | undefined; } From 965809758a2a8b1de2cf5b482144beb858260404 Mon Sep 17 00:00:00 2001 From: 0xfirefist Date: Tue, 28 Feb 2023 00:05:12 +0530 Subject: [PATCH 2/4] remove pythcontractaddr --- price_pusher/src/controller.ts | 2 +- price_pusher/src/index.ts | 8 +++----- price_pusher/src/utils.ts | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/price_pusher/src/controller.ts b/price_pusher/src/controller.ts index f36139bba7..daba8ded7d 100644 --- a/price_pusher/src/controller.ts +++ b/price_pusher/src/controller.ts @@ -1,4 +1,4 @@ -import { UnixTimestamp } from "@pythnetwork/pyth-evm-js"; +import { UnixTimestamp } from "@pythnetwork/pyth-common-js"; import { DurationInSeconds, sleep } from "./utils"; import { ChainPricePusher, IPriceListener } from "./interface"; import { PriceConfig, shouldUpdate } from "./price-config"; diff --git a/price_pusher/src/index.ts b/price_pusher/src/index.ts index ffc728ec72..293f6bab51 100644 --- a/price_pusher/src/index.ts +++ b/price_pusher/src/index.ts @@ -76,8 +76,6 @@ const argv = yargs(hideBin(process.argv)) }) .parseSync(); -let pythContractAddr: string; - const priceConfigs = readPriceConfigFile(argv.priceConfigFile); // TODO: name ChainPricePusher -> IPricePusher in a clean up PR @@ -124,7 +122,7 @@ function getNetworkPriceListener(network: string): IPriceListener { const pythContractFactory = new PythContractFactory( argv.endpoint, fs.readFileSync(argv.mnemonicFile, "utf-8").trim(), - pythContractAddr + argv.pythContract ); return new EvmPriceListener(pythContractFactory, priceConfigs, { @@ -134,7 +132,7 @@ function getNetworkPriceListener(network: string): IPriceListener { case "injective": return new InjectivePriceListener( - pythContractAddr, + argv.pythContract, argv.endpoint, priceConfigs, { pollingFrequency: argv.pollingFrequency } @@ -150,7 +148,7 @@ function getNetworkPricePusher(network: string): ChainPricePusher { const pythContractFactory = new PythContractFactory( argv.endpoint, fs.readFileSync(argv.mnemonicFile, "utf-8").trim(), - pythContractAddr + argv.pythContract ); return new EvmPricePusher( priceServiceConnection, diff --git a/price_pusher/src/utils.ts b/price_pusher/src/utils.ts index a04ee5f9f8..69b39470e5 100644 --- a/price_pusher/src/utils.ts +++ b/price_pusher/src/utils.ts @@ -1,4 +1,4 @@ -import { HexString } from "@pythnetwork/pyth-evm-js"; +import { HexString } from "@pythnetwork/pyth-common-js"; export type PctNumber = number; export type DurationInSeconds = number; From 00344ed5b2140bd0cc5a4f3109c9b9895ddf706d Mon Sep 17 00:00:00 2001 From: 0xfirefist Date: Tue, 28 Feb 2023 00:17:55 +0530 Subject: [PATCH 3/4] address comments --- price_pusher/src/controller.ts | 4 ++++ price_pusher/src/index.ts | 5 ----- price_pusher/src/interface.ts | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/price_pusher/src/controller.ts b/price_pusher/src/controller.ts index daba8ded7d..915127785d 100644 --- a/price_pusher/src/controller.ts +++ b/price_pusher/src/controller.ts @@ -18,6 +18,10 @@ export class Controller { } async start() { + // start the listeners + await this.sourcePriceListener.start(); + await this.targetPriceListener.start(); + for (;;) { const pricesToPush: PriceConfig[] = []; const pubTimesToPush: UnixTimestamp[] = []; diff --git a/price_pusher/src/index.ts b/price_pusher/src/index.ts index 293f6bab51..a14e310b60 100644 --- a/price_pusher/src/index.ts +++ b/price_pusher/src/index.ts @@ -99,11 +99,6 @@ async function start({ } ); - await sourcePriceListener.start(); - await targetPriceListener.start(); - - // Handler starts after the above listeners are started - // which means that they have fetched their initial price information. await handler.start(); } diff --git a/price_pusher/src/interface.ts b/price_pusher/src/interface.ts index 0a44ae2334..2292f38ea1 100644 --- a/price_pusher/src/interface.ts +++ b/price_pusher/src/interface.ts @@ -8,6 +8,7 @@ export type PriceInfo = { }; export interface IPriceListener { + // start fetches the latest price initially and then keep updating it start(): Promise; getLatestPriceInfo(priceId: string): PriceInfo | undefined; } From 29c1f44d008068c3f276dd5bbf5d382f6b2f5db5 Mon Sep 17 00:00:00 2001 From: 0xfirefist Date: Tue, 28 Feb 2023 14:14:40 +0530 Subject: [PATCH 4/4] bug fix --- package-lock.json | 78 +++++++++++++++++++++++-- price_pusher/package.json | 1 - price_pusher/src/index.ts | 2 +- price_pusher/src/injective.ts | 5 +- price_pusher/src/interface.ts | 2 +- price_pusher/src/price-config.ts | 2 +- price_pusher/src/pyth-price-listener.ts | 2 +- 7 files changed, 79 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index f7f27d9779..f41b33e294 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11095,6 +11095,36 @@ "resolved": "target_chains/aptos/sdk/js", "link": true }, + "node_modules/@pythnetwork/pyth-common-js": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-common-js/-/pyth-common-js-1.4.0.tgz", + "integrity": "sha512-ilK+0/+tivMVPMIFmup+UfUHklhsS2fqofZxS2+XCn4WBJfI0lIKtiAaBVjV7WmzmC2mDjujcTCDn4RbqpLVqg==", + "dependencies": { + "@pythnetwork/pyth-sdk-js": "^1.2.0", + "@types/ws": "^8.5.3", + "axios": "^0.26.1", + "axios-retry": "^3.2.4", + "isomorphic-ws": "^4.0.1", + "ts-log": "^2.2.4", + "ws": "^8.6.0" + } + }, + "node_modules/@pythnetwork/pyth-common-js/node_modules/@types/ws": { + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@pythnetwork/pyth-common-js/node_modules/axios": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "dependencies": { + "follow-redirects": "^1.14.8" + } + }, "node_modules/@pythnetwork/pyth-evm-contract": { "resolved": "target_chains/ethereum/contracts", "link": true @@ -11111,6 +11141,11 @@ "resolved": "governance/multisig_wh_message_builder", "link": true }, + "node_modules/@pythnetwork/pyth-sdk-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sdk-js/-/pyth-sdk-js-1.2.0.tgz", + "integrity": "sha512-grh6YCkp/nH73ACNu+Mew64lLVgz6egVBJm8JvdNkRggWkUn1PE4ZvV/6ceTIui5OhI369qzMCkldiAlIMBjnQ==" + }, "node_modules/@pythnetwork/pyth-sdk-solidity": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sdk-solidity/-/pyth-sdk-solidity-2.2.0.tgz", @@ -47823,8 +47858,7 @@ "license": "Apache-2.0", "dependencies": { "@injectivelabs/sdk-ts": "^1.0.457", - "@pythnetwork/price-service-client": "*", - "@pythnetwork/pyth-evm-js": "^1.1.0", + "@pythnetwork/pyth-common-js": "^1.4.0", "@pythnetwork/pyth-sdk-solidity": "^2.2.0", "@truffle/hdwallet-provider": "^2.1.3", "joi": "^17.6.0", @@ -57546,6 +57580,38 @@ } } }, + "@pythnetwork/pyth-common-js": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-common-js/-/pyth-common-js-1.4.0.tgz", + "integrity": "sha512-ilK+0/+tivMVPMIFmup+UfUHklhsS2fqofZxS2+XCn4WBJfI0lIKtiAaBVjV7WmzmC2mDjujcTCDn4RbqpLVqg==", + "requires": { + "@pythnetwork/pyth-sdk-js": "^1.2.0", + "@types/ws": "^8.5.3", + "axios": "^0.26.1", + "axios-retry": "^3.2.4", + "isomorphic-ws": "^4.0.1", + "ts-log": "^2.2.4", + "ws": "^8.6.0" + }, + "dependencies": { + "@types/ws": { + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "requires": { + "@types/node": "*" + } + }, + "axios": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "requires": { + "follow-redirects": "^1.14.8" + } + } + } + }, "@pythnetwork/pyth-evm-contract": { "version": "file:target_chains/ethereum/contracts", "requires": { @@ -57609,8 +57675,7 @@ "version": "file:price_pusher", "requires": { "@injectivelabs/sdk-ts": "^1.0.457", - "@pythnetwork/price-service-client": "*", - "@pythnetwork/pyth-evm-js": "^1.1.0", + "@pythnetwork/pyth-common-js": "^1.4.0", "@pythnetwork/pyth-sdk-solidity": "^2.2.0", "@truffle/hdwallet-provider": "^2.1.3", "@types/ethereum-protocol": "^1.0.2", @@ -59529,6 +59594,11 @@ } } }, + "@pythnetwork/pyth-sdk-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sdk-js/-/pyth-sdk-js-1.2.0.tgz", + "integrity": "sha512-grh6YCkp/nH73ACNu+Mew64lLVgz6egVBJm8JvdNkRggWkUn1PE4ZvV/6ceTIui5OhI369qzMCkldiAlIMBjnQ==" + }, "@pythnetwork/pyth-sdk-solidity": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sdk-solidity/-/pyth-sdk-solidity-2.2.0.tgz", diff --git a/price_pusher/package.json b/price_pusher/package.json index 828dd12cb9..ac2354a39e 100644 --- a/price_pusher/package.json +++ b/price_pusher/package.json @@ -47,7 +47,6 @@ }, "dependencies": { "@injectivelabs/sdk-ts": "^1.0.457", - "@pythnetwork/price-service-client": "*", "@pythnetwork/pyth-common-js": "^1.4.0", "@pythnetwork/pyth-sdk-solidity": "^2.2.0", "@truffle/hdwallet-provider": "^2.1.3", diff --git a/price_pusher/src/index.ts b/price_pusher/src/index.ts index 8133661f55..a14e310b60 100644 --- a/price_pusher/src/index.ts +++ b/price_pusher/src/index.ts @@ -9,7 +9,7 @@ import { EvmPriceListener, EvmPricePusher, PythContractFactory } from "./evm"; import { PythPriceListener } from "./pyth-price-listener"; import fs from "fs"; import { readPriceConfigFile } from "./price-config"; -import { PriceServiceConnection } from "@pythnetwork/price-service-client"; +import { PriceServiceConnection } from "@pythnetwork/pyth-common-js"; import { InjectivePriceListener, InjectivePricePusher } from "./injective"; import { ChainPricePusher, IPriceListener } from "./interface"; diff --git a/price_pusher/src/injective.ts b/price_pusher/src/injective.ts index 9c8d88b334..28f1938124 100644 --- a/price_pusher/src/injective.ts +++ b/price_pusher/src/injective.ts @@ -1,7 +1,4 @@ -import { - HexString, - PriceServiceConnection, -} from "@pythnetwork/price-service-client"; +import { HexString, PriceServiceConnection } from "@pythnetwork/pyth-common-js"; import { ChainPricePusher, PriceInfo, ChainPriceListener } from "./interface"; import { DurationInSeconds } from "./utils"; import { PriceConfig } from "./price-config"; diff --git a/price_pusher/src/interface.ts b/price_pusher/src/interface.ts index 75313d84d7..2292f38ea1 100644 --- a/price_pusher/src/interface.ts +++ b/price_pusher/src/interface.ts @@ -1,4 +1,4 @@ -import { HexString, UnixTimestamp } from "@pythnetwork/price-service-client"; +import { HexString, UnixTimestamp } from "@pythnetwork/pyth-common-js"; import { DurationInSeconds } from "./utils"; export type PriceInfo = { diff --git a/price_pusher/src/price-config.ts b/price_pusher/src/price-config.ts index cb1d079363..39820ab78b 100644 --- a/price_pusher/src/price-config.ts +++ b/price_pusher/src/price-config.ts @@ -1,4 +1,4 @@ -import { HexString } from "@pythnetwork/price-service-client"; +import { HexString } from "@pythnetwork/pyth-common-js"; import Joi from "joi"; import YAML from "yaml"; import fs from "fs"; diff --git a/price_pusher/src/pyth-price-listener.ts b/price_pusher/src/pyth-price-listener.ts index 3463444ff2..3d1baadc2b 100644 --- a/price_pusher/src/pyth-price-listener.ts +++ b/price_pusher/src/pyth-price-listener.ts @@ -2,7 +2,7 @@ import { HexString, PriceFeed, PriceServiceConnection, -} from "@pythnetwork/price-service-client"; +} from "@pythnetwork/pyth-common-js"; import { PriceConfig } from "./price-config"; import { PriceInfo, IPriceListener } from "./interface";