UNPKG

dp-contract-proxy-kit

Version:

Enable batched transactions and contract account interactions using a unique deterministic Gnosis Safe.

21 lines 723 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toHex = exports.getHexDataLength = exports.joinHexData = void 0; function joinHexData(hexData) { return `0x${hexData .map((hex) => { const stripped = hex.replace(/^0x/, ''); return stripped.length % 2 === 0 ? stripped : '0' + stripped; }) .join('')}`; } exports.joinHexData = joinHexData; function getHexDataLength(hexData) { return Math.ceil((hexData.startsWith('0x') ? hexData.length - 2 : hexData.length) / 2); } exports.getHexDataLength = getHexDataLength; function toHex(v) { return `0x${Number(v.toString()).toString(16)}`; } exports.toHex = toHex; //# sourceMappingURL=hexData.js.map