@taquito/utils
Advanced tools
Comparing version 18.0.0-RC.0 to 19.0.0-beta-RC.0
@@ -41,12 +41,5 @@ "use strict"; | ||
Prefix["ZET1"] = "zet1"; | ||
//rollups | ||
Prefix["TXI"] = "txi"; | ||
Prefix["TXM"] = "txm"; | ||
Prefix["TXC"] = "txc"; | ||
Prefix["TXMR"] = "txmr"; | ||
Prefix["TXRL"] = "txM"; | ||
Prefix["TXW"] = "txw"; | ||
Prefix["SR1"] = "sr1"; | ||
Prefix["SRC1"] = "src1"; | ||
})(Prefix = exports.Prefix || (exports.Prefix = {})); | ||
})(Prefix || (exports.Prefix = Prefix = {})); | ||
exports.prefix = { | ||
@@ -89,8 +82,2 @@ [Prefix.TZ1]: new Uint8Array([6, 161, 159]), | ||
[Prefix.ZET1]: new Uint8Array([18, 71, 40, 223]), | ||
[Prefix.TXI]: new Uint8Array([79, 148, 196]), | ||
[Prefix.TXM]: new Uint8Array([79, 149, 30]), | ||
[Prefix.TXC]: new Uint8Array([79, 148, 17]), | ||
[Prefix.TXMR]: new Uint8Array([18, 7, 206, 87]), | ||
[Prefix.TXRL]: new Uint8Array([79, 146, 82]), | ||
[Prefix.TXW]: new Uint8Array([79, 150, 72]), | ||
[Prefix.SR1]: new Uint8Array([6, 124, 117]), | ||
@@ -122,11 +109,4 @@ [Prefix.SRC1]: new Uint8Array([17, 165, 134, 138]), | ||
[Prefix.ZET1]: 43, | ||
[Prefix.TXI]: 32, | ||
[Prefix.TXM]: 32, | ||
[Prefix.TXC]: 32, | ||
[Prefix.TXMR]: 32, | ||
[Prefix.TXRL]: 32, | ||
[Prefix.TXW]: 32, | ||
[Prefix.SR1]: 20, | ||
[Prefix.SRC1]: 32, | ||
}; | ||
//# sourceMappingURL=constants.js.map |
@@ -50,2 +50,1 @@ "use strict"; | ||
exports.ValueConversionError = ValueConversionError; | ||
//# sourceMappingURL=errors.js.map |
@@ -28,2 +28,1 @@ "use strict"; | ||
exports.format = format; | ||
//# sourceMappingURL=format.js.map |
@@ -8,3 +8,7 @@ "use strict"; | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -53,3 +57,3 @@ if (k2 === undefined) k2 = k; | ||
function encodeExpr(value) { | ||
const blakeHash = blakejs_1.default.blake2b(exports.hex2buf(value), undefined, 32); | ||
const blakeHash = blakejs_1.default.blake2b((0, exports.hex2buf)(value), undefined, 32); | ||
return b58cencode(blakeHash, constants_1.prefix['expr']); | ||
@@ -64,3 +68,3 @@ } | ||
function encodeOpHash(value) { | ||
const blakeHash = blakejs_1.default.blake2b(exports.hex2buf(value), undefined, 32); | ||
const blakeHash = blakejs_1.default.blake2b((0, exports.hex2buf)(value), undefined, 32); | ||
return b58cencode(blakeHash, constants_1.prefix.o); | ||
@@ -109,3 +113,3 @@ } | ||
// tz addresses | ||
const hex = exports.buf2hex(buf.slice(3)); | ||
const hex = (0, exports.buf2hex)(buf.slice(3)); | ||
return pref + hex; | ||
@@ -115,3 +119,3 @@ } | ||
// other (kt addresses) | ||
return '01' + exports.buf2hex(buf.slice(3, 42)) + '00'; | ||
return '01' + (0, exports.buf2hex)(buf.slice(3, 42)) + '00'; | ||
} | ||
@@ -129,3 +133,3 @@ } | ||
// tz4 address currently | ||
return exports.buf2hex(buf.slice(3, 42)); | ||
return (0, exports.buf2hex)(buf.slice(3, 42)); | ||
} | ||
@@ -295,10 +299,9 @@ exports.b58decodeL2Address = b58decodeL2Address; | ||
* | ||
* @description Convert a buffer to an hex string | ||
* @description Convert a Uint8Array to an hex string | ||
* | ||
* @param buffer Buffer to convert | ||
* @param buffer Uint8Array to convert | ||
*/ | ||
const buf2hex = (buffer) => { | ||
const byteArray = new Uint8Array(buffer); | ||
const hexParts = []; | ||
byteArray.forEach((byte) => { | ||
buffer.forEach((byte) => { | ||
const hex = byte.toString(16); | ||
@@ -321,4 +324,4 @@ const paddedHex = `00${hex}`.slice(-2); | ||
let prefixLen; | ||
const keyPrefix = verify_signature_1.validatePkAndExtractPrefix(publicKey); | ||
const decoded = exports.b58cdecode(publicKey, constants_1.prefix[keyPrefix]); | ||
const keyPrefix = (0, verify_signature_1.validatePkAndExtractPrefix)(publicKey); | ||
const decoded = (0, exports.b58cdecode)(publicKey, constants_1.prefix[keyPrefix]); | ||
switch (keyPrefix) { | ||
@@ -341,3 +344,3 @@ case constants_1.Prefix.EDPK: | ||
} | ||
const hashed = blake2b_1.hash(decoded, prefixLen); | ||
const hashed = (0, blake2b_1.hash)(decoded, prefixLen); | ||
const result = b58cencode(hashed, encodingPrefix); | ||
@@ -364,3 +367,3 @@ return result; | ||
function bytes2Char(hex) { | ||
return buffer_1.Buffer.from(exports.hex2buf(hex)).toString('utf8'); | ||
return buffer_1.Buffer.from((0, exports.hex2buf)(hex)).toString('utf8'); | ||
} | ||
@@ -403,3 +406,3 @@ exports.bytes2Char = bytes2Char; | ||
const hex = val.toString(16); | ||
// check whether nibble (4 bits) length is higher or lowerthan the current hex string length | ||
// check whether nibble (4 bits) length is higher or lower than the current hex string length | ||
let targetLength = hex.length >= nibbleLength ? hex.length : nibbleLength; | ||
@@ -438,2 +441,1 @@ // make sure the hex string target length is even | ||
exports.stripHexPrefix = stripHexPrefix; | ||
//# sourceMappingURL=taquito-utils.js.map |
@@ -12,3 +12,3 @@ "use strict"; | ||
ValidationResult[ValidationResult["VALID"] = 3] = "VALID"; | ||
})(ValidationResult = exports.ValidationResult || (exports.ValidationResult = {})); | ||
})(ValidationResult || (exports.ValidationResult = ValidationResult = {})); | ||
function isValidPrefix(value) { | ||
@@ -264,2 +264,1 @@ if (typeof value !== 'string') { | ||
exports.validateSmartRollupAddress = validateSmartRollupAddress; | ||
//# sourceMappingURL=validators.js.map |
@@ -14,3 +14,3 @@ "use strict"; | ||
* @param messageBytes The forged message including the magic byte (11 for block, | ||
* 12 for preendorsement/preattestation, 13 for endorsement/attestation, 3 for generic, 5 for the PACK format of michelson) | ||
* 12 for preattestation/preendorsement, 13 for attestation/endorsement, 3 for generic, 5 for the PACK format of michelson) | ||
* @param publicKey The public key to verify the signature against | ||
@@ -33,9 +33,9 @@ * @param signature The signature to verify | ||
const sigPrefix = validateSigAndExtractPrefix(signature); | ||
const decodedPublicKey = taquito_utils_1.b58cdecode(publicKey, taquito_utils_1.prefix[pkPrefix]); | ||
const decodedSig = taquito_utils_1.b58cdecode(signature, taquito_utils_1.prefix[sigPrefix]); | ||
let messageBuf = taquito_utils_1.hex2buf(validateMessageNotEmpty(messageBytes)); | ||
const decodedPublicKey = (0, taquito_utils_1.b58cdecode)(publicKey, taquito_utils_1.prefix[pkPrefix]); | ||
const decodedSig = (0, taquito_utils_1.b58cdecode)(signature, taquito_utils_1.prefix[sigPrefix]); | ||
let messageBuf = (0, taquito_utils_1.hex2buf)(validateMessageNotEmpty(messageBytes)); | ||
if (typeof watermark !== 'undefined') { | ||
messageBuf = taquito_utils_1.mergebuf(watermark, messageBuf); | ||
messageBuf = (0, taquito_utils_1.mergebuf)(watermark, messageBuf); | ||
} | ||
const bytesHash = blake2b_1.hash(messageBuf, 32); | ||
const bytesHash = (0, blake2b_1.hash)(messageBuf, 32); | ||
if (pkPrefix === taquito_utils_1.Prefix.EDPK) { | ||
@@ -66,5 +66,5 @@ return verifyEdSignature(decodedSig, bytesHash, decodedPublicKey); | ||
const pkPrefix = publicKey.substring(0, 4); | ||
const publicKeyValidation = taquito_utils_1.validatePublicKey(publicKey); | ||
const publicKeyValidation = (0, taquito_utils_1.validatePublicKey)(publicKey); | ||
if (publicKeyValidation !== taquito_utils_1.ValidationResult.VALID) { | ||
throw new core_1.InvalidPublicKeyError(publicKey, taquito_utils_1.invalidDetail(publicKeyValidation)); | ||
throw new core_1.InvalidPublicKeyError(publicKey, (0, taquito_utils_1.invalidDetail)(publicKeyValidation)); | ||
} | ||
@@ -78,5 +78,5 @@ return pkPrefix; | ||
: signature.substring(0, 5); | ||
const validation = taquito_utils_1.validateSignature(signature); | ||
const validation = (0, taquito_utils_1.validateSignature)(signature); | ||
if (validation !== taquito_utils_1.ValidationResult.VALID) { | ||
throw new core_1.InvalidSignatureError(signature, taquito_utils_1.invalidDetail(validation)); | ||
throw new core_1.InvalidSignatureError(signature, (0, taquito_utils_1.invalidDetail)(validation)); | ||
} | ||
@@ -87,3 +87,3 @@ return signaturePrefix; | ||
try { | ||
return ed25519_1.verify(decodedPublicKey, bytesHash, decodedSig); | ||
return (0, ed25519_1.verify)(decodedPublicKey, bytesHash, decodedSig); | ||
} | ||
@@ -103,3 +103,3 @@ catch (e) { | ||
function verifySpOrP2Sig(decodedSig, bytesHash, key) { | ||
const hexSig = taquito_utils_1.buf2hex(typedarray_to_buffer_1.default(decodedSig)); | ||
const hexSig = (0, taquito_utils_1.buf2hex)((0, typedarray_to_buffer_1.default)(decodedSig)); | ||
const match = hexSig.match(/([a-f\d]{64})/gi); | ||
@@ -117,2 +117,1 @@ if (match) { | ||
} | ||
//# sourceMappingURL=verify-signature.js.map |
@@ -6,5 +6,4 @@ "use strict"; | ||
exports.VERSION = { | ||
"commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", | ||
"version": "18.0.0-RC.0" | ||
"commitHash": "bd52c12d05e329e4cf3a81fe55c4778a47879ccd", | ||
"version": "19.0.0-beta-RC.0" | ||
}; | ||
//# sourceMappingURL=version.js.map |
@@ -49,9 +49,2 @@ import { Buffer } from 'buffer'; | ||
Prefix["ZET1"] = "zet1"; | ||
//rollups | ||
Prefix["TXI"] = "txi"; | ||
Prefix["TXM"] = "txm"; | ||
Prefix["TXC"] = "txc"; | ||
Prefix["TXMR"] = "txmr"; | ||
Prefix["TXRL"] = "txM"; | ||
Prefix["TXW"] = "txw"; | ||
Prefix["SR1"] = "sr1"; | ||
@@ -97,8 +90,2 @@ Prefix["SRC1"] = "src1"; | ||
[Prefix.ZET1]: new Uint8Array([18, 71, 40, 223]), | ||
[Prefix.TXI]: new Uint8Array([79, 148, 196]), | ||
[Prefix.TXM]: new Uint8Array([79, 149, 30]), | ||
[Prefix.TXC]: new Uint8Array([79, 148, 17]), | ||
[Prefix.TXMR]: new Uint8Array([18, 7, 206, 87]), | ||
[Prefix.TXRL]: new Uint8Array([79, 146, 82]), | ||
[Prefix.TXW]: new Uint8Array([79, 150, 72]), | ||
[Prefix.SR1]: new Uint8Array([6, 124, 117]), | ||
@@ -130,8 +117,2 @@ [Prefix.SRC1]: new Uint8Array([17, 165, 134, 138]), | ||
[Prefix.ZET1]: 43, | ||
[Prefix.TXI]: 32, | ||
[Prefix.TXM]: 32, | ||
[Prefix.TXC]: 32, | ||
[Prefix.TXMR]: 32, | ||
[Prefix.TXRL]: 32, | ||
[Prefix.TXW]: 32, | ||
[Prefix.SR1]: 20, | ||
@@ -145,3 +126,3 @@ [Prefix.SRC1]: 32, | ||
* @param messageBytes The forged message including the magic byte (11 for block, | ||
* 12 for preendorsement/preattestation, 13 for endorsement/attestation, 3 for generic, 5 for the PACK format of michelson) | ||
* 12 for preattestation/preendorsement, 13 for attestation/endorsement, 3 for generic, 5 for the PACK format of michelson) | ||
* @param publicKey The public key to verify the signature against | ||
@@ -518,4 +499,4 @@ * @param signature The signature to verify | ||
const VERSION = { | ||
"commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", | ||
"version": "18.0.0-RC.0" | ||
"commitHash": "bd52c12d05e329e4cf3a81fe55c4778a47879ccd", | ||
"version": "19.0.0-beta-RC.0" | ||
}; | ||
@@ -550,2 +531,7 @@ | ||
*/ | ||
/* | ||
* Some code in this file is originally from sotez and eztz | ||
* Copyright (c) 2018 Andrew Kishino | ||
* Copyright (c) 2017 Stephen Andrews | ||
*/ | ||
/** | ||
@@ -782,10 +768,9 @@ * | ||
* | ||
* @description Convert a buffer to an hex string | ||
* @description Convert a Uint8Array to an hex string | ||
* | ||
* @param buffer Buffer to convert | ||
* @param buffer Uint8Array to convert | ||
*/ | ||
const buf2hex = (buffer) => { | ||
const byteArray = new Uint8Array(buffer); | ||
const hexParts = []; | ||
byteArray.forEach((byte) => { | ||
buffer.forEach((byte) => { | ||
const hex = byte.toString(16); | ||
@@ -881,3 +866,3 @@ const paddedHex = `00${hex}`.slice(-2); | ||
const hex = val.toString(16); | ||
// check whether nibble (4 bits) length is higher or lowerthan the current hex string length | ||
// check whether nibble (4 bits) length is higher or lower than the current hex string length | ||
let targetLength = hex.length >= nibbleLength ? hex.length : nibbleLength; | ||
@@ -884,0 +869,0 @@ // make sure the hex string target length is even |
@@ -7,10 +7,2 @@ (function (global, factory) { | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var blake__default = /*#__PURE__*/_interopDefaultLegacy(blake); | ||
var bs58check__default = /*#__PURE__*/_interopDefaultLegacy(bs58check); | ||
var BigNumber__default = /*#__PURE__*/_interopDefaultLegacy(BigNumber); | ||
var elliptic__default = /*#__PURE__*/_interopDefaultLegacy(elliptic); | ||
var toBuffer__default = /*#__PURE__*/_interopDefaultLegacy(toBuffer); | ||
exports.Prefix = void 0; | ||
@@ -53,9 +45,2 @@ (function (Prefix) { | ||
Prefix["ZET1"] = "zet1"; | ||
//rollups | ||
Prefix["TXI"] = "txi"; | ||
Prefix["TXM"] = "txm"; | ||
Prefix["TXC"] = "txc"; | ||
Prefix["TXMR"] = "txmr"; | ||
Prefix["TXRL"] = "txM"; | ||
Prefix["TXW"] = "txw"; | ||
Prefix["SR1"] = "sr1"; | ||
@@ -101,8 +86,2 @@ Prefix["SRC1"] = "src1"; | ||
[exports.Prefix.ZET1]: new Uint8Array([18, 71, 40, 223]), | ||
[exports.Prefix.TXI]: new Uint8Array([79, 148, 196]), | ||
[exports.Prefix.TXM]: new Uint8Array([79, 149, 30]), | ||
[exports.Prefix.TXC]: new Uint8Array([79, 148, 17]), | ||
[exports.Prefix.TXMR]: new Uint8Array([18, 7, 206, 87]), | ||
[exports.Prefix.TXRL]: new Uint8Array([79, 146, 82]), | ||
[exports.Prefix.TXW]: new Uint8Array([79, 150, 72]), | ||
[exports.Prefix.SR1]: new Uint8Array([6, 124, 117]), | ||
@@ -134,8 +113,2 @@ [exports.Prefix.SRC1]: new Uint8Array([17, 165, 134, 138]), | ||
[exports.Prefix.ZET1]: 43, | ||
[exports.Prefix.TXI]: 32, | ||
[exports.Prefix.TXM]: 32, | ||
[exports.Prefix.TXC]: 32, | ||
[exports.Prefix.TXMR]: 32, | ||
[exports.Prefix.TXRL]: 32, | ||
[exports.Prefix.TXW]: 32, | ||
[exports.Prefix.SR1]: 20, | ||
@@ -149,3 +122,3 @@ [exports.Prefix.SRC1]: 32, | ||
* @param messageBytes The forged message including the magic byte (11 for block, | ||
* 12 for preendorsement/preattestation, 13 for endorsement/attestation, 3 for generic, 5 for the PACK format of michelson) | ||
* 12 for preattestation/preendorsement, 13 for attestation/endorsement, 3 for generic, 5 for the PACK format of michelson) | ||
* @param publicKey The public key to verify the signature against | ||
@@ -224,11 +197,11 @@ * @param signature The signature to verify | ||
function verifySpSignature(decodedSig, bytesHash, decodedPublicKey) { | ||
const key = new elliptic__default["default"].ec('secp256k1').keyFromPublic(decodedPublicKey); | ||
const key = new elliptic.ec('secp256k1').keyFromPublic(decodedPublicKey); | ||
return verifySpOrP2Sig(decodedSig, bytesHash, key); | ||
} | ||
function verifyP2Signature(decodedSig, bytesHash, decodedPublicKey) { | ||
const key = new elliptic__default["default"].ec('p256').keyFromPublic(decodedPublicKey); | ||
const key = new elliptic.ec('p256').keyFromPublic(decodedPublicKey); | ||
return verifySpOrP2Sig(decodedSig, bytesHash, key); | ||
} | ||
function verifySpOrP2Sig(decodedSig, bytesHash, key) { | ||
const hexSig = buf2hex(toBuffer__default["default"](decodedSig)); | ||
const hexSig = buf2hex(toBuffer(decodedSig)); | ||
const match = hexSig.match(/([a-f\d]{64})/gi); | ||
@@ -317,3 +290,3 @@ if (match) { | ||
// decodeUnsafe return undefined if decoding fail | ||
let decoded = bs58check__default["default"].decodeUnsafe(value); | ||
let decoded = bs58check.decodeUnsafe(value); | ||
if (!decoded) { | ||
@@ -524,4 +497,4 @@ return exports.ValidationResult.INVALID_CHECKSUM; | ||
const VERSION = { | ||
"commitHash": "21f25a09b87809102b0214544d2c5396eeb5872e", | ||
"version": "18.0.0-RC.0" | ||
"commitHash": "bd52c12d05e329e4cf3a81fe55c4778a47879ccd", | ||
"version": "19.0.0-beta-RC.0" | ||
}; | ||
@@ -543,3 +516,3 @@ | ||
function format(from = 'mutez', to = 'mutez', amount) { | ||
const bigNum = new BigNumber__default["default"](amount); | ||
const bigNum = new BigNumber(amount); | ||
if (bigNum.isNaN()) { | ||
@@ -557,2 +530,7 @@ return amount; | ||
*/ | ||
/* | ||
* Some code in this file is originally from sotez and eztz | ||
* Copyright (c) 2018 Andrew Kishino | ||
* Copyright (c) 2017 Stephen Andrews | ||
*/ | ||
/** | ||
@@ -565,3 +543,3 @@ * | ||
function encodeExpr(value) { | ||
const blakeHash = blake__default["default"].blake2b(hex2buf(value), undefined, 32); | ||
const blakeHash = blake.blake2b(hex2buf(value), undefined, 32); | ||
return b58cencode(blakeHash, prefix['expr']); | ||
@@ -575,3 +553,3 @@ } | ||
function encodeOpHash(value) { | ||
const blakeHash = blake__default["default"].blake2b(hex2buf(value), undefined, 32); | ||
const blakeHash = blake.blake2b(hex2buf(value), undefined, 32); | ||
return b58cencode(blakeHash, prefix.o); | ||
@@ -591,3 +569,3 @@ } | ||
n.set(payloadAr, prefix.length); | ||
return bs58check__default["default"].encode(buffer.Buffer.from(n.buffer)); | ||
return bs58check.encode(buffer.Buffer.from(n.buffer)); | ||
} | ||
@@ -601,3 +579,3 @@ /** | ||
*/ | ||
const b58cdecode = (enc, prefixArg) => bs58check__default["default"].decode(enc).slice(prefixArg.length); | ||
const b58cdecode = (enc, prefixArg) => bs58check.decode(enc).slice(prefixArg.length); | ||
/** | ||
@@ -610,3 +588,3 @@ * | ||
function b58decode(payload) { | ||
const buf = bs58check__default["default"].decode(payload); | ||
const buf = bs58check.decode(payload); | ||
const prefixMap = { | ||
@@ -635,3 +613,3 @@ [prefix.tz1.toString()]: '0000', | ||
function b58decodeL2Address(payload) { | ||
const buf = bs58check__default["default"].decode(payload); | ||
const buf = bs58check.decode(payload); | ||
// tz4 address currently | ||
@@ -795,10 +773,9 @@ return buf2hex(buf.slice(3, 42)); | ||
* | ||
* @description Convert a buffer to an hex string | ||
* @description Convert a Uint8Array to an hex string | ||
* | ||
* @param buffer Buffer to convert | ||
* @param buffer Uint8Array to convert | ||
*/ | ||
const buf2hex = (buffer) => { | ||
const byteArray = new Uint8Array(buffer); | ||
const hexParts = []; | ||
byteArray.forEach((byte) => { | ||
buffer.forEach((byte) => { | ||
const hex = byte.toString(16); | ||
@@ -891,6 +868,6 @@ const paddedHex = `00${hex}`.slice(-2); | ||
function num2PaddedHex(val, bitLength = 8) { | ||
if (new BigNumber__default["default"](val).isPositive()) { | ||
if (new BigNumber(val).isPositive()) { | ||
const nibbleLength = Math.ceil(bitLength / 4); | ||
const hex = val.toString(16); | ||
// check whether nibble (4 bits) length is higher or lowerthan the current hex string length | ||
// check whether nibble (4 bits) length is higher or lower than the current hex string length | ||
let targetLength = hex.length >= nibbleLength ? hex.length : nibbleLength; | ||
@@ -902,5 +879,5 @@ // make sure the hex string target length is even | ||
else { | ||
const twosCompliment = new BigNumber__default["default"](2) | ||
const twosCompliment = new BigNumber(2) | ||
.pow(bitLength) | ||
.minus(new BigNumber__default["default"](val).abs()); | ||
.minus(new BigNumber(val).abs()); | ||
return twosCompliment.toString(16); | ||
@@ -929,55 +906,55 @@ } | ||
Object.defineProperty(exports, 'DeprecationError', { | ||
Object.defineProperty(exports, "DeprecationError", { | ||
enumerable: true, | ||
get: function () { return core.DeprecationError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidAddressError', { | ||
Object.defineProperty(exports, "InvalidAddressError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidAddressError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidBlockHashError', { | ||
Object.defineProperty(exports, "InvalidBlockHashError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidBlockHashError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidChainIdError', { | ||
Object.defineProperty(exports, "InvalidChainIdError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidChainIdError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidContractAddressError', { | ||
Object.defineProperty(exports, "InvalidContractAddressError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidContractAddressError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidHexStringError', { | ||
Object.defineProperty(exports, "InvalidHexStringError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidHexStringError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidKeyError', { | ||
Object.defineProperty(exports, "InvalidKeyError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidKeyError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidKeyHashError', { | ||
Object.defineProperty(exports, "InvalidKeyHashError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidKeyHashError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidMessageError', { | ||
Object.defineProperty(exports, "InvalidMessageError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidMessageError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidOperationHashError', { | ||
Object.defineProperty(exports, "InvalidOperationHashError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidOperationHashError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidOperationKindError', { | ||
Object.defineProperty(exports, "InvalidOperationKindError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidOperationKindError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidPublicKeyError', { | ||
Object.defineProperty(exports, "InvalidPublicKeyError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidPublicKeyError; } | ||
}); | ||
Object.defineProperty(exports, 'InvalidSignatureError', { | ||
Object.defineProperty(exports, "InvalidSignatureError", { | ||
enumerable: true, | ||
get: function () { return core.InvalidSignatureError; } | ||
}); | ||
Object.defineProperty(exports, 'ProhibitedActionError', { | ||
Object.defineProperty(exports, "ProhibitedActionError", { | ||
enumerable: true, | ||
@@ -1029,5 +1006,3 @@ get: function () { return core.ProhibitedActionError; } | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
})); | ||
//# sourceMappingURL=taquito-utils.umd.js.map |
@@ -37,8 +37,2 @@ export declare enum Prefix { | ||
ZET1 = "zet1", | ||
TXI = "txi", | ||
TXM = "txm", | ||
TXC = "txc", | ||
TXMR = "txmr", | ||
TXRL = "txM", | ||
TXW = "txw", | ||
SR1 = "sr1", | ||
@@ -83,8 +77,2 @@ SRC1 = "src1" | ||
zet1: Uint8Array; | ||
txi: Uint8Array; | ||
txm: Uint8Array; | ||
txc: Uint8Array; | ||
txmr: Uint8Array; | ||
txM: Uint8Array; | ||
txw: Uint8Array; | ||
sr1: Uint8Array; | ||
@@ -91,0 +79,0 @@ src1: Uint8Array; |
@@ -0,0 +0,0 @@ import { ParameterValidationError, UnsupportedActionError } from '@taquito/core'; |
import BigNumber from 'bignumber.js'; | ||
declare type Format = 'tz' | 'mtz' | 'mutez'; | ||
type Format = 'tz' | 'mtz' | 'mutez'; | ||
export declare function format(from: Format | undefined, to: Format | undefined, amount: number | string | BigNumber): string | number | BigNumber; | ||
export {}; |
@@ -110,7 +110,7 @@ /** | ||
* | ||
* @description Convert a buffer to an hex string | ||
* @description Convert a Uint8Array to an hex string | ||
* | ||
* @param buffer Buffer to convert | ||
* @param buffer Uint8Array to convert | ||
*/ | ||
export declare const buf2hex: (buffer: Buffer) => string; | ||
export declare const buf2hex: (buffer: Uint8Array) => string; | ||
/** | ||
@@ -117,0 +117,0 @@ * |
@@ -0,0 +0,0 @@ import { Prefix } from './constants'; |
import { Prefix } from './taquito-utils'; | ||
declare type PkPrefix = Prefix.EDPK | Prefix.SPPK | Prefix.P2PK | Prefix.BLPK; | ||
type PkPrefix = Prefix.EDPK | Prefix.SPPK | Prefix.P2PK | Prefix.BLPK; | ||
/** | ||
@@ -7,3 +7,3 @@ * @description Verify signature of a payload | ||
* @param messageBytes The forged message including the magic byte (11 for block, | ||
* 12 for preendorsement/preattestation, 13 for endorsement/attestation, 3 for generic, 5 for the PACK format of michelson) | ||
* 12 for preattestation/preendorsement, 13 for attestation/endorsement, 3 for generic, 5 for the PACK format of michelson) | ||
* @param publicKey The public key to verify the signature against | ||
@@ -10,0 +10,0 @@ * @param signature The signature to verify |
@@ -0,0 +0,0 @@ export declare const VERSION: { |
{ | ||
"name": "@taquito/utils", | ||
"version": "18.0.0-RC.0", | ||
"version": "19.0.0-beta-RC.0", | ||
"description": "converts michelson data and types into convenient JS/TS objects", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=16" | ||
"node": ">=18" | ||
}, | ||
@@ -36,4 +36,4 @@ "scripts": { | ||
"version-stamp": "node ../taquito/version-stamping.js", | ||
"build": "tsc --project ./tsconfig.prod.json --module commonjs && rollup -c rollup.config.ts", | ||
"start": "rollup -c rollup.config.ts -w", | ||
"build": "tsc --project ./tsconfig.prod.json --module commonjs && rollup -c rollup.config.ts --bundleConfigAsCjs", | ||
"start": "rollup -c rollup.config.ts --bundleConfigAsCjs -w", | ||
"test": "jest" | ||
@@ -44,4 +44,3 @@ }, | ||
"prettier --write", | ||
"eslint --fix", | ||
"git add" | ||
"eslint --fix" | ||
] | ||
@@ -71,7 +70,7 @@ }, | ||
"@stablelib/ed25519": "^1.0.3", | ||
"@taquito/core": "^18.0.0-RC.0", | ||
"@taquito/core": "^19.0.0-beta-RC.0", | ||
"@types/bs58check": "^2.1.0", | ||
"bignumber.js": "^9.1.0", | ||
"bignumber.js": "^9.1.2", | ||
"blakejs": "^1.2.1", | ||
"bs58check": "^2.1.2", | ||
"bs58check": "^3.0.1", | ||
"buffer": "^6.0.3", | ||
@@ -82,31 +81,30 @@ "elliptic": "^6.5.4", | ||
"devDependencies": { | ||
"@types/bluebird": "^3.5.36", | ||
"@types/elliptic": "^6.4.14", | ||
"@types/jest": "^26.0.23", | ||
"@types/node": "^16", | ||
"@typescript-eslint/eslint-plugin": "^5.28.0", | ||
"@typescript-eslint/parser": "^5.28.0", | ||
"@types/bluebird": "^3.5.40", | ||
"@types/elliptic": "^6.4.15", | ||
"@types/jest": "^29.5.5", | ||
"@types/node": "^20", | ||
"@typescript-eslint/eslint-plugin": "^6.8.0", | ||
"@typescript-eslint/parser": "^6.8.0", | ||
"colors": "^1.4.0", | ||
"coveralls": "^3.1.1", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.17.0", | ||
"jest": "^26.6.3", | ||
"jest-config": "^26.6.3", | ||
"lint-staged": "^13.0.1", | ||
"eslint": "^8.51.0", | ||
"jest": "^29.7.0", | ||
"jest-config": "^29.7.0", | ||
"lint-staged": "^14.0.1", | ||
"lodash.camelcase": "^4.3.0", | ||
"prettier": "^2.7.0", | ||
"prettier": "^3.0.3", | ||
"prompt": "^1.3.0", | ||
"replace-in-file": "^6.3.5", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.75.6", | ||
"replace-in-file": "^7.0.1", | ||
"rimraf": "^5.0.5", | ||
"rollup": "^4.1.4", | ||
"rollup-plugin-json": "^4.0.0", | ||
"rollup-plugin-sourcemaps": "^0.6.3", | ||
"rollup-plugin-typescript2": "^0.32.1", | ||
"rollup-plugin-typescript2": "^0.36.0", | ||
"shelljs": "^0.8.5", | ||
"ts-jest": "^26.4.4", | ||
"ts-node": "^10.4.0", | ||
"ts-jest": "^29.1.1", | ||
"ts-node": "^10.9.1", | ||
"ts-toolbelt": "^9.6.0", | ||
"typescript": "~4.1.5" | ||
"typescript": "~5.2.2" | ||
}, | ||
"gitHead": "998e588c7c72f45bb8d95bed54152b618aa18ec3" | ||
"gitHead": "959e385ba06d8932866503bb538252a3912acbc9" | ||
} |
@@ -131,3 +131,3 @@ { | ||
"engines": { | ||
"node": ">=16" | ||
"node": ">=18" | ||
}, | ||
@@ -144,4 +144,3 @@ "scripts": { | ||
"prettier --write", | ||
"tslint --fix", | ||
"git add" | ||
"tslint --fix" | ||
] | ||
@@ -175,3 +174,3 @@ }, | ||
"@types/jest": "^26.0.16", | ||
"@types/node": "^16", | ||
"@types/node": "^18", | ||
"colors": "^1.4.0", | ||
@@ -190,3 +189,2 @@ "coveralls": "^3.1.0", | ||
"rollup-plugin-json": "^4.0.0", | ||
"rollup-plugin-sourcemaps": "^0.6.3", | ||
"rollup-plugin-typescript2": "^0.27.3", | ||
@@ -193,0 +191,0 @@ "shelljs": "^0.8.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26
151734
22
3533
+ Added@noble/hashes@1.5.0(transitive)
+ Added@taquito/core@19.2.1(transitive)
+ Addedbase-x@4.0.0(transitive)
+ Addedbs58@5.0.0(transitive)
+ Addedbs58check@3.0.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
- Removed@taquito/core@18.0.0-RC.0(transitive)
- Removedbase-x@3.0.10(transitive)
- Removedbs58@4.0.1(transitive)
- Removedbs58check@2.1.2(transitive)
- Removedcipher-base@1.0.4(transitive)
- Removedcreate-hash@1.2.0(transitive)
- Removedhash-base@3.1.0(transitive)
- Removedmd5.js@1.3.5(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedripemd160@2.0.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsha.js@2.4.11(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
Updatedbignumber.js@^9.1.2
Updatedbs58check@^3.0.1