Skip to content

Commit 62f2474

Browse files
committed
refactor
1 parent 0d89bd1 commit 62f2474

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

wormhole-connect/src/utils/index.ts

+15-16
Original file line numberDiff line numberDiff line change
@@ -294,23 +294,22 @@ export const getExplorerUrl = (
294294
const chainConfig = config.chains[chain]!;
295295
const baseUrl = chainConfig.explorerUrl;
296296

297-
if (pathType === 'wallet') {
298-
return `${baseUrl}address/${path}`;
299-
}
300-
301-
if (pathType === 'tx') {
302-
return `${baseUrl}tx/${path}`;
303-
}
304-
305-
switch (chain) {
306-
case 'Sui':
307-
return `${baseUrl}coin/${path}`;
308-
case 'Aptos':
309-
return `${baseUrl}${
310-
isHexString(path) ? 'fungible_asset' : 'coin'
311-
}/${path}`;
312-
default:
297+
switch (pathType) {
298+
case 'wallet':
313299
return `${baseUrl}address/${path}`;
300+
case 'tx':
301+
return `${baseUrl}tx/${path}`;
302+
default:
303+
switch (chain) {
304+
case 'Sui':
305+
return `${baseUrl}coin/${path}`;
306+
case 'Aptos':
307+
return `${baseUrl}${
308+
isHexString(path) ? 'fungible_asset' : 'coin'
309+
}/${path}`;
310+
default:
311+
return `${baseUrl}token/${path}`;
312+
}
314313
}
315314
};
316315

0 commit comments

Comments
 (0)