Skip to content

Commit

Permalink
match against all MayanSwap* names (#2613)
Browse files Browse the repository at this point in the history
  • Loading branch information
artursapek authored Sep 16, 2024
1 parent f232b4d commit 994d8bf
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions wormhole-connect/src/utils/sdkv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,22 @@ export function getExplorerLink(
route: routes.Route<Network>,
txHash: string,
): ExplorerLink {
switch ((route.constructor as routes.RouteConstructor).meta.name) {
case 'MayanSwap':
return {
url: `https://explorer.mayan.finance/swap/${txHash}`,
name: 'Mayan Explorer',
};
default:
return {
url: `${WORMSCAN}tx/${txHash}${
config.isMainnet ? '' : '?network=TESTNET'
}`,
name: 'Wormholescan',
};
if (
(route.constructor as routes.RouteConstructor).meta.name.startsWith(
'MayanSwap',
)
) {
return {
url: `https://explorer.mayan.finance/swap/${txHash}`,
name: 'Mayan Explorer',
};
} else {
return {
url: `${WORMSCAN}tx/${txHash}${
config.isMainnet ? '' : '?network=TESTNET'
}`,
name: 'Wormholescan',
};
}
}

Expand Down

0 comments on commit 994d8bf

Please sign in to comment.