From 307ca11bc5bc5e68566cdc7e3fc598622bdabedc Mon Sep 17 00:00:00 2001 From: Daniel Chew Date: Thu, 4 Aug 2022 21:51:27 +0900 Subject: [PATCH] add support for pythnet (#36) --- src/cluster.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cluster.ts b/src/cluster.ts index 8be3795..e84ab50 100644 --- a/src/cluster.ts +++ b/src/cluster.ts @@ -1,6 +1,6 @@ import { Cluster, clusterApiUrl, PublicKey } from '@solana/web3.js' -export type PythCluster = Cluster | 'pythtest' +export type PythCluster = Cluster | 'pythtest' | 'pythnet' /** Mapping from solana clusters to the public key of the pyth program. */ const clusterToPythProgramKey: Record = { @@ -8,6 +8,7 @@ const clusterToPythProgramKey: Record = { devnet: 'gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s', testnet: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz', pythtest: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz', + pythnet: 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH', } /** Gets the public key of the Pyth program running on the given cluster. */ @@ -28,6 +29,8 @@ export function getPythClusterApiUrl(cluster: PythCluster): string { // TODO: Add pythnet when it's ready if (cluster === 'pythtest') { return 'https://api.pythtest.pyth.network' + } else if (cluster === 'pythnet') { + return 'https://pythnet.rpcpool.com' } else { return clusterApiUrl(cluster) }