Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@taquito/michel-codec

Package Overview
Dependencies
Maintainers
3
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@taquito/michel-codec - npm Package Compare versions

Comparing version 12.0.3 to 12.1.0-beta-RC.0

dist/lib/error.js

34

dist/lib/base58.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.encodeBase58Check = exports.decodeBase58Check = exports.encodeBase58 = exports.decodeBase58 = void 0;
exports.encodeBase58Check = exports.decodeBase58Check = exports.encodeBase58 = exports.decodeBase58 = exports.InvalidMessageError = exports.Base58DecodingError = void 0;
const H = [

@@ -80,2 +80,26 @@ 0x6a09e667 | 0,

];
/**
* @category Error
* @description Error that indicates a failure when decoding a base58 encoding
*/
class Base58DecodingError extends Error {
constructor(message) {
super(message);
this.message = message;
this.name = 'Base58DecodingError';
}
}
exports.Base58DecodingError = Base58DecodingError;
/**
* @category Error
* @description
*/
class InvalidMessageError extends Error {
constructor(message) {
super(message);
this.message = message;
this.name = 'InvalidMessageError';
}
}
exports.InvalidMessageError = InvalidMessageError;
// https://tools.ietf.org/html/rfc6234

@@ -87,3 +111,3 @@ function sha256(msg) {

if (msg.length > 268435455) {
throw new Error(`sha256: message length is too big: ${msg.length}`);
throw new InvalidMessageError(`SHA-256 -- message length is too big: ${msg.length}`);
}

@@ -167,3 +191,3 @@ const l = msg.length << 3;

if (c >= base58alphabetFwd.length || base58alphabetFwd[c] === -1) {
throw new Error(`Base58 decoding error: unexpected character at position ${i}: ${src[i]}`);
throw new Base58DecodingError(`Unexpected character at position ${i}: ${src[i]}`);
}

@@ -227,3 +251,3 @@ return base58alphabetFwd[c];

if (buffer.length < 4) {
throw new Error(`Base58Check decoding error: data is too short ${buffer.length}`);
throw new Base58DecodingError(`Data is too short ${buffer.length}`);
}

@@ -237,3 +261,3 @@ const data = buffer.slice(0, buffer.length - 4);

sum[3] !== computed[3]) {
throw new Error('Base58Check decoding error: invalid checksum');
throw new Base58DecodingError('Invalid checksum');
}

@@ -240,0 +264,0 @@ return data;

@@ -5,2 +5,6 @@ "use strict";

