import { ExecutionUnits, Language as OgmiosLanguage } from '@cardano-ogmios/schema'; import { BigNumber } from 'bignumber.js'; import { ScriptHash } from "./address"; import type * as api from '../dappConnector'; import { ARRAY_ENCODING } from '../ledger/transaction/cbor/cborTypes'; import { Address, Hash32String, HexString, Lovelace, TokenBundle } from './base'; export type TxInputRef = { txHash: string; outputIndex: number; }; export type ReferenceScript = { txInputRef: TxInputRef; scriptHash: ScriptHash; language: Language; size: number; }; export type UTxO = TxInputRef & { address: Address; coins: Lovelace; tokenBundle: TokenBundle; datum?: TxDatum; datumHash?: HexString; creationTime?: Date; inlineDatum?: boolean; inlineScript?: TxScript; hasInlineScript?: boolean; }; export type UTxOWithRef = { utxoRef: api.TxInput; _utxo: TUTxO; }; export type TxInput = UTxO; export declare enum TxOutputType { LEGACY = 0, POST_ALONZO = 1 } export declare enum TxDatumOptionType { HASH = 0, INLINED_DATUM = 1 } export declare enum TxScriptType { NATIVE = 0, PLUTUS_V1 = 1, PLUTUS_V2 = 2, PLUTUS_V3 = 3 } export type TxDatumOption = { type: TxDatumOptionType.HASH; hash: Hash32String; } | { type: TxDatumOptionType.INLINED_DATUM; datum: TxDatum; }; export type TxOutput = { isChange: boolean; address: Address; coins: Lovelace; tokenBundle: TokenBundle; } & ({ type: TxOutputType.LEGACY; datumHash?: Hash32String; } | { type: TxOutputType.POST_ALONZO; datumOption?: TxDatumOption; scriptRef?: TxScript; }); export type TxOutputId = string & { __type: 'TxOutputId'; }; export declare enum TxCertificateType { STAKE_REGISTRATION = 0, STAKE_DEREGISTRATION = 1, STAKE_DELEGATION = 2, VOTE_DELEGATION = 9 } export type TxCertificate = TxStakeRegistrationCert | TxStakeDeregistrationCert | TxStakeDelegationCert | TxVoteDelegationCert; export type TxStakeRegistrationCert = { type: TxCertificateType.STAKE_REGISTRATION; stakingAddress: Address; }; export type TxStakeDeregistrationCert = { type: TxCertificateType.STAKE_DEREGISTRATION; stakingAddress: Address; }; export type TxStakeDelegationCert = { type: TxCertificateType.STAKE_DELEGATION; stakingAddress: Address; poolHash: string; }; export type TxVoteDelegationCert = { type: TxCertificateType.VOTE_DELEGATION; stakingAddress: Address; }; export type TxWithdrawal = { stakingAddress: Address; rewards: Lovelace; }; export declare enum TxMetadatumLabel { MESSAGE = 674, NFT = 721 } export type TxMetadatum = number | string | Buffer | TxMetadatum[] | Map; export type TxMetadata = Map; export type TxShelleyWitness = { publicKey: Buffer; signature: Buffer; }; export type TxWitnessSet = { vKeyWitnesses?: TxShelleyWitness[]; nativeScripts?: any; plutusScripts?: TxScriptSource[]; plutusDatums?: TxDatum[]; redeemers?: TxRedeemer[]; }; export declare enum Language { PLUTUSV1 = 0,// id TAG used by cost models PLUTUSV2 = 1, PLUTUSV3 = 2 } export interface TxDatumConstr { i: number; data: TxDatum[]; __typeConstr: any; __cborArrayEncoding?: ARRAY_ENCODING; } export interface TxSimpleDatum { data: TxDatum; __simpleDatum: any; } export type TxDatum = string | number | BigNumber | Buffer | Map | TxDatum[] | TxDatumConstr | TxSimpleDatum; export declare enum TxRedeemerTag { SPEND = 0, MINT = 1, CERT = 2, REWARD = 3 } type TxRedeemerBase = { tag: TxRedeemerTag; data: TxDatum; exUnits: ExecutionUnits; }; export type TxSpendRedeemer = TxRedeemerBase & { tag: TxRedeemerTag.SPEND; ref: { txHash: HexString; outputIndex: number; }; }; export type TxMintRedeemer = TxRedeemerBase & { tag: TxRedeemerTag.MINT; ref: { policyId: HexString; }; }; export type TxRedeemer = TxSpendRedeemer | TxMintRedeemer | /* TODO */ (TxRedeemerBase & { tag: TxRedeemerTag.CERT | TxRedeemerTag.REWARD; index: number; }); export type TxScript = { bytes: Buffer; language: Language; isReferenceScript?: false; }; export type TxScriptSource = TxScript | { txInputRef: TxInputRef; scriptHash: ScriptHash; scriptSize: number; language: Language; isReferenceScript: true; }; export type TxSubmission = { txHash: string; }; export declare enum PlutusScriptVersion { PlutusScriptV1 = "PlutusScriptV1", PlutusScriptV2 = "PlutusScriptV2", PlutusScriptV3 = "PlutusScriptV3" } export declare enum ScriptLanguageTag { PLUTUS_SCRIPT_V1 = "plutus:v1", PLUTUS_SCRIPT_V2 = "plutus:v2", PLUTUS_SCRIPT_V3 = "plutus:v3" } export declare const PLUTUS_SCRIPT_VERSION_PREFIX: { PlutusScriptV1: string; PlutusScriptV2: string; PlutusScriptV3: string; }; export declare const PLUTUS_SCRIPT_VERSION_TO_LANGUAGE: { PlutusScriptV1: Language; PlutusScriptV2: Language; PlutusScriptV3: Language; }; export declare const LANGUAGE_TO_TX_SCRIPT_TYPE: { 0: TxScriptType; 1: TxScriptType; 2: TxScriptType; }; export declare const LANGUAGE_TO_SCRIPT_LANGUAGE_TAG: { 0: ScriptLanguageTag; 1: ScriptLanguageTag; 2: ScriptLanguageTag; }; export declare const OGMIOS_LANGUAGE_TO_LANGUAGE: Record; export {}; //# sourceMappingURL=transaction.d.ts.map