UNPKG

@reservoir0x/relay-kit-ui

Version:

Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.

18 lines 717 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.truncateEns = exports.truncateAddress = void 0; function truncateAddress(address, shrinkInidicator, firstSectionLength, lastSectionLength) { return address ? address.slice(0, firstSectionLength ?? 4) + (shrinkInidicator || '…') + address.slice(-(lastSectionLength ?? 4)) : address; } exports.truncateAddress = truncateAddress; function truncateEns(ensName, shrinkInidicator) { if (ensName.length < 24) return ensName; return ensName.slice(0, 20) + (shrinkInidicator || '…') + ensName.slice(-3); } exports.truncateEns = truncateEns; //# sourceMappingURL=truncate.js.map