@tezwell/michelson-sdk
Version:
Michelson SDK is a framework for generating Michelson values and types from Javascript.
82 lines (81 loc) • 4.53 kB
TypeScript
import type { IRecordVariant } from './type';
import type { MichelsonJSON, MichelsonMicheline, PairsOfKeys, PrimValue, IValue } from './typings';
export declare class Michelson_Literal implements IValue {
private prim;
private value;
constructor(prim: PrimValue, value?: number | string | boolean);
toMicheline(): MichelsonMicheline;
toJSON(): MichelsonJSON;
}
export declare class Michelson_Literal_C1 implements IValue {
#private;
constructor(prim: PrimValue, elements: IValue[]);
toMicheline(wrap?: boolean): MichelsonMicheline;
toJSON(): MichelsonJSON;
}
export declare class Michelson_Map implements IValue {
#private;
constructor(elements: IValue[][]);
private buildMichelineElt;
toMicheline(): MichelsonMicheline;
toJSON(): MichelsonJSON;
}
export declare const Nat: (value: number | string) => Michelson_Literal;
export declare const Int: (value: number | string) => Michelson_Literal;
export declare const Mutez: (value: number | string) => Michelson_Literal;
export declare const Timestamp: (value: number | string) => Michelson_Literal;
export declare const String: (value: string) => Michelson_Literal;
export declare const Address: (address: string) => Michelson_Literal;
export declare const Contract: (address: string, entry_point: string) => Michelson_Literal;
export declare const Bytes: (value: string) => Michelson_Literal;
export declare const Chain_id: (value: string) => Michelson_Literal;
export declare const Bls12_381_fr: (value: string | number) => Michelson_Literal;
export declare const Bls12_381_g1: (value: string) => Michelson_Literal;
export declare const Bls12_381_g2: (value: string) => Michelson_Literal;
export declare const Key: (key: string) => Michelson_Literal;
export declare const Key_hash: (key_hash: string) => Michelson_Literal;
export declare const Signature: (signature: string) => Michelson_Literal;
export declare const Bool: (bool: boolean) => Michelson_Literal;
export declare const Unit: () => Michelson_Literal;
export declare const List: (elements: IValue[]) => Michelson_Literal_C1;
export declare const Set: (elements: IValue[]) => Michelson_Literal_C1;
export declare const None: () => Michelson_Literal;
export declare const Some: (element: IValue) => Michelson_Literal_C1;
export declare const Pair: (left: IValue, right: IValue) => Michelson_Literal_C1;
export declare const Map: (elements?: IValue[][]) => Michelson_Map;
export declare const Big_map: (elements?: IValue[][]) => Michelson_Map;
export declare const Lambda: (code: MichelsonMicheline | MichelsonJSON) => IValue;
export declare const Left: (value: IValue) => Michelson_Literal_C1;
export declare const Right: (value: IValue) => Michelson_Literal_C1;
export declare const Record: (fields: Record<string, IValue>, layout?: PairsOfKeys<string> | undefined) => IValue;
export declare const Variant: (branch: string, value: IValue, type: IRecordVariant) => IValue;
declare const Literals: {
Unit: () => Michelson_Literal;
Nat: (value: number | string) => Michelson_Literal;
Int: (value: number | string) => Michelson_Literal;
Mutez: (value: number | string) => Michelson_Literal;
String: (value: string) => Michelson_Literal;
Bool: (bool: boolean) => Michelson_Literal;
Address: (address: string) => Michelson_Literal;
Contract: (address: string, entry_point: string) => Michelson_Literal;
Timestamp: (value: number | string) => Michelson_Literal;
Chain_id: (value: string) => Michelson_Literal;
Bytes: (value: string) => Michelson_Literal;
Bls12_381_fr: (value: string | number) => Michelson_Literal;
Bls12_381_g1: (value: string) => Michelson_Literal;
Bls12_381_g2: (value: string) => Michelson_Literal;
Key: (key: string) => Michelson_Literal;
Key_hash: (key_hash: string) => Michelson_Literal;
Signature: (signature: string) => Michelson_Literal;
List: (elements: IValue[]) => Michelson_Literal_C1;
Set: (elements: IValue[]) => Michelson_Literal_C1;
None: () => Michelson_Literal;
Some: (element: IValue) => Michelson_Literal_C1;
Pair: (left: IValue, right: IValue) => Michelson_Literal_C1;
Map: (elements?: IValue[][]) => Michelson_Map;
Big_map: (elements?: IValue[][]) => Michelson_Map;
Lambda: (code: MichelsonMicheline | MichelsonJSON) => IValue;
Record: (fields: Record<string, IValue>, layout?: PairsOfKeys<string> | undefined) => IValue;
Variant: (branch: string, value: IValue, type: IRecordVariant) => IValue;
};
export default Literals;