@taquito/michelson-encoder
Version:
converts michelson data and types into convenient JS/TS objects
63 lines (62 loc) • 1.76 kB
TypeScript
import { ComparableToken, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
import { BaseTokenSchema } from '../schema/types';
/**
* @category Error
* @description Error that indicates a failure happening when parsing encoding/executing a Key
*/
export declare class KeyValidationError extends TokenValidationError {
value: any;
token: KeyToken;
name: string;
constructor(value: any, token: KeyToken, message: string);
}
export declare class KeyToken extends ComparableToken {
protected val: {
prim: string;
args: any[];
annots: any[];
};
protected idx: number;
protected fac: TokenFactory;
static prim: 'key';
constructor(val: {
prim: string;
args: any[];
annots: any[];
}, idx: number, fac: TokenFactory);
Execute(val: {
bytes: string;
string: string;
}): string | undefined;
/**
* @throws {@link KeyValidationError}
*/
private validate;
/**
* @throws {@link KeyValidationError}
*/
Encode(args: any[]): any;
/**
* @throws {@link KeyValidationError}
*/
EncodeObject(val: any, semantic?: SemanticEncoding): any;
/**
* @deprecated ExtractSchema has been deprecated in favor of generateSchema
*
*/
ExtractSchema(): "key";
generateSchema(): BaseTokenSchema;
ToKey(val: any): string | undefined;
ToBigMapKey(val: string): {
key: {
string: string;
};
type: {
prim: "key";
};
};
compare(key1: string, key2: string): number;
private getPrefix;
private getP256PublicKeyComparableBytes;
findAndReturnTokens(tokenToFind: string, tokens: Token[]): Token[];
}