Socket
Socket
Sign inDemoInstall

@taquito/michelson-encoder

Package Overview
Dependencies
Maintainers
3
Versions
199
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@taquito/michelson-encoder - npm Package Compare versions

Comparing version 12.1.0 to 12.1.1

6

dist/lib/schema/parameter.js

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

}
EncodeObject(_value) {
EncodeObject(value, semantics) {
try {
return this.root.EncodeObject(_value);
return this.root.EncodeObject(value, semantics);
}

@@ -61,3 +61,3 @@ catch (ex) {

}
throw new error_1.ParameterEncodingError('Unable to encode parameter object', _value, ex);
throw new error_1.ParameterEncodingError('Unable to encode parameter object', value, ex);
}

@@ -64,0 +64,0 @@ }

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

}
Encode(_value) {
Encode(value, semantics) {
try {
return this.root.EncodeObject(_value);
return this.root.EncodeObject(value, semantics);
}

@@ -138,0 +138,0 @@ catch (ex) {

@@ -74,3 +74,3 @@ "use strict";

}
EncodeObject(args) {
EncodeObject(args, semantic) {
const val = args;

@@ -81,2 +81,5 @@ const err = this.isValid(val);

}
if (semantic && semantic[BigMapToken.prim]) {
return semantic[BigMapToken.prim](val, this.val);
}
return Array.from(val.keys())

@@ -83,0 +86,0 @@ .sort((a, b) => this.KeySchema.compare(a, b))

@@ -46,3 +46,6 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
if (semantic && semantic[Bls12381frToken.prim]) {
return semantic[Bls12381frToken.prim](val);
}
if (typeof val === 'number') {

@@ -49,0 +52,0 @@ return { int: val.toString() };

@@ -41,3 +41,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
val = this.convertUint8ArrayToHexString(val);

@@ -48,2 +48,5 @@ const err = this.isValid(val);

}
if (semantic && semantic[Bls12381g1Token.prim]) {
return semantic[Bls12381g1Token.prim](val);
}
return { bytes: val };

@@ -50,0 +53,0 @@ }

@@ -41,3 +41,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
val = this.convertUint8ArrayToHexString(val);

@@ -48,2 +48,5 @@ const err = this.isValid(val);

}
if (semantic && semantic[Bls12381g2Token.prim]) {
return semantic[Bls12381g2Token.prim](val);
}
return { bytes: val };

@@ -50,0 +53,0 @@ }

@@ -52,3 +52,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
const err = this.isValid(val);

@@ -58,2 +58,5 @@ if (err) {

}
if (semantic && semantic[ChainIDToken.prim]) {
return semantic[ChainIDToken.prim](val);
}
return { string: val };

@@ -60,0 +63,0 @@ }

@@ -41,3 +41,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
val = this.convertUint8ArrayToHexString(val);

@@ -48,2 +48,5 @@ const err = this.isValid(val);

}
if (semantic && semantic[ChestKeyToken.prim]) {
return semantic[ChestKeyToken.prim](val);
}
return { bytes: val };

@@ -50,0 +53,0 @@ }

@@ -41,3 +41,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
val = this.convertUint8ArrayToHexString(val);

@@ -48,2 +48,5 @@ const err = this.isValid(val);

}
if (semantic && semantic[ChestToken.prim]) {
return semantic[ChestToken.prim](val);
}
return { bytes: val };

@@ -50,0 +53,0 @@ }

@@ -43,3 +43,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
const err = this.isValid(val);

@@ -49,2 +49,5 @@ if (err) {

}
if (semantic && semantic[AddressToken.prim]) {
return semantic[AddressToken.prim](val);
}
return { string: val };

@@ -51,0 +54,0 @@ }

@@ -19,3 +19,6 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
if (semantic && semantic[BoolToken.prim]) {
return semantic[BoolToken.prim](val);
}
return { prim: val ? 'True' : 'False' };

@@ -22,0 +25,0 @@ }

