@harmoniclabs/plu-ts-onchain
Version:
An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript
56 lines (55 loc) • 2.14 kB
TypeScript
import { GenericTermType, PrimType, StructCtorDef, StructDefinition, TermType } from "./types.js";
export declare function getNRequiredLambdaArgs(type: GenericTermType): number;
/**
* @deprecated use ```getNRequiredLambdaArgs```
*/
export declare const getNRequiredArgs: typeof getNRequiredLambdaArgs;
export declare function ctorDefToString(ctorDef: StructCtorDef, limit?: number): string;
export declare function structDefToString(def: StructDefinition, limit?: number): string;
export declare function termTypeToString(t: GenericTermType, limit?: number): string;
export interface CtorDefJson {
[field: string]: TermTypeJson;
}
export interface StructDefJson {
[ctor: string]: CtorDefJson;
}
export declare function ctorDefToJson(ctorDef: StructCtorDef): CtorDefJson;
export declare function ctorDefFromJson(j: CtorDefJson): StructCtorDef;
export declare function structDefToJson(def: StructDefinition): StructDefJson;
export declare function structDefFromJson(j: StructDefJson): StructDefinition;
export type TermTypeJson = TermTypeJsonAlias | TermTypeJsonAsData | TermTypeJsonList | TermTypeJsonDelayed | TermTypeJsonPair | TermTypeJsonLambda | TermTypeJsonTyParam | TermTypeJsonStruct | TermTypeJsonSop | PrimType.Int | PrimType.BS | PrimType.Str | PrimType.Unit | PrimType.Bool | PrimType.Data;
export interface TermTypeJsonAlias {
alias: TermTypeJson;
}
export interface TermTypeJsonAsData {
asData: TermTypeJson;
}
export interface TermTypeJsonList {
list: TermTypeJson;
}
export interface TermTypeJsonDelayed {
delayed: TermTypeJson;
}
export interface TermTypeJsonPair {
pair: {
fst: TermTypeJson;
snd: TermTypeJson;
};
}
export interface TermTypeJsonLambda {
lambda: {
input: TermTypeJson;
output: TermTypeJson;
};
}
export interface TermTypeJsonTyParam {
tyParam: null;
}
export interface TermTypeJsonStruct {
struct: StructDefJson;
}
export interface TermTypeJsonSop {
sop: StructDefJson;
}
export declare function termTypeToJson(t: GenericTermType): TermTypeJson;
export declare function termTypeFromJson(json: TermTypeJson): TermType;