UNPKG

@harmoniclabs/plu-ts-onchain

Version:

An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript

45 lines (44 loc) 2.01 kB
import { ByteString } from "@harmoniclabs/bytestring"; import { Cloneable } from "@harmoniclabs/cbor/dist/utils/Cloneable"; import { Pair } from "@harmoniclabs/pair"; import { Data } from "@harmoniclabs/plutus-data"; import { ToJson } from "../../utils/ToJson.js"; import { CanBeUInteger } from "../../utils/ints.js"; import { IHash, IIRParent } from "../interfaces/index.js"; import { TermType } from "../../pluts/type_system/types.js"; import { IRParentTerm } from "../utils/isIRParentTerm.js"; import { BaseIRMetadata } from "./BaseIRMetadata.js"; import { IRHash } from "../IRHash.js"; import { IRNodeKind } from "../IRNodeKind.js"; export type IRConstValue = CanBeUInteger | ByteString | Uint8Array | string | boolean | IRConstValue[] | Pair<IRConstValue, IRConstValue> | Data | undefined; export interface IRConstMetadata extends BaseIRMetadata { } export declare class IRConst implements Cloneable<IRConst>, IHash, IIRParent, ToJson { static get kind(): IRNodeKind.Const; get kind(): IRNodeKind.Const; static get tag(): Uint8Array; constructor(t: TermType, v: IRConstValue, _unsafeHash?: IRHash); readonly type: TermType; readonly value: IRConstValue; private _hash; get hash(): IRHash; markHashAsInvalid(): void; isHashPresent(): boolean; private _meta; get meta(): IRConstMetadata | undefined; private _parent; get parent(): IRParentTerm | undefined; set parent(newParent: IRParentTerm | undefined); clone(): IRConst; toJSON(): any; toJson(): any; static get unit(): IRConst; static bool(b: boolean): IRConst; static byteString(b: ByteString | Uint8Array): IRConst; static int(n: number | bigint): IRConst; static str(string: string): IRConst; static data(d: Data): IRConst; static listOf(t: TermType): (vals: IRConstValue[]) => IRConst; static pairOf(a: TermType, b: TermType): (fst: IRConstValue, snd: IRConstValue) => IRConst; } export declare function isIRConstValue(value: any): boolean;