Skip to content

Commit

Permalink
Merge pull request #69 from pyth-network/add-xc-devnet
Browse files Browse the repository at this point in the history
Add pythtest-crosschain
  • Loading branch information
guibescos authored Apr 5, 2023
2 parents 8612a09 + 1c1270b commit f8976cd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

## 2.7.2
### Changed
- Added pythtest program key and cluster url
- Updated examples to work with pythtest
- Added pythtest-conformance program key and cluster url
- Updated examples to work with pythtest-conformance

## 2.7.1
Moved solana/web3 to peerDependencies
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/client",
"version": "2.15.1",
"version": "2.16.0",
"description": "Client for consuming Pyth price data",
"homepage": "https://pyth.network",
"main": "lib/index.js",
Expand Down
7 changes: 4 additions & 3 deletions src/cluster.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Cluster, clusterApiUrl, PublicKey } from '@solana/web3.js'

export type PythCluster = Cluster | 'pythtest' | 'pythnet' | 'localnet'
export type PythCluster = Cluster | 'pythtest-conformance' | 'pythnet' | 'localnet' | 'pythtest-crosschain'

/** Mapping from solana clusters to the public key of the pyth program. */
const clusterToPythProgramKey: Record<PythCluster, string> = {
'mainnet-beta': 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH',
devnet: 'gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s',
'pythtest-crosschain': `gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s`,
testnet: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz',
pythtest: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz',
'pythtest-conformance': '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz',
pythnet: 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH',
localnet: 'gMYYig2utAxVoXnM9UhtTWrt8e7x2SVBZqsWZJeT5Gw',
}
Expand All @@ -28,7 +29,7 @@ export function getPythProgramKeyForCluster(cluster: PythCluster): PublicKey {
/** Retrieves the RPC API URL for the specified Pyth cluster */
export function getPythClusterApiUrl(cluster: PythCluster): string {
// TODO: Add pythnet when it's ready
if (cluster === 'pythtest') {
if (cluster === 'pythtest-conformance' || cluster === 'pythtest-crosschain') {
return 'https://api.pythtest.pyth.network'
} else if (cluster === 'pythnet') {
return 'https://pythnet.rpcpool.com'
Expand Down

0 comments on commit f8976cd

Please sign in to comment.