@@ -47,3 +47,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
val = this.convertUint8ArrayToHexString(val);

@@ -54,2 +54,5 @@ const err = this.isValid(val);

}
if (semantic && semantic[BytesToken.prim]) {
return semantic[BytesToken.prim](val);
}
return { bytes: String(val).toString() };

@@ -56,0 +59,0 @@ }

@@ -55,3 +55,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
const err = this.isValid(val);

@@ -61,2 +61,5 @@ if (err) {

}
if (semantic && semantic[IntToken.prim]) {
return semantic[IntToken.prim](val);
}
return { int: new bignumber_js_1.default(val).toFixed() };

@@ -63,0 +66,0 @@ }

@@ -42,3 +42,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
const err = this.isValid(val);

@@ -48,2 +48,5 @@ if (err) {

}
if (semantic && semantic[KeyHashToken.prim]) {
return semantic[KeyHashToken.prim](val);
}
return { string: val };

@@ -50,0 +53,0 @@ }

@@ -55,3 +55,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
const err = this.isValid(val);

@@ -61,2 +61,5 @@ if (err) {

}
if (semantic && semantic[MutezToken.prim]) {
return semantic[MutezToken.prim](val);
}
return { int: String(val).toString() };

@@ -63,0 +66,0 @@ }

@@ -45,3 +45,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
const err = this.isValid(val);

@@ -51,2 +51,5 @@ if (err) {

}
if (semantic && semantic[NatToken.prim]) {
return semantic[NatToken.prim](val);
}
return { int: new bignumber_js_1.default(val).toFixed() };

@@ -53,0 +56,0 @@ }

@@ -32,3 +32,6 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
if (semantic && semantic[StringToken.prim]) {
return semantic[StringToken.prim](val);
}
return { string: val };

@@ -35,0 +38,0 @@ }

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

}
EncodeObject(val) {
EncodeObject(val, semantic) {
if (semantic && semantic[TimestampToken.prim]) {
return semantic[TimestampToken.prim](val);
}
return { string: val };

@@ -30,0 +33,0 @@ }

@@ -41,3 +41,6 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
if (semantic && semantic[GlobalConstantToken.prim]) {
return semantic[GlobalConstantToken.prim](val);
}
throw new GlobalConstantEncodingError(val, this, `Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0]['string']}.`);

@@ -44,0 +47,0 @@ }

@@ -43,3 +43,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
const err = this.isValid(val);

@@ -49,2 +49,5 @@ if (err) {

}
if (semantic && semantic[ContractToken.prim]) {
return semantic[ContractToken.prim](val);
}
return { string: val };

@@ -51,0 +54,0 @@ }

@@ -43,3 +43,3 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
const err = this.isValid(val);

@@ -49,2 +49,5 @@ if (err) {

}
if (semantic && semantic[KeyToken.prim]) {
return semantic[KeyToken.prim](val);
}
return { string: val };

@@ -51,0 +54,0 @@ }

@@ -30,3 +30,6 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
if (semantic && semantic[LambdaToken.prim]) {
return semantic[LambdaToken.prim](val);
}
return val;

@@ -33,0 +36,0 @@ }

