@taquito/michelson-encoder
Version:
converts michelson data and types into convenient JS/TS objects
60 lines (59 loc) • 2.2 kB
TypeScript
import { Semantic, SemanticEncoding } from '../tokens/token';
import { ScriptResponse, MichelsonV1Expression } from '@taquito/rpc';
import { TokenSchema } from './types';
/**
* @warn Our current smart contract abstraction feature is currently in preview. It's API is not final, and it may not cover every use case (yet). We will greatly appreciate any feedback on this feature.
*/
export declare class ParameterSchema {
private root;
/**
*
* @description Create an instance of ParameterSchema from a contract script
*
* @param val contract script obtained from the RPC
* @returns ParameterSchema
* @throws {InvalidRpcResponseError} If the RPC response is invalid
*/
static fromRPCResponse(val: {
script: ScriptResponse;
}): ParameterSchema;
/**
* @description Check if the Contract parameter is multiple entry point or not
*/
get isMultipleEntryPoint(): boolean;
/**
* @description Check if the Contract parameter has an annotation or not
*/
get hasAnnotation(): boolean;
/**
* @description Return the schema of the parameter of a specific entry point
* @throws {@link InvalidTokenError}
*/
constructor(val: MichelsonV1Expression);
/**
* @description Returns the javascript object equivalent of the Micheline value provided
*/
Execute(val: any, semantics?: Semantic): any;
/**
* @description Returns a micheline formatted object for the values provided
* @throws {@link TokenValidationError}
* @throws {@link ParameterEncodingError}
*/
Encode(...args: any[]): any;
/**
* @description Returns a micheline formatted object for the javascript object provided
* @throws {@link TokenValidationError}
* @throws {@link ParameterEncodingError}
*/
EncodeObject(value?: any, semantics?: SemanticEncoding): any;
/**
* @deprecated ExtractSchema has been deprecated in favor of generateSchema
*
*/
ExtractSchema(): any;
/**
* @description Produce a schema grouping together all the entry points of a contract.
*/
generateSchema(): TokenSchema;
ExtractSignatures(): any[][];
}