Skip to content

Commit 5561a1c

Browse files
committed
Add xc-devnet
1 parent 8612a09 commit 5561a1c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/cluster.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { Cluster, clusterApiUrl, PublicKey } from '@solana/web3.js'
22

3-
export type PythCluster = Cluster | 'pythtest' | 'pythnet' | 'localnet'
3+
export type PythCluster = Cluster | 'pythtest' | 'pythnet' | 'localnet' | 'xc-devnet'
44

55
/** Mapping from solana clusters to the public key of the pyth program. */
66
const clusterToPythProgramKey: Record<PythCluster, string> = {
77
'mainnet-beta': 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH',
88
devnet: 'gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s',
9+
'xc-devnet' : `gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s`,
910
testnet: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz',
1011
pythtest: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz',
1112
pythnet: 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH',
@@ -28,9 +29,10 @@ export function getPythProgramKeyForCluster(cluster: PythCluster): PublicKey {
2829
/** Retrieves the RPC API URL for the specified Pyth cluster */
2930
export function getPythClusterApiUrl(cluster: PythCluster): string {
3031
// TODO: Add pythnet when it's ready
31-
if (cluster === 'pythtest') {
32+
if ((cluster === 'pythtest') || (cluster === 'xc-devnet')) {
3233
return 'https://api.pythtest.pyth.network'
33-
} else if (cluster === 'pythnet') {
34+
}
35+
else if (cluster === 'pythnet') {
3436
return 'https://pythnet.rpcpool.com'
3537
} else if (cluster === 'localnet') {
3638
return 'http://localhost:8899'

0 commit comments

Comments
 (0)