@@ -51,3 +51,3 @@ "use strict";

}
EncodeObject(args) {
EncodeObject(args, semantic) {
const schema = this.createToken(this.val.args[0], 0);

@@ -58,2 +58,5 @@ const err = this.isValid(args);

}
if (semantic && semantic[ListToken.prim]) {
return semantic[ListToken.prim](args);
}
return args.reduce((prev, current) => {

@@ -60,0 +63,0 @@ return [...prev, schema.EncodeObject(current)];

@@ -56,3 +56,3 @@ "use strict";

}
EncodeObject(args) {
EncodeObject(args, semantic) {
const val = args;

@@ -63,2 +63,5 @@ const err = this.isValid(val);

}
if (semantic && semantic[MapToken.prim]) {
return semantic[MapToken.prim](val);
}
return Array.from(val.keys())

@@ -65,0 +68,0 @@ .sort((a, b) => this.KeySchema.compare(a, b))

@@ -25,3 +25,6 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
if (semantic && semantic[NeverToken.prim]) {
return semantic[NeverToken.prim](val);
}
throw new NeverTokenError(val, this, 'Assigning a value to the type never is forbidden.');

@@ -28,0 +31,0 @@ }

@@ -19,3 +19,6 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
if (semantic && semantic[OperationToken.prim]) {
return semantic[OperationToken.prim](val);
}
return { string: val };

@@ -22,0 +25,0 @@ }

@@ -35,3 +35,3 @@ "use strict";

}
EncodeObject(args) {
EncodeObject(args, semantic) {
const value = args;

@@ -41,3 +41,3 @@ if (value === undefined || value === null) {

}
return { prim: 'Some', args: [this.schema().EncodeObject(value)] };
return { prim: 'Some', args: [this.schema().EncodeObject(value, semantic)] };
}

@@ -44,0 +44,0 @@ Execute(val, semantics) {

@@ -82,3 +82,3 @@ "use strict";

}
EncodeObject(args) {
EncodeObject(args, semantic) {
const label = Object.keys(args)[0];

@@ -92,10 +92,10 @@ const leftToken = this.createToken(this.val.args[0], this.idx);

if (String(leftToken.annot()) === String(label) && !(leftToken instanceof OrToken)) {
return { prim: 'Left', args: [leftToken.EncodeObject(args[label])] };
return { prim: 'Left', args: [leftToken.EncodeObject(args[label], semantic)] };
}
else if (String(rightToken.annot()) === String(label) && !(rightToken instanceof OrToken)) {
return { prim: 'Right', args: [rightToken.EncodeObject(args[label])] };
return { prim: 'Right', args: [rightToken.EncodeObject(args[label], semantic)] };
}
else {
if (leftToken instanceof OrToken) {
const val = leftToken.EncodeObject(args);
const val = leftToken.EncodeObject(args, semantic);
if (val) {

@@ -106,3 +106,3 @@ return { prim: 'Left', args: [val] };

if (rightToken instanceof OrToken) {
const val = rightToken.EncodeObject(args);
const val = rightToken.EncodeObject(args, semantic);
if (val) {

@@ -109,0 +109,0 @@ return { prim: 'Right', args: [val] };

@@ -110,3 +110,3 @@ "use strict";

}
EncodeObject(args) {
EncodeObject(args, semantic) {
const [leftToken, rightToken] = this.tokens();

@@ -129,3 +129,6 @@ let leftValue;

prim: 'Pair',
args: [leftToken.EncodeObject(leftValue), rightToken.EncodeObject(rightValue)],
args: [
leftToken.EncodeObject(leftValue, semantic),
rightToken.EncodeObject(rightValue, semantic),
],
};

@@ -132,0 +135,0 @@ }

@@ -44,3 +44,6 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
if (semantic && semantic[SaplingStateToken.prim]) {
return semantic[SaplingStateToken.prim](val);
}
if (this.isValid(val)) {

@@ -47,0 +50,0 @@ return [];

@@ -41,4 +41,7 @@ "use strict";

}
EncodeObject(val) {
EncodeObject(val, semantic) {
val = this.validateBytes(this.convertUint8ArrayToHexString(val));
if (semantic && semantic[SaplingTransactionToken.prim]) {
return semantic[SaplingTransactionToken.prim](val);
}
return { bytes: String(val).toString() };

@@ -45,0 +48,0 @@ }

@@ -47,3 +47,3 @@ "use strict";

}
EncodeObject(args) {
EncodeObject(args, semantic) {
const err = this.isValid(args);

@@ -53,2 +53,5 @@ if (err) {

}
if (semantic && semantic[SetToken.prim]) {
return semantic[SetToken.prim](args);
}
return args

@@ -55,0 +58,0 @@ .sort((a, b) => this.KeySchema.compare(a, b))

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

Execute(val) {
return val.string;
if (val.string) {
return val.string;
}
// TODO decode the signature
return val.bytes;
}

@@ -40,3 +44,3 @@ isValid(value) {

}
EncodeObject(val) {
EncodeObject(val, semantic) {
const err = this.isValid(val);

@@ -46,2 +50,5 @@ if (err) {

}
if (semantic && semantic[SignatureToken.prim]) {
return semantic[SignatureToken.prim](val);
}
return { string: val };

@@ -48,0 +55,0 @@ }

@@ -33,3 +33,6 @@ "use strict";

}
EncodeObject(_args) {
EncodeObject(args, semantic) {
if (semantic && semantic[TicketToken.prim]) {
return semantic[TicketToken.prim](args, this.val);
}
throw new EncodeTicketError();

@@ -36,0 +39,0 @@ }

@@ -17,3 +17,6 @@ "use strict";

}
EncodeObject(_val) {
EncodeObject(val, semantic) {
if (semantic && semantic[UnitToken.prim]) {
return semantic[UnitToken.prim](val);
}
return { prim: 'Unit' };

@@ -20,0 +23,0 @@ }

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

exports.VERSION = {
"commitHash": "cbdd0af87e400489076259d065e2d328feb8e1b4",
"version": "12.1.0"
"commitHash": "38da814ec2bb4e81c7ad5a45b6b183a4d0b8dc25",
"version": "12.1.1"
};
//# sourceMappingURL=version.js.map

@@ -1,2 +0,2 @@

import { Semantic } from '../tokens/token';
import { Semantic, SemanticEncoding } from '../tokens/token';
import { ScriptResponse, MichelsonV1Expression } from '@taquito/rpc';

@@ -17,3 +17,3 @@ import { TokenSchema } from './types';

Encode(...args: any[]): any;
EncodeObject(_value?: any): any;
EncodeObject(value?: any, semantics?: SemanticEncoding): any;
/**

@@ -20,0 +20,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

import { MichelsonV1Expression, ScriptResponse } from '@taquito/rpc';
import { BigMapKeyType, Semantic, Token } from '../tokens/token';
import { BigMapKeyType, Semantic, SemanticEncoding, Token } from '../tokens/token';
import { RpcTransaction } from './model';

@@ -34,3 +34,3 @@ import { TokenSchema } from './types';

};
Encode(_value?: any): any;
Encode(value?: any, semantics?: SemanticEncoding): any;
/**

@@ -37,0 +37,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

@@ -10,3 +10,3 @@ /**

export * from './schema/types';
export { Semantic, BigMapKeyType } from './tokens/token';
export { Semantic, SemanticEncoding, BigMapKeyType } from './tokens/token';
export * from './errors';

@@ -13,0 +13,0 @@ export declare const UnitValue: unique symbol;

import { BigMapTokenSchema } from '../schema/types';
import { ComparableToken, Semantic, Token, TokenFactory, TokenValidationError } from './token';
import { ComparableToken, Semantic, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
/**

@@ -42,3 +42,3 @@ * @category Error

Encode(args: any[]): any;
EncodeObject(args: any): any;
EncodeObject(args: any, semantic?: SemanticEncoding): any;
Execute(val: any[] | {

@@ -45,0 +45,0 @@ int: string;

import { BaseTokenSchema } from '../schema/types';
import { Token, TokenFactory, TokenValidationError } from './token';
import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
export declare class Bls12381frValidationError extends TokenValidationError {

@@ -32,8 +32,4 @@ value: any;

};
EncodeObject(val: string | Uint8Array | number): {
int: string;
bytes?: undefined;
} | {
EncodeObject(val: string | Uint8Array | number, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1ExpressionBase | import("@taquito/rpc").MichelsonV1ExpressionExtended | import("@taquito/rpc").MichelsonV1Expression[] | {
bytes: string | number | Uint8Array;
int?: undefined;
};

@@ -40,0 +36,0 @@ Execute(val: any): string;

import { BaseTokenSchema } from '../schema/types';
import { Token, TokenFactory, TokenValidationError } from './token';
import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
export declare class Bls12381g1ValidationError extends TokenValidationError {

@@ -28,3 +28,3 @@ value: any;

};
EncodeObject(val: string | Uint8Array): {
EncodeObject(val: string | Uint8Array, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1ExpressionBase | import("@taquito/rpc").MichelsonV1ExpressionExtended | import("@taquito/rpc").MichelsonV1Expression[] | {
bytes: string | Uint8Array;

@@ -31,0 +31,0 @@ };

import { BaseTokenSchema } from '../schema/types';
import { Token, TokenFactory, TokenValidationError } from './token';
import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
export declare class Bls12381g2ValidationError extends TokenValidationError {

@@ -28,3 +28,3 @@ value: any;

};
EncodeObject(val: string | Uint8Array): {
EncodeObject(val: string | Uint8Array, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1ExpressionBase | import("@taquito/rpc").MichelsonV1ExpressionExtended | import("@taquito/rpc").MichelsonV1Expression[] | {
bytes: string | Uint8Array;

@@ -31,0 +31,0 @@ };

@@ -1,2 +0,2 @@

import { Token, TokenFactory, ComparableToken, TokenValidationError } from './token';
import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from './token';
import { BaseTokenSchema } from '../schema/types';

@@ -32,3 +32,3 @@ export declare class ChainIDValidationError extends TokenValidationError {

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
ToKey({ string }: any): any;

@@ -35,0 +35,0 @@ ToBigMapKey(val: string): {

import { BaseTokenSchema } from '../schema/types';
import { Token, TokenFactory, TokenValidationError } from './token';
import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
export declare class ChestKeyValidationError extends TokenValidationError {

@@ -28,3 +28,3 @@ value: any;

};
EncodeObject(val: string | Uint8Array): {
EncodeObject(val: string | Uint8Array, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1ExpressionBase | import("@taquito/rpc").MichelsonV1ExpressionExtended | import("@taquito/rpc").MichelsonV1Expression[] | {
bytes: string | Uint8Array;

@@ -31,0 +31,0 @@ };

import { BaseTokenSchema } from '../schema/types';
import { Token, TokenFactory, TokenValidationError } from './token';
import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
export declare class ChestValidationError extends TokenValidationError {

@@ -28,3 +28,3 @@ value: any;

};
EncodeObject(val: string | Uint8Array): {
EncodeObject(val: string | Uint8Array, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1ExpressionBase | import("@taquito/rpc").MichelsonV1ExpressionExtended | import("@taquito/rpc").MichelsonV1Expression[] | {
bytes: string | Uint8Array;

@@ -31,0 +31,0 @@ };

@@ -1,2 +0,2 @@

import { Token, TokenFactory, ComparableToken, TokenValidationError } from '../token';
import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from '../token';
import { BaseTokenSchema } from '../../schema/types';

@@ -33,3 +33,3 @@ export declare class AddressValidationError extends TokenValidationError {

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
Execute(val: {

@@ -36,0 +36,0 @@ bytes: string;

import { BaseTokenSchema } from '../../schema/types';
import { Token, TokenFactory, ComparableToken } from '../token';
import { Token, TokenFactory, ComparableToken, SemanticEncoding } from '../token';
export declare class BoolToken extends ComparableToken {

@@ -19,5 +19,3 @@ protected val: {

Encode(args: any[]): any;
EncodeObject(val: any): {
prim: string;
};
EncodeObject(val: any, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1Expression;
/**

@@ -37,7 +35,5 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

};
ToKey(val: string): {
prim: string;
};
ToKey(val: string): import("@taquito/rpc").MichelsonV1Expression;
compare(val1: any, val2: any): 0 | 1 | -1;
findAndReturnTokens(tokenToFind: string, tokens: Token[]): Token[];
}
import { BaseTokenSchema } from '../../schema/types';
import { TokenFactory, ComparableToken, TokenValidationError, Token } from '../token';
import { TokenFactory, ComparableToken, TokenValidationError, Token, SemanticEncoding } from '../token';
export declare class BytesValidationError extends TokenValidationError {

@@ -34,5 +34,3 @@ value: any;

Encode(args: any[]): any;
EncodeObject(val: string | Uint8Array): {
bytes: string;
};
EncodeObject(val: string | Uint8Array, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1Expression;
Execute(val: any): string;

@@ -39,0 +37,0 @@ /**

@@ -1,2 +0,2 @@

import { Token, TokenFactory, ComparableToken, TokenValidationError } from '../token';
import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from '../token';
import { BaseTokenSchema } from '../../schema/types';

@@ -36,3 +36,3 @@ export declare class IntValidationError extends TokenValidationError {

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
ToBigMapKey(val: string | number): {

@@ -39,0 +39,0 @@ key: {

@@ -1,2 +0,2 @@

import { Token, TokenFactory, ComparableToken, TokenValidationError } from '../token';
import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from '../token';
import { BaseTokenSchema } from '../../schema/types';

@@ -29,3 +29,3 @@ export declare class KeyHashValidationError extends TokenValidationError {

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
/**

@@ -32,0 +32,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

@@ -1,2 +0,2 @@

import { Token, TokenFactory, ComparableToken, TokenValidationError } from '../token';
import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from '../token';
import BigNumber from 'bignumber.js';

@@ -33,3 +33,3 @@ import { BaseTokenSchema } from '../../schema/types';

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
ToBigMapKey(val: string | number): {

@@ -36,0 +36,0 @@ key: {

@@ -1,2 +0,2 @@

import { Token, TokenFactory, ComparableToken, TokenValidationError } from '../token';
import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from '../token';
import BigNumber from 'bignumber.js';

@@ -29,3 +29,3 @@ import { BaseTokenSchema } from '../../schema/types';

private isValid;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
/**

@@ -32,0 +32,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

import { BaseTokenSchema } from '../../schema/types';
import { Token, TokenFactory, ComparableToken } from '../token';
import { Token, TokenFactory, ComparableToken, SemanticEncoding } from '../token';
export declare class StringToken extends ComparableToken {

@@ -25,3 +25,3 @@ protected val: {

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
ToKey({ string }: any): any;

@@ -28,0 +28,0 @@ ToBigMapKey(val: string): {

import { BaseTokenSchema } from '../../schema/types';
import { Token, TokenFactory, ComparableToken } from '../token';
import { Token, TokenFactory, ComparableToken, SemanticEncoding } from '../token';
export declare class TimestampToken extends ComparableToken {

@@ -22,3 +22,3 @@ protected val: {

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
/**

@@ -25,0 +25,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

import { ConstantTokenSchema } from '../schema/types';
import { Semantic, Token, TokenFactory, TokenValidationError } from './token';
import { Semantic, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
export declare class GlobalConstantEncodingError extends TokenValidationError {

@@ -31,3 +31,3 @@ value: any;

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
/**

@@ -34,0 +34,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

import { ContractTokenSchema } from '../schema/types';
import { Token, TokenFactory, TokenValidationError } from './token';
import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
export declare class ContractValidationError extends TokenValidationError {

@@ -29,3 +29,3 @@ value: any;

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
/**

@@ -32,0 +32,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

@@ -1,2 +0,2 @@

import { ComparableToken, Token, TokenFactory, TokenValidationError } from './token';
import { ComparableToken, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
import { BaseTokenSchema } from '../schema/types';

@@ -29,3 +29,3 @@ export declare class KeyValidationError extends TokenValidationError {

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
/**

@@ -32,0 +32,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

import { LambdaTokenSchema } from '../schema/types';
import { Token, TokenFactory } from './token';
import { SemanticEncoding, Token, TokenFactory } from './token';
export declare class LambdaToken extends Token {

@@ -21,3 +21,3 @@ protected val: {

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
/**

@@ -24,0 +24,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

import { ListTokenSchema } from '../schema/types';
import { Token, TokenFactory, Semantic, TokenValidationError } from './token';
import { Token, TokenFactory, Semantic, TokenValidationError, SemanticEncoding } from './token';
export declare class ListValidationError extends TokenValidationError {

@@ -27,3 +27,3 @@ value: any;

Execute(val: any, semantics?: Semantic): any;
EncodeObject(args: any): any;
EncodeObject(args: any, semantic?: SemanticEncoding): any;
/**

@@ -30,0 +30,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

import { MapTokenSchema } from '../schema/types';
import { ComparableToken, Semantic, Token, TokenFactory, TokenValidationError } from './token';
import { ComparableToken, Semantic, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
export declare class MapValidationError extends TokenValidationError {

@@ -30,3 +30,3 @@ value: any;

Encode(args: any[]): any;
EncodeObject(args: any): any;
EncodeObject(args: any, semantic?: SemanticEncoding): any;
/**

@@ -33,0 +33,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

import { BaseTokenSchema } from '../schema/types';
import { Token, TokenFactory, TokenValidationError } from './token';
import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
export declare class NeverTokenError extends TokenValidationError {

@@ -24,3 +24,3 @@ value: any;

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
Execute(val: any): void;

@@ -27,0 +27,0 @@ /**

import { BaseTokenSchema } from '../schema/types';
import { Token, TokenFactory } from './token';
import { SemanticEncoding, Token, TokenFactory } from './token';
export declare class OperationToken extends Token {

@@ -21,3 +21,3 @@ protected val: {

Encode(...args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
/**

@@ -24,0 +24,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

import { OptionTokenSchema } from '../schema/types';
import { Token, TokenFactory, Semantic, ComparableToken } from './token';
import { Token, TokenFactory, Semantic, ComparableToken, SemanticEncoding } from './token';
export declare class OptionToken extends ComparableToken {

@@ -21,3 +21,3 @@ protected val: {

Encode(args: any): any;
EncodeObject(args: any): any;
EncodeObject(args: any, semantic?: SemanticEncoding): any;
Execute(val: any, semantics?: Semantic): any;

@@ -24,0 +24,0 @@ /**

import { OrTokenSchema } from '../schema/types';
import { Token, TokenFactory, Semantic, ComparableToken } from './token';
import { Token, TokenFactory, Semantic, ComparableToken, SemanticEncoding } from './token';
/**

@@ -28,3 +28,3 @@ * @category Error

ExtractSignature(): any;
EncodeObject(args: any): any;
EncodeObject(args: any, semantic?: SemanticEncoding): any;
Execute(val: any, semantics?: Semantic): any;

@@ -31,0 +31,0 @@ private traversal;

@@ -1,2 +0,2 @@

import { Token, TokenFactory, Semantic, ComparableToken } from './token';
import { Token, TokenFactory, Semantic, ComparableToken, SemanticEncoding } from './token';
import { PairTokenSchema } from '../schema/types';

@@ -43,3 +43,3 @@ /**

};
EncodeObject(args: any): any;
EncodeObject(args: any, semantic?: SemanticEncoding): any;
private traversal;

@@ -46,0 +46,0 @@ Execute(val: any, semantics?: Semantic): {

import { SaplingStateTokenSchema } from '../schema/types';
import { Semantic, Token, TokenFactory, TokenValidationError } from './token';
import { Semantic, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
export declare class SaplingStateValidationError extends TokenValidationError {

@@ -28,3 +28,3 @@ value: any;

Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
/**

@@ -31,0 +31,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

import { SaplingTransactionTokenSchema } from '../schema/types';
import { Token, TokenFactory, TokenValidationError } from './token';
import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
export declare class SaplingTransactionValidationError extends TokenValidationError {

@@ -27,5 +27,3 @@ value: any;

Encode(args: any[]): any;
EncodeObject(val: string | Uint8Array): {
bytes: string;
};
EncodeObject(val: string | Uint8Array, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1Expression;
/**

@@ -32,0 +30,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

import { SetTokenSchema } from '../schema/types';
import { Token, TokenFactory, Semantic, TokenValidationError, ComparableToken } from './token';
import { Token, TokenFactory, Semantic, TokenValidationError, ComparableToken, SemanticEncoding } from './token';
export declare class SetValidationError extends TokenValidationError {

@@ -27,3 +27,3 @@ value: any;

Execute(val: any, semantics?: Semantic): any;
EncodeObject(args: any): any;
EncodeObject(args: any, semantic?: SemanticEncoding): any;
/**

@@ -30,0 +30,0 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

@@ -1,2 +0,2 @@

import { ComparableToken, Token, TokenFactory, TokenValidationError } from './token';
import { ComparableToken, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
import { BaseTokenSchema } from '../schema/types';

@@ -23,8 +23,8 @@ export declare class SignatureValidationError extends TokenValidationError {

}, idx: number, fac: TokenFactory);
Execute(val: any): {
[key: string]: any;
};
Execute(val: {
[key: string]: string;
}): string;
private isValid;
Encode(args: any[]): any;
EncodeObject(val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
/**

@@ -36,5 +36,3 @@ * @deprecated ExtractSchema has been deprecated in favor of generateSchema

generateSchema(): BaseTokenSchema;
ToKey(val: any): {
[key: string]: any;
};
ToKey(val: any): string;
ToBigMapKey(val: string): {

@@ -41,0 +39,0 @@ key: {

import { TicketTokenSchema } from '../schema/types';
import { Token, TokenFactory, Semantic } from './token';
import { Token, TokenFactory, Semantic, SemanticEncoding } from './token';
/**

@@ -27,3 +27,3 @@ * @category Error

Encode(_args: any[]): any;
EncodeObject(_args: any): any;
EncodeObject(args: any, semantic?: SemanticEncoding): any;
Execute(val: any, semantics?: Semantic): any;

@@ -30,0 +30,0 @@ /**

@@ -17,2 +17,5 @@ import { MichelsonV1Expression } from '@taquito/rpc';

}
export interface SemanticEncoding {
[key: string]: (value: any, type?: MichelsonV1Expression) => MichelsonV1Expression;
}
export declare abstract class Token {

@@ -51,3 +54,3 @@ protected val: {

abstract Encode(_args: any[]): any;
abstract EncodeObject(args: any): any;
abstract EncodeObject(args: any, semantics?: SemanticEncoding): any;
ExtractSignature(): any[][];

@@ -54,0 +57,0 @@ abstract findAndReturnTokens(tokenToFind: string, tokens: Array<Token>): Array<Token>;

@@ -1,2 +0,2 @@

import { ComparableToken, Token, TokenFactory } from './token';
import { ComparableToken, SemanticEncoding, Token, TokenFactory } from './token';
import { BaseTokenSchema } from '../schema/types';

@@ -18,3 +18,3 @@ export declare class UnitToken extends ComparableToken {

Encode(args: any[]): any;
EncodeObject(_val: any): any;
EncodeObject(val: any, semantic?: SemanticEncoding): any;
Execute(_val: {

@@ -21,0 +21,0 @@ prim: string;

{
"name": "@taquito/michelson-encoder",
"version": "12.1.0",
"version": "12.1.1",
"description": "converts michelson data and types into convenient JS/TS objects",

@@ -71,4 +71,4 @@ "keywords": [

"dependencies": {
"@taquito/rpc": "^12.1.0",
"@taquito/utils": "^12.1.0",
"@taquito/rpc": "^12.1.1",
"@taquito/utils": "^12.1.1",
"bignumber.js": "^9.0.2",

@@ -107,3 +107,3 @@ "fast-json-stable-stringify": "^2.1.0"

},
"gitHead": "8e044472d87e92bfa748e8193ba84a7ee57d659f"
"gitHead": "e97d6f77d990f91b4e407f4e7b7f8f3785edb2ba"
}

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 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 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 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 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 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 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 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