Update wormhole endpoint (#1171)
This commit is contained in:
parent
8adac4344f
commit
f12df1528b
|
@ -53,12 +53,12 @@ export const CONFIG: Record<Cluster, Config> = {
|
||||||
devnet: {
|
devnet: {
|
||||||
wormholeClusterName: "TESTNET",
|
wormholeClusterName: "TESTNET",
|
||||||
vault: new PublicKey("6baWtW1zTUVMSJHJQVxDUXWzqrQeYBr6mu31j3bTKwY3"),
|
vault: new PublicKey("6baWtW1zTUVMSJHJQVxDUXWzqrQeYBr6mu31j3bTKwY3"),
|
||||||
wormholeRpcEndpoint: "https://wormhole-v2-testnet-api.certus.one",
|
wormholeRpcEndpoint: "https://api.testnet.wormholescan.io",
|
||||||
},
|
},
|
||||||
mainnet: {
|
mainnet: {
|
||||||
wormholeClusterName: "MAINNET",
|
wormholeClusterName: "MAINNET",
|
||||||
vault: new PublicKey("FVQyHcooAtThJ83XFrNnv74BcinbRH3bRmfFamAHBfuj"),
|
vault: new PublicKey("FVQyHcooAtThJ83XFrNnv74BcinbRH3bRmfFamAHBfuj"),
|
||||||
wormholeRpcEndpoint: "https://wormhole-v2-mainnet-api.certus.one",
|
wormholeRpcEndpoint: "https://api.wormholescan.io",
|
||||||
},
|
},
|
||||||
localdevnet: {
|
localdevnet: {
|
||||||
wormholeClusterName: "DEVNET",
|
wormholeClusterName: "DEVNET",
|
||||||
|
|
|
@ -40,6 +40,8 @@ const OFFSET: number = Number(process.env.OFFSET ?? "-1");
|
||||||
const COMMITMENT: Commitment =
|
const COMMITMENT: Commitment =
|
||||||
(process.env.COMMITMENT as Commitment) ?? "confirmed";
|
(process.env.COMMITMENT as Commitment) ?? "confirmed";
|
||||||
|
|
||||||
|
const GUARDIAN_RPC = process.env.GUARDIAN_RPC;
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
const provider = new AnchorProvider(
|
const provider = new AnchorProvider(
|
||||||
new Connection(getPythClusterApiUrl(CLUSTER), COMMITMENT),
|
new Connection(getPythClusterApiUrl(CLUSTER), COMMITMENT),
|
||||||
|
@ -65,7 +67,7 @@ async function run() {
|
||||||
? (claimRecord.sequence as BN).toNumber()
|
? (claimRecord.sequence as BN).toNumber()
|
||||||
: -1;
|
: -1;
|
||||||
lastSequenceNumber = Math.max(lastSequenceNumber, OFFSET);
|
lastSequenceNumber = Math.max(lastSequenceNumber, OFFSET);
|
||||||
const wormholeApi = WORMHOLE_API_ENDPOINT[CLUSTER];
|
const wormholeApi = GUARDIAN_RPC ?? WORMHOLE_API_ENDPOINT[CLUSTER];
|
||||||
const productAccountToSymbol: { [key: string]: string } = {};
|
const productAccountToSymbol: { [key: string]: string } = {};
|
||||||
while (true) {
|
while (true) {
|
||||||
lastSequenceNumber += 1;
|
lastSequenceNumber += 1;
|
||||||
|
|
|
@ -15,13 +15,13 @@ export const WORMHOLE_ADDRESS: Record<PythCluster, PublicKey | undefined> = {
|
||||||
testnet: undefined,
|
testnet: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Source : https://book.wormhole.com/reference/rpcnodes.html
|
// Source : https://docs.wormhole.com/wormhole/reference/sdk-docs#mainnet-guardian-rpc
|
||||||
export const WORMHOLE_API_ENDPOINT: Record<PythCluster, string | undefined> = {
|
export const WORMHOLE_API_ENDPOINT: Record<PythCluster, string | undefined> = {
|
||||||
"mainnet-beta": "https://wormhole-v2-mainnet-api.certus.one",
|
"mainnet-beta": "https://api.wormholescan.io",
|
||||||
"pythtest-conformance": "https://wormhole-v2-testnet-api.certus.one",
|
"pythtest-conformance": "https://api.testnet.wormholescan.io",
|
||||||
"pythtest-crosschain": "https://wormhole-v2-testnet-api.certus.one",
|
"pythtest-crosschain": "https://api.testnet.wormholescan.io",
|
||||||
devnet: "https://wormhole-v2-testnet-api.certus.one",
|
devnet: "https://api.testnet.wormholescan.io",
|
||||||
pythnet: "https://wormhole-v2-mainnet-api.certus.one",
|
pythnet: "https://api.wormholescan.io",
|
||||||
localnet: undefined,
|
localnet: undefined,
|
||||||
testnet: undefined,
|
testnet: undefined,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue