Skip to content

Commit

Permalink
cloud_functions: update wormholescanRPC for testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
panoel committed Jul 9, 2024
1 parent 1df5515 commit 11cbd1b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cloud_functions/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export const padUint16 = (s: string): string => s.padStart(MAX_UINT_16.length, '
const MAX_UINT_64 = '18446744073709551615';
export const padUint64 = (s: string): string => s.padStart(MAX_UINT_64.length, '0');

export const WormholescanRPC: string = 'https://api.wormholescan.io/';
export const WormholescanRPC: { [key in Network]?: string } = {
['Mainnet']: 'https://api.wormholescan.io/',
['Testnet']: 'https://api.testnet.wormholescan.io/',
['Devnet']: '',
};

export function parseMessageId(id: string): {
chain: number;
Expand Down Expand Up @@ -89,7 +93,7 @@ export async function formatAndSendToSlack(info: SlackInfo): Promise<any> {

export async function isVAASigned(network: Network, vaaKey: string): Promise<boolean> {
const url: string =
WormholescanRPC + 'v1/signed_vaa/' + vaaKey + '?network=' + network.toUpperCase();
WormholescanRPC[network] + 'v1/signed_vaa/' + vaaKey + '?network=' + network.toUpperCase();
try {
const response = await axios.get(url);
// curl -X 'GET' \
Expand Down

0 comments on commit 11cbd1b

Please sign in to comment.