@turnkey/react-wallet-kit
Version:
The easiest and most powerful way to integrate Turnkey's Embedded Wallets into your React applications.
38 lines (34 loc) • 1.35 kB
JavaScript
;
var jsxRuntime = require('react/jsx-runtime');
var Svg = require('../design/Svg.js');
function getExplorerUrl(txHash, caip2) {
switch (caip2) {
case "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":
return `https://solscan.io/tx/${txHash}`;
case "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG":
return `https://solscan.io/tx/${txHash}?cluster=devnet`;
case "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3zQawwpjk2NsNY":
return `https://solscan.io/tx/${txHash}?cluster=testnet`;
case "eip155:8453":
return `https://basescan.org/tx/${txHash}`;
case "eip155:84532":
return `https://sepolia.basescan.org/tx/${txHash}`;
case "eip155:1":
return `https://etherscan.io/tx/${txHash}`;
case "eip155:11155111":
return `https://sepolia.etherscan.io/tx/${txHash}`;
case "eip155:137":
return `https://polygonscan.com/tx/${txHash}`;
default:
return caip2.startsWith("solana:") ? `https://solscan.io/tx/${txHash}` : `https://etherscan.io/tx/${txHash}`;
}
}
function getChainLogo(caip2) {
const Logo = caip2.startsWith("solana:") ? Svg.SolanaLogo : Svg.EthereumLogo;
return jsxRuntime.jsx(Logo, {
className: "h-10 w-10 rounded-full"
});
}
exports.getChainLogo = getChainLogo;
exports.getExplorerUrl = getExplorerUrl;
//# sourceMappingURL=helpers.js.map