From 5561a1c35824c2efefd4ebaf63d3ceb7141a2536 Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Alapont Date: Tue, 4 Apr 2023 09:38:02 -0500 Subject: [PATCH 1/6] Add xc-devnet --- src/cluster.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cluster.ts b/src/cluster.ts index f8f38c7..527947f 100644 --- a/src/cluster.ts +++ b/src/cluster.ts @@ -1,11 +1,12 @@ import { Cluster, clusterApiUrl, PublicKey } from '@solana/web3.js' -export type PythCluster = Cluster | 'pythtest' | 'pythnet' | 'localnet' +export type PythCluster = Cluster | 'pythtest' | 'pythnet' | 'localnet' | 'xc-devnet' /** Mapping from solana clusters to the public key of the pyth program. */ const clusterToPythProgramKey: Record = { 'mainnet-beta': 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH', devnet: 'gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s', + 'xc-devnet' : `gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s`, testnet: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz', pythtest: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz', pythnet: 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH', @@ -28,9 +29,10 @@ 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') || (cluster === 'xc-devnet')) { return 'https://api.pythtest.pyth.network' - } else if (cluster === 'pythnet') { + } + else if (cluster === 'pythnet') { return 'https://pythnet.rpcpool.com' } else if (cluster === 'localnet') { return 'http://localhost:8899' From 214de5d886dc285a38d32da6738f2aa62ef66505 Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Alapont Date: Tue, 4 Apr 2023 09:38:49 -0500 Subject: [PATCH 2/6] Add xc-devnet --- src/cluster.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cluster.ts b/src/cluster.ts index 527947f..51b62a8 100644 --- a/src/cluster.ts +++ b/src/cluster.ts @@ -6,7 +6,7 @@ export type PythCluster = Cluster | 'pythtest' | 'pythnet' | 'localnet' | 'xc-de const clusterToPythProgramKey: Record = { 'mainnet-beta': 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH', devnet: 'gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s', - 'xc-devnet' : `gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s`, + 'xc-devnet': `gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s`, testnet: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz', pythtest: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz', pythnet: 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH', @@ -29,10 +29,9 @@ 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') || (cluster === 'xc-devnet')) { + if (cluster === 'pythtest' || cluster === 'xc-devnet') { return 'https://api.pythtest.pyth.network' - } - else if (cluster === 'pythnet') { + } else if (cluster === 'pythnet') { return 'https://pythnet.rpcpool.com' } else if (cluster === 'localnet') { return 'http://localhost:8899' From d2d2d14da93ffa313f0ccf1fe07dd9591aa8a371 Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Alapont Date: Tue, 4 Apr 2023 10:40:52 -0500 Subject: [PATCH 3/6] Add pythdev --- src/cluster.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cluster.ts b/src/cluster.ts index 51b62a8..2337ac8 100644 --- a/src/cluster.ts +++ b/src/cluster.ts @@ -1,12 +1,12 @@ import { Cluster, clusterApiUrl, PublicKey } from '@solana/web3.js' -export type PythCluster = Cluster | 'pythtest' | 'pythnet' | 'localnet' | 'xc-devnet' +export type PythCluster = Cluster | 'pythtest' | 'pythnet' | 'localnet' | 'pythdev' /** Mapping from solana clusters to the public key of the pyth program. */ const clusterToPythProgramKey: Record = { 'mainnet-beta': 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH', devnet: 'gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s', - 'xc-devnet': `gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s`, + 'pythdev': `gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s`, testnet: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz', pythtest: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz', pythnet: 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH', @@ -29,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' || cluster === 'xc-devnet') { + if (cluster === 'pythtest' || cluster === 'pythdev') { return 'https://api.pythtest.pyth.network' } else if (cluster === 'pythnet') { return 'https://pythnet.rpcpool.com' From 7da7fab1898586055f88ad5f81754863510a08ae Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Alapont Date: Tue, 4 Apr 2023 12:37:43 -0500 Subject: [PATCH 4/6] Rename --- CHANGELOG.md | 4 ++-- src/cluster.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ace1a5..965c40e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/cluster.ts b/src/cluster.ts index 2337ac8..0ae3e41 100644 --- a/src/cluster.ts +++ b/src/cluster.ts @@ -1,14 +1,14 @@ import { Cluster, clusterApiUrl, PublicKey } from '@solana/web3.js' -export type PythCluster = Cluster | 'pythtest' | 'pythnet' | 'localnet' | 'pythdev' +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 = { 'mainnet-beta': 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH', devnet: 'gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s', - 'pythdev': `gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s`, + 'pythtest-crosschain': `gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s`, testnet: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz', - pythtest: '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz', + 'pythtest-conformance': '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz', pythnet: 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH', localnet: 'gMYYig2utAxVoXnM9UhtTWrt8e7x2SVBZqsWZJeT5Gw', } @@ -29,8 +29,8 @@ 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' || cluster === 'pythdev') { - return 'https://api.pythtest.pyth.network' + if (cluster === 'pythtest-conformance' || cluster === 'pythtest-crosschain') { + return 'https://api.pythtest-conformance.pyth.network' } else if (cluster === 'pythnet') { return 'https://pythnet.rpcpool.com' } else if (cluster === 'localnet') { From a4f10ea7ee61f352d6da1a30e5b0d563ddfb2bc3 Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Alapont Date: Wed, 5 Apr 2023 17:16:05 -0500 Subject: [PATCH 5/6] Fix url --- src/cluster.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cluster.ts b/src/cluster.ts index 0ae3e41..fd09c0d 100644 --- a/src/cluster.ts +++ b/src/cluster.ts @@ -30,7 +30,7 @@ export function getPythProgramKeyForCluster(cluster: PythCluster): PublicKey { export function getPythClusterApiUrl(cluster: PythCluster): string { // TODO: Add pythnet when it's ready if (cluster === 'pythtest-conformance' || cluster === 'pythtest-crosschain') { - return 'https://api.pythtest-conformance.pyth.network' + return 'https://api.pythtest.pyth.network' } else if (cluster === 'pythnet') { return 'https://pythnet.rpcpool.com' } else if (cluster === 'localnet') { From 1c1270ba54e0d14e110d898435417f8e0c3ba152 Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Alapont Date: Wed, 5 Apr 2023 17:16:36 -0500 Subject: [PATCH 6/6] 2.16.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b209053..82cc215 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@pythnetwork/client", - "version": "2.15.1", + "version": "2.16.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@pythnetwork/client", - "version": "2.15.1", + "version": "2.16.0", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "^0.26.0", diff --git a/package.json b/package.json index d270e1d..1d2b0db 100644 --- a/package.json +++ b/package.json @@ -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",