1
1
import { Cluster , clusterApiUrl , PublicKey } from '@solana/web3.js'
2
2
3
- export type PythCluster = Cluster | 'pythtest' | 'pythnet' | 'localnet'
3
+ export type PythCluster = Cluster | 'pythtest' | 'pythnet' | 'localnet' | 'xc-devnet'
4
4
5
5
/** Mapping from solana clusters to the public key of the pyth program. */
6
6
const clusterToPythProgramKey : Record < PythCluster , string > = {
7
7
'mainnet-beta' : 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH' ,
8
8
devnet : 'gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s' ,
9
+ 'xc-devnet' : `gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s` ,
9
10
testnet : '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz' ,
10
11
pythtest : '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz' ,
11
12
pythnet : 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH' ,
@@ -28,9 +29,10 @@ export function getPythProgramKeyForCluster(cluster: PythCluster): PublicKey {
28
29
/** Retrieves the RPC API URL for the specified Pyth cluster */
29
30
export function getPythClusterApiUrl ( cluster : PythCluster ) : string {
30
31
// TODO: Add pythnet when it's ready
31
- if ( cluster === 'pythtest' ) {
32
+ if ( ( cluster === 'pythtest' ) || ( cluster === 'xc-devnet' ) ) {
32
33
return 'https://api.pythtest.pyth.network'
33
- } else if ( cluster === 'pythnet' ) {
34
+ }
35
+ else if ( cluster === 'pythnet' ) {
34
36
return 'https://pythnet.rpcpool.com'
35
37
} else if ( cluster === 'localnet' ) {
36
38
return 'http://localhost:8899'
0 commit comments