import { ProtocolParameters } from "./protocolParameters"; import { AddrKeyHash, ScriptHash } from './address'; import { Address, HexString, Lovelace, TokenBundle } from './base'; import { ReferenceScript, TxCertificate, TxDatum, TxInput, TxInputRef, TxMetadata, TxMetadatum, TxMintRedeemer, TxOutput, TxRedeemer, TxScript, TxScriptSource, TxSpendRedeemer, TxWithdrawal, UTxO } from './transaction'; export type ValidityInterval = { validityIntervalStartSlot: number; validityIntervalStart: Date; ttl: Date; }; export type GenericInput = { isScript: false; utxo: UTxO; } | { isScript: true; isReferenceScript?: false; utxo: UTxO; redeemer: Omit; script: TxScript; } | { isScript: true; isReferenceScript: true; utxo: UTxO; redeemer: Omit; scriptHash: ScriptHash; }; export type ReferenceInput = TxInputRef & { datum?: TxDatum; }; export type GenericOutput = { address: Address; coins: Lovelace; tokenBundle: TokenBundle; datum?: TxDatum; inlineDatum?: boolean; inlineScript?: TxScript; /** * Mark this output as the change output. * The lovelace and token values are ignored for now. * WARNING: Do not use without planType set to STRICT */ isChangePlaceholder?: boolean; }; export type MintScript = { tokenBundle: TokenBundle; redeemer: Omit; script: TxScriptSource; }; export declare enum TxPlanType { LOOSE = 0, STRICT = 1 } export type TxMessage = string[]; export type TxNftMetadatum = { policyId: HexString; assetName: HexString; name: string; image: string; description?: string; mediaType?: string; files?: Array<{ name: string; mediaType: string; src: string; }>; otherProperties?: Map; }; export type TxPlanMetadata = { message?: TxMessage; custom?: TxMetadata; nfts?: { version: number; data: TxNftMetadatum[]; }; }; export type TxPlanArgs = { planType?: TxPlanType; planId: string; inputs?: GenericInput[]; referenceInputs?: ReferenceInput[]; referenceScripts?: ReferenceScript[]; outputs?: GenericOutput[]; mint?: MintScript[]; requiredSigners?: AddrKeyHash[]; certificates?: TxCertificate[]; withdrawals?: TxWithdrawal[]; validityInterval?: ValidityInterval; protocolParameters: ProtocolParameters; metadata?: TxPlanMetadata; potentialCollaterals?: UTxO[]; collateralInputs?: UTxO[]; collateralOutput?: GenericOutput; }; type ProtocolParametersForTxBuilding = Pick; export type TxPlanDraft = { inputs: TxInput[]; referenceInputs?: TxInputRef[]; collateralInputs?: TxInput[]; collateralOutput?: TxOutput; outputs: TxOutput[]; certificates: TxCertificate[]; withdrawals: TxWithdrawal[]; mint?: TokenBundle; scripts?: TxScriptSource[]; datums?: TxDatum[]; redeemers?: TxRedeemer[]; planId?: string; requiredSigners?: AddrKeyHash[]; protocolParameters: ProtocolParametersForTxBuilding; metadata?: TxPlanMetadata; }; export type TxPlanResult = { success: true; txPlan: TxPlan; } | { success: false; cause?: 'Overspent budget' | 'Deserialization failure'; error: any; estimatedFee: Lovelace; deposit: Lovelace; minimalLovelaceAmount: Lovelace; }; export interface TxPlan { inputs: Array; referenceInputs?: Array; outputs: Array; change: Array; additionalLovelaceAmount: Lovelace; fee: Lovelace; baseFee: Lovelace; collateralInputs: Array; collateralOutput?: TxOutput; totalCollateral?: Lovelace; requiredSigners?: Array; mint?: TokenBundle; datums?: Array; scripts?: Array; redeemers?: Array; certificates: Array; deposit: Lovelace; withdrawals: Array; planId?: string; protocolParameters: ProtocolParametersForTxBuilding; metadata?: TxPlanMetadata; } export {}; //# sourceMappingURL=txPlan.d.ts.map