@taquito/michel-codec
Advanced tools
Comparing version 20.0.2-beta.1 to 20.0.2-beta.2
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.encodeBase58Check = exports.decodeBase58Check = exports.encodeBase58 = exports.decodeBase58 = exports.Base58DecodingError = void 0; | ||
exports.Base58DecodingError = void 0; | ||
exports.decodeBase58 = decodeBase58; | ||
exports.encodeBase58 = encodeBase58; | ||
exports.decodeBase58Check = decodeBase58Check; | ||
exports.encodeBase58Check = encodeBase58Check; | ||
const core_1 = require("@taquito/core"); | ||
@@ -209,3 +213,2 @@ const H = [ | ||
} | ||
exports.decodeBase58 = decodeBase58; | ||
function encodeBase58(src) { | ||
@@ -234,3 +237,2 @@ const acc = []; | ||
} | ||
exports.encodeBase58 = encodeBase58; | ||
function decodeBase58Check(src) { | ||
@@ -252,3 +254,2 @@ const buffer = decodeBase58(src); | ||
} | ||
exports.decodeBase58Check = decodeBase58Check; | ||
function encodeBase58Check(src) { | ||
@@ -258,2 +259,1 @@ const sum = sha256(sha256(src)); | ||
} | ||
exports.encodeBase58Check = encodeBase58Check; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.decodePublicKeyBytes = exports.decodePublicKeyHashBytes = exports.decodeAddressBytes = exports.unpackDataBytes = exports.unpackData = exports.packDataBytes = exports.packData = void 0; | ||
exports.packData = packData; | ||
exports.packDataBytes = packDataBytes; | ||
exports.unpackData = unpackData; | ||
exports.unpackDataBytes = unpackDataBytes; | ||
exports.decodeAddressBytes = decodeAddressBytes; | ||
exports.decodePublicKeyHashBytes = decodePublicKeyHashBytes; | ||
exports.decodePublicKeyBytes = decodePublicKeyBytes; | ||
const michelson_validator_1 = require("./michelson-validator"); | ||
@@ -928,3 +934,2 @@ const utils_1 = require("./utils"); | ||
} | ||
exports.packData = packData; | ||
/** | ||
@@ -955,3 +960,2 @@ * Serializes any value of packable type to its optimized binary representation | ||
} | ||
exports.packDataBytes = packDataBytes; | ||
const getReadTransformFuncs = (t) => { | ||
@@ -1217,3 +1221,2 @@ if ((0, utils_1.isPairType)(t)) { | ||
} | ||
exports.unpackData = unpackData; | ||
/** | ||
@@ -1245,3 +1248,2 @@ * Deserialize a byte array into the corresponding Michelson value. | ||
} | ||
exports.unpackDataBytes = unpackDataBytes; | ||
// helper functions also used by validator | ||
@@ -1256,3 +1258,2 @@ function decodeAddressBytes(b) { | ||
} | ||
exports.decodeAddressBytes = decodeAddressBytes; | ||
function decodePublicKeyHashBytes(b) { | ||
@@ -1266,3 +1267,2 @@ const bytes = (0, utils_1.parseBytes)(b.bytes); | ||
} | ||
exports.decodePublicKeyHashBytes = decodePublicKeyHashBytes; | ||
function decodePublicKeyBytes(b) { | ||
@@ -1276,2 +1276,1 @@ const bytes = (0, utils_1.parseBytes)(b.bytes); | ||
} | ||
exports.decodePublicKeyBytes = decodePublicKeyBytes; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatError = exports.traceDumpFunc = exports.formatStack = void 0; | ||
exports.formatStack = formatStack; | ||
exports.traceDumpFunc = traceDumpFunc; | ||
exports.formatError = formatError; | ||
const micheline_1 = require("./micheline"); | ||
@@ -19,3 +21,2 @@ const michelson_typecheck_1 = require("./michelson-typecheck"); | ||
} | ||
exports.formatStack = formatStack; | ||
function traceDumpFunc(blocks, cb) { | ||
@@ -37,3 +38,2 @@ return (v) => { | ||
} | ||
exports.traceDumpFunc = traceDumpFunc; | ||
function formatError(err) { | ||
@@ -63,2 +63,1 @@ var _a; | ||
} | ||
exports.formatError = formatError; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.expandGlobalConstants = void 0; | ||
exports.expandGlobalConstants = expandGlobalConstants; | ||
function expandGlobalConstants(ex, hashAndValue) { | ||
@@ -13,2 +13,1 @@ if (ex.args !== undefined && | ||
} | ||
exports.expandGlobalConstants = expandGlobalConstants; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.expandMacros = exports.MacroError = void 0; | ||
exports.MacroError = void 0; | ||
exports.expandMacros = expandMacros; | ||
const core_1 = require("@taquito/core"); | ||
@@ -548,2 +549,1 @@ const michelson_types_1 = require("./michelson-types"); | ||
} | ||
exports.expandMacros = expandMacros; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.emitMicheline = void 0; | ||
exports.emitMicheline = emitMicheline; | ||
const micheline_1 = require("./micheline"); | ||
@@ -133,2 +133,1 @@ class Formatter { | ||
} | ||
exports.emitMicheline = emitMicheline; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ProtoInferiorTo = exports.ProtoGreaterOrEqual = exports.DefaultProtocol = exports.Protocol = exports.refContract = void 0; | ||
exports.DefaultProtocol = exports.Protocol = exports.refContract = void 0; | ||
exports.ProtoGreaterOrEqual = ProtoGreaterOrEqual; | ||
exports.ProtoInferiorTo = ProtoInferiorTo; | ||
// Michelson types | ||
@@ -71,6 +73,4 @@ exports.refContract = Symbol('ref_contract'); | ||
} | ||
exports.ProtoGreaterOrEqual = ProtoGreaterOrEqual; | ||
function ProtoInferiorTo(a, b) { | ||
return protoLevel[a] < protoLevel[b]; | ||
} | ||
exports.ProtoInferiorTo = ProtoInferiorTo; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.assertDataListIfAny = exports.isInstruction = exports.isMichelsonType = exports.isMichelsonCode = exports.isMichelsonData = exports.isMichelsonScript = exports.assertMichelsonContract = exports.assertMichelsonData = exports.assertMichelsonType = exports.assertViewNameValid = exports.assertMichelsonBigMapStorableType = exports.assertMichelsonPassableType = exports.assertMichelsonStorableType = exports.assertMichelsonPushableType = exports.assertMichelsonPackableType = exports.assertMichelsonComparableType = exports.assertMichelsonInstruction = exports.MichelsonValidationError = exports.instructionIDs = void 0; | ||
exports.MichelsonValidationError = exports.instructionIDs = void 0; | ||
exports.assertMichelsonInstruction = assertMichelsonInstruction; | ||
exports.assertMichelsonComparableType = assertMichelsonComparableType; | ||
exports.assertMichelsonPackableType = assertMichelsonPackableType; | ||
exports.assertMichelsonPushableType = assertMichelsonPushableType; | ||
exports.assertMichelsonStorableType = assertMichelsonStorableType; | ||
exports.assertMichelsonPassableType = assertMichelsonPassableType; | ||
exports.assertMichelsonBigMapStorableType = assertMichelsonBigMapStorableType; | ||
exports.assertViewNameValid = assertViewNameValid; | ||
exports.assertMichelsonType = assertMichelsonType; | ||
exports.assertMichelsonData = assertMichelsonData; | ||
exports.assertMichelsonContract = assertMichelsonContract; | ||
exports.isMichelsonScript = isMichelsonScript; | ||
exports.isMichelsonData = isMichelsonData; | ||
exports.isMichelsonCode = isMichelsonCode; | ||
exports.isMichelsonType = isMichelsonType; | ||
exports.isInstruction = isInstruction; | ||
exports.assertDataListIfAny = assertDataListIfAny; | ||
const utils_1 = require("./utils"); | ||
@@ -407,3 +424,2 @@ // Michelson validator | ||
} | ||
exports.assertMichelsonInstruction = assertMichelsonInstruction; | ||
function assertMichelsonComparableType(ex) { | ||
@@ -421,3 +437,2 @@ /* istanbul ignore else */ | ||
} | ||
exports.assertMichelsonComparableType = assertMichelsonComparableType; | ||
function assertMichelsonPackableType(ex) { | ||
@@ -439,3 +454,2 @@ /* istanbul ignore else */ | ||
} | ||
exports.assertMichelsonPackableType = assertMichelsonPackableType; | ||
function assertMichelsonPushableType(ex) { | ||
@@ -458,3 +472,2 @@ /* istanbul ignore else */ | ||
} | ||
exports.assertMichelsonPushableType = assertMichelsonPushableType; | ||
function assertMichelsonStorableType(ex) { | ||
@@ -474,3 +487,2 @@ /* istanbul ignore else */ | ||
} | ||
exports.assertMichelsonStorableType = assertMichelsonStorableType; | ||
function assertMichelsonPassableType(ex) { | ||
@@ -488,3 +500,2 @@ /* istanbul ignore else */ | ||
} | ||
exports.assertMichelsonPassableType = assertMichelsonPassableType; | ||
function assertMichelsonBigMapStorableType(ex) { | ||
@@ -505,3 +516,2 @@ /* istanbul ignore else */ | ||
} | ||
exports.assertMichelsonBigMapStorableType = assertMichelsonBigMapStorableType; | ||
const viewRe = new RegExp('^[a-zA-Z0-9_.%@]*$'); | ||
@@ -516,3 +526,2 @@ function assertViewNameValid(name) { | ||
} | ||
exports.assertViewNameValid = assertViewNameValid; | ||
/** | ||
@@ -535,3 +544,2 @@ * Checks if the node is a valid Michelson type expression. | ||
} | ||
exports.assertMichelsonType = assertMichelsonType; | ||
function traverseType(ex, cb) { | ||
@@ -697,3 +705,2 @@ if (Array.isArray(ex) || ex.prim === 'pair') { | ||
} | ||
exports.assertMichelsonData = assertMichelsonData; | ||
/** | ||
@@ -765,3 +772,2 @@ * Checks if the node is a valid Michelson smart contract source containing all required and valid properties such as `parameter`, `storage` and `code`. | ||
} | ||
exports.assertMichelsonContract = assertMichelsonContract; | ||
/** | ||
@@ -780,3 +786,2 @@ * Checks if the node is a valid Michelson smart contract source containing all required and valid properties such as `parameter`, `storage` and `code`. | ||
} | ||
exports.isMichelsonScript = isMichelsonScript; | ||
/** | ||
@@ -795,3 +800,2 @@ * Checks if the node is a valid Michelson data literal such as `(Pair {Elt "0" 0} 0)`. | ||
} | ||
exports.isMichelsonData = isMichelsonData; | ||
/** | ||
@@ -810,3 +814,2 @@ * Checks if the node is a valid Michelson code (sequence of instructions). | ||
} | ||
exports.isMichelsonCode = isMichelsonCode; | ||
/** | ||
@@ -825,7 +828,5 @@ * Checks if the node is a valid Michelson type expression. | ||
} | ||
exports.isMichelsonType = isMichelsonType; | ||
function isInstruction(p) { | ||
return Object.prototype.hasOwnProperty.call(exports.instructionIDs, p.prim); | ||
} | ||
exports.isInstruction = isInstruction; | ||
function assertDataListIfAny(d) { | ||
@@ -847,2 +848,1 @@ if (!Array.isArray(d)) { | ||
} | ||
exports.assertDataListIfAny = assertDataListIfAny; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.scan = exports.Literal = exports.ScanError = void 0; | ||
exports.Literal = exports.ScanError = void 0; | ||
exports.scan = scan; | ||
const core_1 = require("@taquito/core"); | ||
@@ -128,2 +129,1 @@ /** | ||
} | ||
exports.scan = scan; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hexBytes = exports.parseHex = exports.parseDate = exports.isPairData = exports.isPairType = exports.unpackComb = exports.encodeTezosID = exports.checkDecodeTezosID = exports.tezosPrefix = exports.unpackAnnotations = exports.isNatural = exports.isDecimal = exports.compareBytes = exports.parseBytes = exports.LongInteger = exports.MichelsonTypeError = exports.isMichelsonError = exports.MichelsonError = void 0; | ||
exports.tezosPrefix = exports.LongInteger = exports.MichelsonTypeError = exports.MichelsonError = void 0; | ||
exports.isMichelsonError = isMichelsonError; | ||
exports.parseBytes = parseBytes; | ||
exports.compareBytes = compareBytes; | ||
exports.isDecimal = isDecimal; | ||
exports.isNatural = isNatural; | ||
exports.unpackAnnotations = unpackAnnotations; | ||
exports.checkDecodeTezosID = checkDecodeTezosID; | ||
exports.encodeTezosID = encodeTezosID; | ||
exports.unpackComb = unpackComb; | ||
exports.isPairType = isPairType; | ||
exports.isPairData = isPairData; | ||
exports.parseDate = parseDate; | ||
exports.parseHex = parseHex; | ||
exports.hexBytes = hexBytes; | ||
const base58_1 = require("./base58"); | ||
@@ -28,3 +42,2 @@ const errors_1 = require("./errors"); | ||
} | ||
exports.isMichelsonError = isMichelsonError; | ||
class MichelsonTypeError extends MichelsonError { | ||
@@ -120,3 +133,2 @@ /** | ||
} | ||
exports.parseBytes = parseBytes; | ||
function compareBytes(a, b) { | ||
@@ -137,3 +149,2 @@ if (a.length !== b.length) { | ||
} | ||
exports.compareBytes = compareBytes; | ||
function isDecimal(x) { | ||
@@ -148,3 +159,2 @@ try { | ||
} | ||
exports.isDecimal = isDecimal; | ||
function isNatural(x) { | ||
@@ -158,3 +168,2 @@ try { | ||
} | ||
exports.isNatural = isNatural; | ||
const annRe = /^(@%|@%%|%@|[@:%]([_0-9a-zA-Z][_0-9a-zA-Z.%@]*)?)$/; | ||
@@ -201,31 +210,30 @@ function unpackAnnotations(p, opt) { | ||
} | ||
exports.unpackAnnotations = unpackAnnotations; | ||
exports.tezosPrefix = { | ||
BlockHash: [32, [1, 52]], | ||
OperationHash: [32, [5, 116]], | ||
OperationListHash: [32, [133, 233]], | ||
OperationListListHash: [32, [29, 159, 109]], | ||
ProtocolHash: [32, [2, 170]], | ||
ContextHash: [32, [79, 199]], | ||
ED25519PublicKeyHash: [20, [6, 161, 159]], | ||
SECP256K1PublicKeyHash: [20, [6, 161, 161]], | ||
P256PublicKeyHash: [20, [6, 161, 164]], | ||
ContractHash: [20, [2, 90, 121]], | ||
CryptoboxPublicKeyHash: [16, [153, 103]], | ||
ED25519Seed: [32, [13, 15, 58, 7]], | ||
ED25519PublicKey: [32, [13, 15, 37, 217]], | ||
SECP256K1SecretKey: [32, [17, 162, 224, 201]], | ||
P256SecretKey: [32, [16, 81, 238, 189]], | ||
ED25519EncryptedSeed: [56, [7, 90, 60, 179, 41]], | ||
SECP256K1EncryptedSecretKey: [56, [9, 237, 241, 174, 150]], | ||
P256EncryptedSecretKey: [56, [9, 48, 57, 115, 171]], | ||
SECP256K1PublicKey: [33, [3, 254, 226, 86]], | ||
P256PublicKey: [33, [3, 178, 139, 127]], | ||
SECP256K1Scalar: [33, [38, 248, 136]], | ||
SECP256K1Element: [33, [5, 92, 0]], | ||
ED25519SecretKey: [64, [43, 246, 78, 7]], | ||
ED25519Signature: [64, [9, 245, 205, 134, 18]], | ||
SECP256K1Signature: [64, [13, 115, 101, 19, 63]], | ||
P256Signature: [64, [54, 240, 44, 52]], | ||
GenericSignature: [64, [4, 130, 43]], | ||
BlockHash: [32, [1, 52]], // B(51) | ||
OperationHash: [32, [5, 116]], // o(51) | ||
OperationListHash: [32, [133, 233]], // Lo(52) | ||
OperationListListHash: [32, [29, 159, 109]], // LLo(53) | ||
ProtocolHash: [32, [2, 170]], // P(51) | ||
ContextHash: [32, [79, 199]], // Co(52) | ||
ED25519PublicKeyHash: [20, [6, 161, 159]], // tz1(36) | ||
SECP256K1PublicKeyHash: [20, [6, 161, 161]], // tz2(36) | ||
P256PublicKeyHash: [20, [6, 161, 164]], // tz3(36) | ||
ContractHash: [20, [2, 90, 121]], // KT1(36) | ||
CryptoboxPublicKeyHash: [16, [153, 103]], // id(30) | ||
ED25519Seed: [32, [13, 15, 58, 7]], // edsk(54) | ||
ED25519PublicKey: [32, [13, 15, 37, 217]], // edpk(54) | ||
SECP256K1SecretKey: [32, [17, 162, 224, 201]], // spsk(54) | ||
P256SecretKey: [32, [16, 81, 238, 189]], // p2sk(54) | ||
ED25519EncryptedSeed: [56, [7, 90, 60, 179, 41]], // edesk(88) | ||
SECP256K1EncryptedSecretKey: [56, [9, 237, 241, 174, 150]], // spesk(88) | ||
P256EncryptedSecretKey: [56, [9, 48, 57, 115, 171]], // p2esk(88) | ||
SECP256K1PublicKey: [33, [3, 254, 226, 86]], // sppk(55) | ||
P256PublicKey: [33, [3, 178, 139, 127]], // p2pk(55) | ||
SECP256K1Scalar: [33, [38, 248, 136]], // SSp(53) | ||
SECP256K1Element: [33, [5, 92, 0]], // GSp(54) | ||
ED25519SecretKey: [64, [43, 246, 78, 7]], // edsk(98) | ||
ED25519Signature: [64, [9, 245, 205, 134, 18]], // edsig(99) | ||
SECP256K1Signature: [64, [13, 115, 101, 19, 63]], // spsig1(99) | ||
P256Signature: [64, [54, 240, 44, 52]], // p2sig(98) | ||
GenericSignature: [64, [4, 130, 43]], // sig(96) | ||
ChainID: [4, [87, 82, 0]], | ||
@@ -250,3 +258,2 @@ RollupAddress: [20, [1, 128, 120, 31]], | ||
} | ||
exports.checkDecodeTezosID = checkDecodeTezosID; | ||
function encodeTezosID(id, data) { | ||
@@ -259,3 +266,2 @@ const [plen, p] = exports.tezosPrefix[id]; | ||
} | ||
exports.encodeTezosID = encodeTezosID; | ||
function unpackComb(id, v) { | ||
@@ -285,11 +291,8 @@ const vv = v; | ||
} | ||
exports.unpackComb = unpackComb; | ||
function isPairType(t) { | ||
return Array.isArray(t) || t.prim === 'pair'; | ||
} | ||
exports.isPairType = isPairType; | ||
function isPairData(d) { | ||
return Array.isArray(d) || ('prim' in d && d.prim === 'Pair'); | ||
} | ||
exports.isPairData = isPairData; | ||
const rfc3339Re = /^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])[T ]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):([0-5][0-9]))$/; | ||
@@ -313,3 +316,2 @@ function parseDate(a) { | ||
} | ||
exports.parseDate = parseDate; | ||
function parseHex(s) { | ||
@@ -327,6 +329,4 @@ const res = []; | ||
} | ||
exports.parseHex = parseHex; | ||
function hexBytes(bytes) { | ||
return bytes.map((x) => ((x >> 4) & 0xf).toString(16) + (x & 0xf).toString(16)).join(''); | ||
} | ||
exports.hexBytes = hexBytes; |
@@ -6,4 +6,4 @@ "use strict"; | ||
exports.VERSION = { | ||
"commitHash": "a9cdc31ccbc6e2ed58dedaf3c8c4f0c62bc3ae02", | ||
"version": "20.0.2-beta.1" | ||
"commitHash": "943d5fd11790da35f4a3e6ecfcaae3c4f0399a97", | ||
"version": "20.0.2-beta.2" | ||
}; |
{ | ||
"name": "@taquito/michel-codec", | ||
"version": "20.0.2-beta.1", | ||
"version": "20.0.2-beta.2", | ||
"description": "Michelson parser/validator/formatter", | ||
@@ -69,27 +69,27 @@ "keywords": [ | ||
"dependencies": { | ||
"@taquito/core": "^20.0.2-beta.1" | ||
"@taquito/core": "^20.0.2-beta.2" | ||
}, | ||
"devDependencies": { | ||
"@types/bluebird": "^3.5.40", | ||
"@types/jest": "^29.5.5", | ||
"@types/node": "^20", | ||
"@typescript-eslint/eslint-plugin": "^6.8.0", | ||
"@typescript-eslint/parser": "^6.8.0", | ||
"eslint": "^8.51.0", | ||
"@types/bluebird": "^3.5.42", | ||
"@types/jest": "^29.5.12", | ||
"@types/node": "^22", | ||
"@typescript-eslint/eslint-plugin": "^6.21.0", | ||
"@typescript-eslint/parser": "^6.21.0", | ||
"eslint": "^8.57.0", | ||
"jest": "^29.7.0", | ||
"jest-config": "^29.7.0", | ||
"jest-extended": "^4.0.2", | ||
"lint-staged": "^14.0.1", | ||
"lint-staged": "^15.2.7", | ||
"lodash.camelcase": "^4.3.0", | ||
"prettier": "^3.0.3", | ||
"rimraf": "^5.0.5", | ||
"rollup": "^4.1.4", | ||
"prettier": "^3.3.3", | ||
"rimraf": "^6.0.1", | ||
"rollup": "^4.19.1", | ||
"rollup-plugin-json": "^4.0.0", | ||
"rollup-plugin-typescript2": "^0.36.0", | ||
"ts-jest": "^29.1.1", | ||
"ts-node": "^10.9.1", | ||
"ts-jest": "^29.2.3", | ||
"ts-node": "^10.9.2", | ||
"ts-toolbelt": "^9.6.0", | ||
"typescript": "~5.2.2" | ||
"typescript": "~5.5.4" | ||
}, | ||
"gitHead": "6d1e4d129ac57c1bdeb5464601e40c50f413e43f" | ||
"gitHead": "f0f9e4d22a374c72913abbb1991b0e5b34f4c978" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
742431
42
18698
Updated@taquito/core@^20.0.2-beta.2