const michelson_types_1 = require("./michelson-types");
/**
* @category Error
* @description Indicates that an error has occurred preventing macros from being expanded in a plain Michelson input
*/
class MacroError extends Error {

@@ -7,0 +11,0 @@ constructor(prim, message) {

@@ -8,2 +8,6 @@ "use strict";

const global_constants_1 = require("./global-constants");
/**
* @category Error
* @description Error indicating a failure when parsing Micheline expressions
*/
class MichelineParseError extends Error {

@@ -21,2 +25,6 @@ /**

exports.MichelineParseError = MichelineParseError;
/**
* @category Error
* @description Error that inidicates a failure when parsing Micheline JSON
*/
class JSONParseError extends Error {

@@ -23,0 +31,0 @@ /**

9

dist/lib/michelson-contract.js

@@ -7,2 +7,3 @@ "use strict";

const michelson_validator_1 = require("./michelson-validator");
const error_1 = require("./error");
class Contract {

@@ -18,3 +19,3 @@ constructor(contract, opt) {

if (expr === null) {
throw new Error('empty contract');
throw new error_1.InvalidContractError('empty contract');
}

@@ -30,3 +31,3 @@ if (michelson_validator_1.assertMichelsonContract(expr)) {

if (expr === null) {
throw new Error('empty type expression');
throw new error_1.InvalidTypeExpressionError('empty type expression');
}

@@ -42,3 +43,3 @@ if (michelson_validator_1.assertMichelsonType(expr) && michelson_typecheck_1.assertTypeAnnotationsValid(expr)) {

if (expr === null) {
throw new Error('empty data expression');
throw new error_1.InvalidDataExpressionError('empty data expression');
}

@@ -68,3 +69,3 @@ if (michelson_validator_1.assertMichelsonData(expr)) {

if (t === null) {
throw new Error(`contract has no entrypoint named ${ep}`);
throw new error_1.InvalidEntrypointError(ep === null || ep === void 0 ? void 0 : ep.toString());
}

@@ -71,0 +72,0 @@ this.assertDataValid(d, t);

@@ -27,2 +27,3 @@ "use strict";

Protocol["Psithaca2"] = "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A";
Protocol["PtJakarta"] = "PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw";
Protocol["ProtoALpha"] = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK";

@@ -48,4 +49,5 @@ })(Protocol = exports.Protocol || (exports.Protocol = {}));

PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP: 12,
Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A: 13,
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 14,
Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A: 12,
PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw: 13,
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 13,
};

@@ -52,0 +54,0 @@ function ProtoGreaterOfEqual(a, b) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.scan = exports.Literal = exports.ScanError = void 0;
/**
* @category Error
* @description Error that indicates a failure when performing the scan step when parsing Michelson
*/
class ScanError extends Error {

@@ -5,0 +9,0 @@ constructor(src, idx, message) {

@@ -5,2 +5,7 @@ "use strict";

const base58_1 = require("./base58");
const error_1 = require("./error");
/**
* @category Error
* @description Error that indicates a Michelson failure occurring
*/
class MichelsonError extends Error {

@@ -54,3 +59,3 @@ /**

if (c < 0x30 || c > 0x39) {
throw new Error(`unexpected character in integer constant: ${arg[i]}`);
throw new error_1.LongIntegerError(`unexpected character in integer constant: ${arg[i]}`);
}

@@ -240,3 +245,3 @@ this.append(c - 0x30);

if (data.length !== plen) {
throw new Error(`incorrect data length for ${id}: ${data.length}`);
throw new error_1.TezosIdEncodeError(`Incorrect data length for ${id}: ${data.length}`);
}

@@ -304,3 +309,3 @@ return base58_1.encodeBase58Check([...p, ...data]);

if (Number.isNaN(x)) {
throw new Error(`can't parse hex byte: ${ss}`);
throw new error_1.HexParseError(ss);
}

@@ -307,0 +312,0 @@ res.push(x);

@@ -6,5 +6,5 @@ "use strict";

exports.VERSION = {
"commitHash": "02ebaa8ef1920e8b6a81f0d0978f28cff0a2d256",
"version": "12.0.3"
"commitHash": "e71912611826272f68d2bc1025eb8218417d28af",
"version": "12.1.0-beta-RC.0"
};
//# sourceMappingURL=version.js.map

@@ -0,1 +1,19 @@

/**
* @category Error
* @description Error that indicates a failure when decoding a base58 encoding
*/
export declare class Base58DecodingError extends Error {
message: string;
name: string;
constructor(message: string);
}
/**
* @category Error
* @description
*/
export declare class InvalidMessageError extends Error {
message: string;
name: string;
constructor(message: string);
}
export declare function decodeBase58(src: string): number[];

@@ -2,0 +20,0 @@ export declare function encodeBase58(src: number[] | Uint8Array): string;

import { Prim, Expr } from './micheline';
import { ProtocolOptions } from './michelson-types';
/**
* @category Error
* @description Indicates that an error has occurred preventing macros from being expanded in a plain Michelson input
*/
export declare class MacroError extends Error {

@@ -4,0 +8,0 @@ prim: Prim;

import { Token } from './scan';
import { Expr } from './micheline';
import { ProtocolOptions } from './michelson-types';
/**
* @category Error
* @description Error indicating a failure when parsing Micheline expressions
*/
export declare class MichelineParseError extends Error {

@@ -12,2 +16,6 @@ token: Token | null;

}
/**
* @category Error
* @description Error that inidicates a failure when parsing Micheline JSON
*/
export declare class JSONParseError extends Error {

@@ -14,0 +22,0 @@ node: unknown;

@@ -119,2 +119,3 @@ import { Prim, Expr, IntLiteral, StringLiteral, BytesLiteral, List, Node } from './micheline';

Psithaca2 = "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",
PtJakarta = "PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw",
ProtoALpha = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"

@@ -121,0 +122,0 @@ }

@@ -0,1 +1,5 @@

/**
* @category Error
* @description Error that indicates a failure when performing the scan step when parsing Michelson
*/
export declare class ScanError extends Error {

@@ -2,0 +6,0 @@ src: string;

@@ -14,2 +14,6 @@ import { Prim, Expr, StringLiteral, IntLiteral } from './micheline';

};
/**
* @category Error
* @description Error that indicates a Michelson failure occurring
*/
export declare class MichelsonError<T extends Expr = Expr> extends Error {

@@ -16,0 +20,0 @@ val: T;

{
"name": "@taquito/michel-codec",
"version": "12.0.3",
"version": "12.1.0-beta-RC.0",
"description": "Michelson parser/validator/formatter",

@@ -93,3 +93,3 @@ "keywords": [

},
"gitHead": "b8cd241cd9e19a15c487ab56a149e92ac3713ee9"
"gitHead": "db5a5a1ec2fb4e9881303bf1e178dbe859204695"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc