@taquito/michelson-encoder
Version:
converts michelson data and types into convenient JS/TS objects
58 lines (57 loc) • 1.63 kB
TypeScript
import { MapTokenSchema } from '../schema/types';
import { ComparableToken, Semantic, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
/**
* @category Error
* @description Error that indicates a failure happening when parsing encoding/executing a Map
*/
export declare class MapValidationError extends TokenValidationError {
value: any;
token: MapToken;
name: string;
constructor(value: any, token: MapToken, message: string);
}
export declare class MapToken extends Token {
protected val: {
prim: string;
args: any[];
annots: any[];
};
protected idx: number;
protected fac: TokenFactory;
static prim: 'map';
constructor(val: {
prim: string;
args: any[];
annots: any[];
}, idx: number, fac: TokenFactory);
get ValueSchema(): Token;
get KeySchema(): ComparableToken;
/**
* @throws {@link MapValidationError}
*/
validate(value: any): void;
Execute(val: any[], semantics?: Semantic): {
[key: string]: any;
};
private objLitToMichelsonMap;
/**
* @throws {@link MapValidationError}
*/
Encode(args: any[]): any;
/**
* @throws {@link MapValidationError}
*/
EncodeObject(args: any, semantic?: SemanticEncoding): any;
/**
* @deprecated ExtractSchema has been deprecated in favor of generateSchema
*
*/
ExtractSchema(): {
map: {
key: any;
value: any;
};
};
generateSchema(): MapTokenSchema;
findAndReturnTokens(tokenToFind: string, tokens: Token[]): Token[];
}