@dynamic-labs/sdk-react-core
Version:
A React SDK for implementing wallet web3 authentication and authorization to your website.
23 lines (18 loc) • 687 B
JavaScript
'use client'
;
Object.defineProperty(exports, '__esModule', { value: true });
var _tslib = require('../../../../../_virtual/_tslib.cjs');
const getTransactionLink = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ walletConnector, transactionHash, }) {
try {
const [blockExplorerUrl] = yield walletConnector.getBlockExplorerUrlsForCurrentNetwork();
if (!blockExplorerUrl)
return undefined;
const url = new URL(blockExplorerUrl);
url.pathname = `/tx/${transactionHash}`;
return url.toString();
}
catch (error) {
return undefined;
}
});
exports.getTransactionLink = getTransactionLink;