@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
26 lines • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStakePoolExplorer = exports.getAccountContractExplorer = exports.getAddressExplorer = exports.getTransactionExplorer = exports.getDefaultExplorerView = void 0;
const getDefaultExplorerView = (currency) => {
return currency.explorerViews ? currency.explorerViews[0] : undefined;
};
exports.getDefaultExplorerView = getDefaultExplorerView;
const getTransactionExplorer = (explorerView, txHash) => {
return explorerView?.tx?.replace("$hash", txHash);
};
exports.getTransactionExplorer = getTransactionExplorer;
const getAddressExplorer = (explorerView, address) => {
return explorerView?.address?.replace("$address", address);
};
exports.getAddressExplorer = getAddressExplorer;
const getAccountContractExplorer = (explorerView, account, parentAccount) => {
return explorerView?.token
?.replace("$contractAddress", account.token.contractAddress)
.replace("$address", parentAccount.freshAddress);
};
exports.getAccountContractExplorer = getAccountContractExplorer;
const getStakePoolExplorer = (explorerView, poolId) => {
return explorerView?.stakePool?.replace("$poolId", poolId);
};
exports.getStakePoolExplorer = getStakePoolExplorer;
//# sourceMappingURL=explorers.js.map