export { generateMnemonic, mnemonicToEntropy } from 'bip39'; type AccountInfo = { active: boolean; poolId?: string; balance: string; rewards: string; withdrawals: string; }; type Data = string | number | bigint | Array | Map | { alternative: number; fields: Array; }; type RedeemerTagType = "CERT" | "MINT" | "REWARD" | "SPEND" | "VOTE" | "PROPOSE"; type Action = { data: Data; index: number; budget: Budget; tag: RedeemerTagType; }; type Budget = { mem: number; steps: number; }; type Asset = { unit: Unit; quantity: Quantity; }; type Unit = string; type Quantity = string; declare const mergeAssets: (assets: Asset[]) => Asset[]; type AssetExtended = { unit: Unit; policyId: string; assetName: string; fingerprint: string; quantity: Quantity; }; type RoyaltiesStandard = { rate: string; address: string; }; declare const royaltiesStandardKeys: string[]; type MetadataStandard = any; declare const metadataStandardKeys: string[]; type Files = { files?: [ { name: string; src: `${string}://${string}`; mediaType: `${string}/${string}`; } ]; }; type AssetMetadata = FungibleAssetMetadata | NonFungibleAssetMetadata | RoyaltiesStandard; type FungibleAssetMetadata = MetadataStandard & { ticker: string; decimals: number; version: `${number}.${number}`; }; declare const fungibleAssetKeys: string[]; type NonFungibleAssetMetadata = AudioAssetMetadata | ImageAssetMetadata | SmartAssetMetadata | VideoAssetMetadata; type AudioAssetMetadata = MetadataStandard & Files; type ImageAssetMetadata = MetadataStandard & Files & { artists?: [ { name: string; twitter?: `https://twitter.com/${string}`; } ]; attributes?: { [key: string]: string; }; traits?: string[]; }; type SmartAssetMetadata = MetadataStandard & Files; type VideoAssetMetadata = MetadataStandard & Files; /** * Transform the metadata into the format needed in CIP68 inline datum (in Mesh Data type) * @param metadata The metadata body without outer wrapper of policy id & token name * @returns The metadata in Mesh Data type, ready to be attached as inline datum */ declare const metadataToCip68: (metadata: any) => Data; type BlockInfo = { time: number; hash: string; slot: string; epoch: number; epochSlot: string; slotLeader: string; size: number; txCount: number; output: string; fees: string; previousBlock: string; nextBlock: string; confirmations: number; operationalCertificate: string; VRFKey: string; }; type DataSignature = { signature: string; key: string; }; type Era = "ALONZO" | "BABBAGE"; type Extension = { cip: number; }; type Message = { payload: string; externalAAD?: string; }; type Recipient = string | { address: string; datum?: { value: Data; inline?: boolean; }; }; type Mint = { assetName: string; assetQuantity: Quantity; recipient?: Recipient; metadata?: AssetMetadata; label?: "20" | "721" | "777" | `${number}`; cip68ScriptAddress?: string; }; type NativeScript = { type: "after" | "before"; slot: string; } | { type: "all" | "any"; scripts: NativeScript[]; } | { type: "atLeast"; required: number; scripts: NativeScript[]; } | { type: "sig"; keyHash: string; }; declare const ALL_NETWORKS: readonly ["testnet", "preview", "preprod", "mainnet"]; type Network = (typeof ALL_NETWORKS)[number]; declare const isNetwork: (value: unknown) => value is Network; type PlutusScript = { version: LanguageVersion; code: string; }; type LanguageVersion = keyof typeof LANGUAGE_VERSIONS; type Relay = { type: "SingleHostAddr"; IPV4?: string; IPV6?: string; port?: number; } | { type: "SingleHostName"; domainName: string; port?: number; } | { type: "MultiHostName"; domainName: string; }; type PoolParams = { vrfKeyHash: string; operator: string; pledge: string; cost: string; margin: [number, number]; relays: Relay[]; owners: string[]; rewardAddress: string; metadata?: PoolMetadata; }; type PoolMetadata = { URL: string; hash: string; }; type Protocol = { epoch: number; minFeeA: number; minFeeB: number; maxBlockSize: number; maxTxSize: number; maxBlockHeaderSize: number; keyDeposit: number; poolDeposit: number; decentralisation: number; minPoolCost: string; priceMem: number; priceStep: number; maxTxExMem: string; maxTxExSteps: string; maxBlockExMem: string; maxBlockExSteps: string; maxValSize: number; collateralPercent: number; maxCollateralInputs: number; coinsPerUtxoSize: number; minFeeRefScriptCostPerByte: number; }; declare const castProtocol: (data: Partial>) => Protocol; type Token = keyof typeof SUPPORTED_TOKENS; type TxOutput = { address: string; amount: Asset[]; dataHash?: string; plutusData?: string; scriptRef?: string; scriptHash?: string; }; type TxInput = { txHash: string; outputIndex: number; }; type UTxO = { input: TxInput; output: TxOutput; }; type TransactionInfo = { index: number; block: string; hash: string; slot: string; fees: string; size: number; deposit: string; invalidBefore: string; invalidAfter: string; inputs: UTxO[]; outputs: UTxO[]; blockHeight?: number; blockTime?: number; }; type Wallet = { id: string; name: string; icon: string; version: string; }; type BuilderData = { type: "Mesh"; content: Data; } | { type: "JSON"; content: object | string; } | { type: "CBOR"; content: string; }; type Redeemer = { data: BuilderData; exUnits: Budget; }; type DatumSource = { type: "Provided"; data: BuilderData; } | { type: "Inline"; txHash: string; txIndex: number; }; type ScriptSource = { type: "Provided"; script: PlutusScript; } | { type: "Inline"; txHash: string; txIndex: number; scriptHash?: string; scriptSize?: string; version?: LanguageVersion; }; type SimpleScriptSourceInfo = { type: "Provided"; scriptCode: string; } | { type: "Inline"; txHash: string; txIndex: number; simpleScriptHash?: string; scriptSize?: string; }; type Certificate = { type: "BasicCertificate"; certType: CertificateType; } | { type: "ScriptCertificate"; certType: CertificateType; redeemer?: Redeemer; scriptSource?: ScriptSource; } | { type: "SimpleScriptCertificate"; certType: CertificateType; simpleScriptSource?: SimpleScriptSourceInfo; }; type CertificateType = { type: "RegisterPool"; poolParams: PoolParams; } | { type: "RegisterStake"; stakeKeyAddress: string; } | { type: "DelegateStake"; stakeKeyAddress: string; poolId: string; } | { type: "DeregisterStake"; stakeKeyAddress: string; } | { type: "RetirePool"; poolId: string; epoch: number; } | { type: "VoteDelegation"; stakeKeyAddress: string; drep: DRep; } | { type: "StakeAndVoteDelegation"; stakeKeyAddress: string; poolKeyHash: string; drep: DRep; } | { type: "StakeRegistrationAndDelegation"; stakeKeyAddress: string; poolKeyHash: string; coin: number; } | { type: "VoteRegistrationAndDelegation"; stakeKeyAddress: string; drep: DRep; coin: number; } | { type: "StakeVoteRegistrationAndDelegation"; stakeKeyAddress: string; poolKeyHash: string; drep: DRep; coin: number; } | { type: "CommitteeHotAuth"; committeeColdKeyAddress: string; committeeHotKeyAddress: string; } | { type: "CommitteeColdResign"; committeeColdKeyAddress: string; anchor?: Anchor; } | { type: "DRepRegistration"; drepId: string; coin: number; anchor?: Anchor; } | { type: "DRepDeregistration"; drepId: string; coin: number; } | { type: "DRepUpdate"; drepId: string; anchor?: Anchor; }; type DRep = { dRepId: string; } | { alwaysAbstain: null; } | { alwaysNoConfidence: null; }; type Anchor = { anchorUrl: string; anchorDataHash: string; }; type MintParam = { type: "Plutus" | "Native"; policyId: string; mintValue: { assetName: string; amount: string; }[]; redeemer?: Redeemer; scriptSource?: ScriptSource | SimpleScriptSourceInfo; }; type MintItem = { type: "Plutus" | "Native"; policyId: string; assetName: string; amount: string; redeemer?: Redeemer; scriptSource?: ScriptSource | SimpleScriptSourceInfo; }; type Output = { address: string; amount: Asset[]; datum?: { type: "Hash" | "Inline" | "Embedded"; data: BuilderData; }; referenceScript?: PlutusScript; }; /** * The Mesh Data constructor object, representing custom data type */ type MConStr = { alternative: N; fields: T; }; /** * The Mesh Data index 0 constructor object, representing custom data type */ type MConStr0 = MConStr<0, T>; /** * The Mesh Data index 1 constructor object, representing custom data type */ type MConStr1 = MConStr<1, T>; /** * The Mesh Data index 2 constructor object, representing custom data type */ type MConStr2 = MConStr<2, T>; /** * The Mesh Data index 3 constructor object, representing custom data type */ type MConStr3 = MConStr<3, T>; /** * The utility function to create a Mesh Data constructor object, representing custom data type * @param alternative The constructor index number * @param fields The items in array * @returns The Mesh Data constructor object */ declare const mConStr: (alternative: N, fields: T) => MConStr; /** * The utility function to create a Mesh Data index 0 constructor object, representing custom data type * @param fields The items in array * @returns The Mesh Data constructor object */ declare const mConStr0: (fields: T) => MConStr0; /** * The utility function to create a Mesh Data index 1 constructor object, representing custom data type * @param fields The items in array * @returns The Mesh Data constructor object */ declare const mConStr1: (fields: T) => MConStr1; /** * The utility function to create a Mesh Data index 2 constructor object, representing custom data type * @param fields The items in array * @returns The Mesh Data constructor object */ declare const mConStr2: (fields: T) => MConStr2; /** * The utility function to create a Mesh Data index 3 constructor object, representing custom data type * @param fields The items in array * @returns The Mesh Data constructor object */ declare const mConStr3: (fields: T) => MConStr3; /** * PlutusTx alias * The Mesh Data asset class */ type MAssetClass = MConStr0<[string, string]>; /** * Aiken alias * The Mesh Data output reference */ type MOutputReference = MConStr0<[string, number]>; /** * PlutusTx alias * The Mesh Data TxOutRef */ type MTxOutRef = MConStr0<[MConStr0<[string]>, number]>; /** * Aiken alias * The Mesh Data tuple */ type MTuple = T[]; /** * Aiken alias * The Mesh Data Option type */ type MOption = MSome | MNone; /** * Aiken alias * The Mesh Data Option - Some type */ type MSome = MConStr0<[T]>; /** * Aiken alias * The Mesh Data Option - None type */ type MNone = MConStr1<[]>; /** * The utility function to create a Mesh Data asset class * @param currencySymbolHex The currency symbol in hex * @param tokenNameHex The token name in hex * @returns The Mesh Data asset class object */ declare const mAssetClass: (currencySymbolHex: string, tokenNameHex: string) => MAssetClass; /** * The utility function to create a Mesh Data output reference in Mesh Data type * @param txHash The transaction hash * @param index The index of the output * @returns The Mesh Data output reference object */ declare const mOutputReference: (txHash: string, index: number) => MOutputReference; /** * The utility function to create a Mesh Data TxOutRef in Mesh Data type * @param txHash The transaction hash * @param index The index of the output * @returns The Mesh Data TxOutRef object */ declare const mTxOutRef: (txHash: string, index: number) => MTxOutRef; /** * The utility function to create a Mesh Data tuple in Mesh Data type * @param args The arguments of the tuple * @returns The Mesh Data tuple object */ declare const mTuple: (...args: T) => MTuple; /** * The utility function to create a Mesh Data Option type in Mesh Data type * @param value The value of the option * @returns The Mesh Data Option object */ declare const mOption: (value?: T) => MOption; /** * The utility function to create a Mesh Data Option type in Mesh Data type * @param value The value of the option * @returns The Mesh Data Option object */ declare const mSome: (value: T) => MSome; /** * The utility function to create a Mesh Data Option - None type in Mesh Data type * @returns The Mesh Data Option - None object */ declare const mNone: () => MNone; /** * The Mesh Data verification key */ type MVerificationKey = MConStr0<[string]>; /** * The Mesh Data script key */ type MScript = MConStr1<[string]>; /** * The Mesh Data staking credential */ type MMaybeStakingHash = MConStr1<[]> | MConStr0<[MConStr0<[MVerificationKey]>]> | MConStr0<[MConStr0<[MScript]>]>; /** * The Mesh Data public key address */ type MPubKeyAddress = MConStr0<[MVerificationKey, MMaybeStakingHash]>; /** * The Mesh Data script address */ type MScriptAddress = MConStr0<[MScript, MMaybeStakingHash]>; /** * The Mesh Data credential */ type MCredential = MVerificationKey | MScript; /** * The utility function to create a Mesh Data verification key * @param bytes The public key hash in hex * @returns The Mesh Data verification key object */ declare const mVerificationKey: (bytes: string) => MVerificationKey; /** * The utility function to create a Mesh Data script key * @param bytes The script hash in hex * @returns The Mesh Data script key object */ declare const mScript: (bytes: string) => MScript; /** * The utility function to create a Mesh Data staking hash * @param stakeCredential The staking credential in hex * @param isStakeScriptCredential The flag to indicate if the credential is a script credential * @returns The Mesh Data staking hash object */ declare const mMaybeStakingHash: (stakeCredential: string, isStakeScriptCredential?: boolean) => MMaybeStakingHash; /** * The utility function to create a Mesh Data public key address * @param bytes The public key hash in hex * @param stakeCredential The staking credential in hex * @param isStakeScriptCredential The flag to indicate if the credential is a script credential * @returns The Mesh Data public key address object */ declare const mPubKeyAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => MPubKeyAddress; /** * The utility function to create a Mesh Data script address * @param bytes The validator hash in hex * @param stakeCredential The staking credential in hex * @param isStakeScriptCredential The flag to indicate if the credential is a script credential * @returns The Mesh Data script address object */ declare const mScriptAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => MScriptAddress; /** * The utility function to create a Mesh Data credential * @param hash The pub key hash or script hash * @param isScriptCredential Indicate if the credential is script hash (false for pub key hash) * @returns Mesh Data credential object */ declare const mCredential: (hash: string, isScriptCredential?: boolean) => MCredential; /** * The Mesh Data boolean */ type MBool = MConStr0<[]> | MConStr1<[]>; /** * The utility function to create a Mesh Data boolean * @param b boolean value * @returns The Mesh Data boolean object */ declare const mBool: (b: boolean) => MBool; /** * Converting a hex string into a BuiltinByteString Array, with max 32 bytes on each items * @param hexString The hex string to be converted into BuiltinByteString Array * @returns The BuiltinByteString Array representation of the hex string */ declare const mStringToPlutusBSArray: (hexString: string) => string[]; /** * Converting BuiltinByteString Array into a single string * @param bsArray The BuiltinByteString Array to be converted into a single string * @returns The string representation of the BuiltinByteString Array */ declare const mPlutusBSArrayToString: (bsArray: string[]) => string; /** * The Plutus Data constructor object, representing custom data type in JSON */ interface ConStr { constructor: N; fields: T; } /** * The Plutus Data index 0 constructor object, representing custom data type in JSON */ interface ConStr0 extends ConStr<0, T> { } /** * The Plutus Data index 1 constructor object, representing custom data type in JSON */ interface ConStr1 extends ConStr<1, T> { } /** * The Plutus Data index 2 constructor object, representing custom data type in JSON */ interface ConStr2 extends ConStr<2, T> { } /** * The Plutus Data index 3 constructor object, representing custom data type in JSON */ interface ConStr3 extends ConStr<3, T> { } /** * The utility function to create a Plutus Data constructor object, representing custom data type in JSON * @param constructor The constructor index number * @param fields The items in array * @returns The Plutus Data constructor object */ declare const conStr: (constructor: N, fields: T) => ConStr; /** * The utility function to create a Plutus Data index 0 constructor object, representing custom data type in JSON * @param fields The items of in array * @returns The Plutus Data constructor object */ declare const conStr0: (fields: T) => ConStr0; /** * The utility function to create a Plutus Data index 1 constructor object, representing custom data type in JSON * @param fields The items of in array * @returns The Plutus Data constructor object */ declare const conStr1: (fields: T) => ConStr1; /** * The utility function to create a Plutus Data index 2 constructor object, representing custom data type in JSON * @param fields The items of in array * @returns The Plutus Data constructor object */ declare const conStr2: (fields: T) => ConStr2; /** * The utility function to create a Plutus Data index 3 constructor object, representing custom data type in JSON * @param fields The items of in array * @returns The Plutus Data constructor object */ declare const conStr3: (fields: T) => ConStr3; /** * The Plutus Data boolean in JSON */ type Bool = ConStr0<[]> | ConStr1<[]>; /** * The Plutus Data byte string, representing in hex, in JSON */ type BuiltinByteString = { bytes: string; }; /** * The Plutus Data byte string, representing in hex, in JSON */ type ByteString = { bytes: string; }; /** * The Plutus Data integer in JSON */ type Integer = { int: number | bigint; }; /** * The Plutus Data list in JSON */ type List = { list: T[]; }; /** * PlutusTx alias * The Plutus Data association map item in JSON */ type AssocMapItem = { k: K; v: V; }; /** * PlutusTx alias * The Plutus Data association map in JSON */ type AssocMap = { map: AssocMapItem[]; }; /** * Aiken alias * The Plutus Data association map item in JSON */ type Pair = { k: K; v: V; }; /** * Aiken alias * The Plutus Data association map in JSON */ type Pairs = { map: Pair[]; }; /** * The utility function to create a Plutus Data boolean in JSON * @param b boolean value * @returns The Plutus Data boolean object */ declare const bool: (b: boolean) => Bool; /** * The utility function to create a Plutus Data byte string in JSON * @param bytes The byte string in hex * @returns The Plutus Data byte string object */ declare const builtinByteString: (bytes: string) => BuiltinByteString; /** * The utility function to create a Plutus Data byte string in JSON * @param bytes The byte string in hex * @returns The Plutus Data byte string object */ declare const byteString: (bytes: string) => ByteString; /** * The utility function to create a Plutus Data integer in JSON * @param int The integer value * @returns The Plutus Data integer object */ declare const integer: (int: number | bigint) => Integer; /** * The utility function to create a Plutus Data list in JSON * @param pList The list of Plutus Data * @param validation Default true - If current data construction would perform validation (introducing this flag due to possible performance issue in loop validation) * @returns The Plutus Data list object */ declare const list: (pList: T[], validation?: boolean) => List; /** * Converting a hex string into a ByteString Array, with max 32 bytes on each items * @param hexString The hex string to be converted into ByteString Array * @returns The ByteString Array representation of the hex string */ declare const stringToBSArray: (hexString: string) => List; /** * Converting ByteString Array into a single string * @param bsArray The ByteString Array to be converted into a single string * @returns The string representation of the ByteString Array */ declare const plutusBSArrayToString: (bsArray: List) => string; /** * The utility function to create a Plutus Data association map in JSON * @param mapItems The items map in array * @param validation Default true - If current data construction would perform validation (introducing this flag due to possible performance issue in loop validation) * @returns The Plutus Data association map object */ declare const assocMap: (mapItems: [K, V][], validation?: boolean) => AssocMap; /** * The utility function to create a Plutus Data Pairs in JSON * @param mapItems The items map in array * @param validation Default true - If current data construction would perform validation (introducing this flag due to possible performance issue in loop validation) * @returns The Plutus Data Pairs object */ declare const pairs: (mapItems: [K, V][], validation?: boolean) => Pairs; /** * All the type aliases here represent the type name used in smart contracts from PlutusTx or Aiken. * Please be aware that the types constructed here will be invalid when PlutusTx or Aiken team introduces breaking changes. */ /** * The Plutus Data script hash in JSON */ type ScriptHash = ByteString; /** * The Plutus Data public key hash in JSON */ type PubKeyHash = ByteString; /** * Aiken alias * The Plutus Data policy id in JSON */ type PolicyId = ByteString; /** * PlutusTx alias * The Plutus Data currency symbol in JSON */ type CurrencySymbol = ByteString; /** * Aiken alias * The Plutus Data asset name in JSON */ type AssetName = ByteString; /** * PlutusTx alias * The Plutus Data token name in JSON */ type TokenName = ByteString; /** * PlutusTx alias * The Plutus Data asset class in JSON */ type AssetClass = ConStr0<[CurrencySymbol, TokenName]>; /** * Aiken alias * The Plutus Data output reference in JSON */ type OutputReference = ConStr0<[ByteString, Integer]>; /** * PlutusTx alias * The Plutus Data TxOutRef in JSON */ type TxOutRef = ConStr0<[ConStr0<[ByteString]>, Integer]>; /** * PlutusTx alias * The Plutus Data POSIX time in JSON */ type POSIXTime = Integer; /** * Aiken alias * The Plutus Data dictionary item in JSON */ type DictItem = { k: ByteString; v: V; }; /** * Aiken alias * The Plutus Data dictionary in JSON */ type Dict = { map: DictItem[]; }; /** * Aiken alias * The Plutus Data tuple in JSON */ type Tuple = { list: T; }; /** * Aiken alias * The Plutus Data Option in JSON */ type Option = Some | None; /** * Aiken alias * The Plutus Data Option - Some in JSON */ type Some = ConStr0<[T]>; /** * Aiken alias * The Plutus Data Option - None in JSON */ type None = ConStr1<[]>; /** * Internal utility function to create a Plutus Data byte string in JSON, checking correct length * @param bytes The byte string in hex * @returns The Plutus Data byte string object */ declare const hashByteString: (bytes: string) => ByteString; /** * The utility function to create a Plutus Data script hash in JSON * @param bytes The script hash in hex * @returns The Plutus Data script hash object */ declare const scriptHash: (bytes: string) => ScriptHash; /** * The utility function to create a Plutus Data pub key hash in JSON * @param bytes The script hash in hex * @returns The Plutus Data script hash object */ declare const pubKeyHash: (bytes: string) => PubKeyHash; /** * The utility function to create a Plutus Data policy id in JSON * @param bytes The policy id in hex * @returns The Plutus Data policy id object */ declare const policyId: (bytes: string) => PolicyId; /** * The utility function to create a Plutus Data currency symbol in JSON * @param bytes The policy id in hex * @returns The Plutus Data policy id object */ declare const currencySymbol: (bytes: string) => CurrencySymbol; /** * The utility function to create a Plutus Data asset name in JSON * @param bytes The asset name in hex * @returns The Plutus Data asset name object */ declare const assetName: (bytes: string) => AssetName; /** * The utility function to create a Plutus Data token name in JSON * @param bytes The token name in hex * @returns The Plutus Data token name object */ declare const tokenName: (bytes: string) => TokenName; /** * The utility function to create a Plutus Data asset class in JSON * @param currencySymbolHex The currency symbol in hex * @param tokenNameHex The token name in hex * @returns The Plutus Data asset class object */ declare const assetClass: (currencySymbolHex: string, tokenNameHex: string) => AssetClass; /** * The utility function to create a Plutus Data output reference in JSON. * Note that it is updated since aiken version v1.1.0. * If you want to build the type before Chang, please use txOutRef instead. * @param txHash The transaction hash * @param index The index of the output * @returns The Plutus Data output reference object */ declare const outputReference: (txHash: string, index: number) => OutputReference; /** * The utility function to create a Plutus Data TxOutRef in JSON * @param txHash The transaction hash * @param index The index of the output * @returns The Plutus Data TxOutRef object */ declare const txOutRef: (txHash: string, index: number) => TxOutRef; /** * The utility function to create a Plutus Data POSIX time in JSON * @param int The integer value of the POSIX time * @returns The Plutus Data POSIX time object */ declare const posixTime: (int: number) => POSIXTime; /** * The utility function to create a Plutus Data dictionary in JSON * @param itemsMap The items map in array * @returns The Plutus Data dictionary object */ declare const dict: (itemsMap: [ByteString, V][]) => Dict; /** * The utility function to create a Plutus Data tuple in JSON * @param args The arguments of the tuple * @returns The Plutus Data tuple object */ declare const tuple: (...args: T) => Tuple; /** * The utility function to create a Plutus Data Option in JSON * @param value The optional value of the option * @returns Return None constructor if the value is not provided, otherwise return Some constructor with the value */ declare const option: (value?: T) => Option; /** * The utility function to create a Plutus Data Option - Some in JSON * @param value The value of the option * @returns The Plutus Data Option - Some object */ declare const some: (value: T) => Some; /** * The utility function to create a Plutus Data Option - None in JSON * @returns The Plutus Data Option - None object */ declare const none: () => None; /** * The Plutus Data verification key in JSON */ type VerificationKey = ConStr0<[PubKeyHash]>; /** * The Plutus Data Script key in JSON */ type Script = ConStr1<[ScriptHash]>; /** * The Plutus Data staking credential in JSON */ type MaybeStakingHash = ConStr1<[]> | ConStr0<[ConStr0<[VerificationKey]>]> | ConStr0<[ConStr0<[Script]>]>; /** * The Plutus Data public key address in JSON */ type PubKeyAddress = ConStr0<[VerificationKey, MaybeStakingHash]>; /** * The Plutus Data script address in JSON */ type ScriptAddress = ConStr0<[Script, MaybeStakingHash]>; /** * The Plutus Data credential in JSON */ type Credential$1 = VerificationKey | Script; /** * The utility function to create a Plutus Data verification key in JSON * @param bytes The public key hash in hex * @returns The Plutus Data verification key object */ declare const verificationKey: (bytes: string) => VerificationKey; /** * The utility function to create a Plutus Data script key in JSON * @param bytes The script hash in hex * @returns The Plutus Data script key object * */ declare const script: (bytes: string) => Script; /** * The utility function to create a Plutus Data staking hash in JSON * @param stakeCredential The staking credential in hex * @param isStakeScriptCredential The flag to indicate if the credential is a script credential * @returns The Plutus Data staking hash object */ declare const maybeStakingHash: (stakeCredential: string, isStakeScriptCredential?: boolean) => MaybeStakingHash; /** * The utility function to create a Plutus Data public key address in JSON * @param bytes The public key hash in hex * @param stakeCredential The staking credential in hex * @param isStakeScriptCredential The flag to indicate if the credential is a script credential * @returns The Plutus Data public key address object */ declare const pubKeyAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => PubKeyAddress; /** * The utility function to create a Plutus Data script address in JSON * @param bytes The validator hash in hex * @param stakeCredential The staking credential in hex * @param isStakeScriptCredential The flag to indicate if the stake credential is a script credential * @returns The Plutus Data script address object */ declare const scriptAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => ScriptAddress; /** * The utility function to create a Plutus Data credential in JSON * @param hash The pub key hash or script hash * @param isScriptCredential Indicate if the credential is script hash (false for pub key hash) * @returns Plutus Data credential object */ declare const credential: (hash: string, isScriptCredential?: boolean) => Credential$1; type ProofStep = ProofStepBranch | ProofStepFork | ProofStepLeaf; type ProofStepBranch = ConStr0<[ Integer, ByteString ]>; type ProofStepFork = ConStr1<[ Integer, ForkNeighbor ]>; type ProofStepLeaf = ConStr2<[ Integer, ByteString, ByteString ]>; type ForkNeighbor = ConStr0<[ Integer, ByteString, ByteString ]>; /** * The utility function to transform a JSON proof from Aiken TS offchain library to Mesh JSON Data type * @param proof The proof object from Aiken TS offchain library * @returns The proof object in Mesh JSON Data type */ declare const jsonProofToPlutusData: (proof: object) => ProofStep[]; type PlutusData = ConStr | Bool | ByteString | Integer | List | AssocMap | Pairs | MaybeStakingHash | PubKeyAddress | ScriptAddress | AssetClass | OutputReference | PubKeyHash | POSIXTime | Dict | Tuple; /** * Converting bytes to hex string * @param bytes The bytes to be converted * @returns The hex string */ declare const bytesToHex: (bytes: ArrayBuffer) => string; /** * Converting hex string to bytes * @param hex The hex string to be converted * @returns The bytes */ declare const hexToBytes: (hex: string) => Buffer; /** * Converting utf8 string to hex string * @param str The utf8 string to be converted * @returns The hex string */ declare const stringToHex: (str: string) => string; /** * Checking if the string is a hex string * @param hex The string to be checked * @returns True if the string is a hex string, false otherwise */ declare const isHexString: (hex: string) => boolean; /** * Converting hex string to utf8 string * @param hex The hex string to be converted * @returns The utf8 string */ declare const hexToString: (hex: string) => string; /** * Converting either hex string or utf8 string to bytes * @param hex The hex or utf8 string to be converted * @returns The bytes */ declare const toBytes: (hex: string) => Uint8Array; /** * Converting utf8 string to hex string * @param utf8 The utf8 string to be converted * @returns The hex string */ declare const fromUTF8: (utf8: string) => string; /** * Converting hex string to utf8 string * @param hex The hex string to be converted * @returns The utf8 string */ declare const toUTF8: (hex: string) => string; /** * Parse asset unit into an object with policyId and assetName * @param unit The asset unit to be parsed * @returns The object with policyId and assetName */ declare const parseAssetUnit: (unit: string) => { policyId: string; assetName: string; }; type SlotConfig = { zeroTime: number; zeroSlot: number; slotLength: number; startEpoch: number; epochLength: number; }; declare const SLOT_CONFIG_NETWORK: Record; declare const slotToBeginUnixTime: (slot: number, slotConfig: SlotConfig) => number; /** * Eqivalent to `slotToBeginUnixTime` but option to provide optional config * @param unixTime Timestamp in milliseconds * @param slotConfig Slot configuration for calculation * @returns Slot number */ declare const unixTimeToEnclosingSlot: (unixTime: number, slotConfig: SlotConfig) => number; /** * Resolve slot number based on timestamp in milliseconds. * @param network Network: mainnet | preprod | preview. * @param milliseconds Timestamp in milliseconds * @returns Slot number */ declare const resolveSlotNo: (network: Network, milliseconds?: number) => string; /** * Resolve epoch number based on timestamp in milliseconds. * @param network Network: mainnet | preprod | preview. * @param milliseconds Timestamp in milliseconds * @returns Epoch number */ declare const resolveEpochNo: (network: Network, milliseconds?: number) => number; /** * It is suggested to keep the value representation as map of map, * where first key as policy id, second key as asset name, and final value as quantity. */ /** * Aiken alias * Value is the JSON representation of Cardano data Value */ type Value = AssocMap>; /** * Aiken alias * MValue is the Cardano data Value in Mesh Data type */ type MValue = Map>; /** * The utility function to convert assets into Cardano data Value in JSON * @param assets The assets to convert * @returns The Cardano data Value in JSON */ declare const value: (assets: Asset[]) => Value; /** * The utility function to convert assets into Cardano data Value in Mesh Data type * @param assets The assets to convert * @returns The Cardano data Value in Mesh Data type */ declare const mValue: (assets: Asset[]) => MValue; /** * MeshValue provide utility to handle the Cardano value manipulation. It offers certain axioms: * 1. No duplication of asset - adding assets with same asset name will increase the quantity of the asset in the same record. * 2. No zero and negative entry - the quantity of the asset should not be zero or negative. * 3. Sanitization of lovelace asset name - the class handle back and forth conversion of lovelace asset name to empty string. * 4. Easy convertion to Cardano data - offer utility to convert into either Mesh Data type and JSON type for its Cardano data representation. */ declare class MeshValue { value: Record; constructor(value?: Record); /** * Sort a Value (JSON representation) by policy ID then token name * @param plutusValue The Value to sort * @returns Sorted Value */ static sortValue: (plutusValue: Value) => Value; /** * Converting assets into MeshValue * @param assets The assets to convert * @returns MeshValue */ static fromAssets: (assets: Asset[]) => MeshValue; /** * Converting Value (the JSON representation of Cardano data Value) into MeshValue * @param plutusValue The Value to convert * @returns MeshValue */ static fromValue: (plutusValue: Value) => MeshValue; /** * Add an asset to the Value class's value record. * @param asset The asset to add * @returns The updated MeshValue object */ addAsset: (asset: Asset) => this; /** * Add an array of assets to the Value class's value record. * @param assets The assets to add * @returns The updated MeshValue object */ addAssets: (assets: Asset[]) => this; /** * Substract an asset from the Value class's value record. * @param asset The asset to subtract * @returns The updated MeshValue object */ negateAsset: (asset: Asset) => this; /** * Subtract an array of assets from the Value class's value record. * @param assets The assets to subtract * @returns The updated MeshValue object */ negateAssets: (assets: Asset[]) => this; /** * Get the quantity of asset object per unit * @param unit The unit to get the quantity of * @returns The quantity of the asset */ get: (unit: string) => bigint; /** * Get all assets that belong to a specific policy ID * @param policyId The policy ID to filter by * @returns Array of assets that match the policy ID */ getPolicyAssets: (policyId: string) => Asset[]; /** * Get all asset units * @returns The asset units */ units: () => string[]; /** * Check if the value is greater than or equal to another value * @param other - The value to compare against * @returns boolean */ geq: (other: MeshValue) => boolean; /** * Check if the specific unit of value is greater than or equal to that unit of another value * @param unit - The unit to compare * @param other - The value to compare against * @returns boolean */ geqUnit: (unit: string, other: MeshValue) => boolean; /** * Check if the value is less than or equal to another value * @param other - The value to compare against * @returns boolean */ leq: (other: MeshValue) => boolean; /** * Check if the specific unit of value is less than or equal to that unit of another value * @param unit - The unit to compare * @param other - The value to compare against * @returns boolean */ leqUnit: (unit: string, other: MeshValue) => boolean; /** * Check if the value is equal to another value * @param other - The value to compare against * @returns boolean */ eq: (other: MeshValue) => boolean; /** * Check if the specific unit of value is equal to that unit of another value * @param unit - The unit to compare * @param other - The value to compare against * @returns boolean */ eqUnit: (unit: string, other: MeshValue) => boolean; /** * Check if the value is empty * @returns boolean */ isEmpty: () => boolean; /** * Merge the given values * @param values The other values to merge * @returns this */ merge: (values: MeshValue | MeshValue[]) => this; /** * Convert the MeshValue object into an array of Asset * @returns The array of Asset */ toAssets: () => Asset[]; /** * Convert the MeshValue object into Cardano data Value in Mesh Data type * Entries are sorted by byte ordering of policy ID, then token name */ toData: () => MValue; /** * Convert the MeshValue object into a JSON representation of Cardano data Value * Entries are sorted by byte ordering of policy ID, then token name * @returns Cardano data Value in JSON */ toJSON: () => Value; } type PlutusDataType = "Mesh" | "JSON" | "CBOR"; type Credential = { type: "ScriptHash"; scriptHash: string; } | { type: "KeyHash"; keyHash: string; }; type GovernanceProposalInfo = { txHash: string; certIndex: number; governanceType: string; deposit: number; returnAddress: string; governanceDescription: string; ratifiedEpoch: number; enactedEpoch: number; droppedEpoch: number; expiredEpoch: number; expiration: number; metadata: object; }; type Rational = { numerator: string; denominator: string; }; type RewardAddress = string; type GovernanceActionId = { transactionId: string; govActionIndex: number; }; type ProtocolVersion = { major: number; minor: number; }; type ProtocolParamUpdate = { minFeeA?: string; minFeeB?: string; maxBlockBodySize?: number; maxTxSize?: number; maxBlockHeaderSize?: number; keyDeposit?: string; poolDeposit?: string; maxEpoch?: number; nOpt?: number; poolPledgeInfluence?: Rational; expansionRate?: Rational; treasuryGrowthRate?: Rational; minPoolCost?: string; adaPerUtxoByte?: string; costModels?: Record; executionCosts?: { memPrice?: Rational; stepPrice?: Rational; }; maxTxExUnits?: { mem: string; steps: string; }; maxBlockExUnits?: { mem: string; steps: string; }; maxValueSize?: number; collateralPercentage?: number; maxCollateralInputs?: number; poolVotingThresholds?: { motionNoConfidence?: Rational; committeeNormal?: Rational; committeeNoConfidence?: Rational; hardForkInitiation?: Rational; ppSecurityGroup?: Rational; }; drepVotingThresholds?: { motionNoConfidence?: Rational; committeeNormal?: Rational; committeeNoConfidence?: Rational; updateConstitution?: Rational; hardForkInitiation?: Rational; ppNetworkGroup?: Rational; ppEconomicGroup?: Rational; ppTechnicalGroup?: Rational; ppGovGroup?: Rational; treasuryWithdrawal?: Rational; }; minCommitteeSize?: number; committeeTermLimit?: number; govActionValidityPeriod?: number; govActionDeposit?: string; drepDeposit?: string; drepInactivityPeriod?: number; refScriptCostPerByte?: Rational; }; type CommitteeMember = { stakeCredential: Credential; termLimit: number; }; type Committee = { members: CommitteeMember[]; quorumThreshold: Rational; }; type Constitution = { anchor: Anchor; scriptHash?: ScriptHash; }; type TreasuryWithdrawals = Record; type ParameterChangeAction = { govActionId?: GovernanceActionId; protocolParamUpdates: ProtocolParamUpdate; policyHash?: ScriptHash; }; type HardForkInitiationAction = { govActionId?: GovernanceActionId; protocolVersion: ProtocolVersion; }; type TreasuryWithdrawalsAction = { withdrawals: TreasuryWithdrawals; policyHash?: ScriptHash; }; type NoConfidenceAction = { govActionId?: GovernanceActionId; }; type UpdateCommitteeAction = { govActionId?: GovernanceActionId; committee: Committee; membersToRemove: Credential[]; }; type NewConstitutionAction = { govActionId?: GovernanceActionId; constitution: Constitution; }; type InfoAction = {}; declare enum GovernanceActionKind { ParameterChangeAction = "ParameterChangeAction", HardForkInitiationAction = "HardForkInitiationAction", TreasuryWithdrawalsAction = "TreasuryWithdrawalsAction", NoConfidenceAction = "NoConfidenceAction", UpdateCommitteeAction = "UpdateCommitteeAction", NewConstitutionAction = "NewConstitutionAction", InfoAction = "InfoAction" } type GovernanceAction = { kind: "ParameterChangeAction"; action: ParameterChangeAction; } | { kind: "HardForkInitiationAction"; action: HardForkInitiationAction; } | { kind: "TreasuryWithdrawalsAction"; action: TreasuryWithdrawalsAction; } | { kind: "NoConfidenceAction"; action: NoConfidenceAction; } | { kind: "UpdateCommitteeAction"; action: UpdateCommitteeAction; } | { kind: "NewConstitutionAction"; action: NewConstitutionAction; } | { kind: "InfoAction"; action: InfoAction; }; type ProposalType = { governanceAction: GovernanceAction; anchor: Anchor; rewardAccount: RewardAddress; deposit: string; }; type BasicProposal = { type: "BasicProposal"; proposalType: ProposalType; }; type ScriptProposal = { type: "ScriptProposal"; proposalType: ProposalType; redeemer?: Redeemer; scriptSource?: ScriptSource; }; type SimpleScriptProposal = { type: "SimpleScriptProposal"; proposalType: ProposalType; simpleScriptSource?: SimpleScriptSourceInfo; }; type Proposal = BasicProposal | ScriptProposal | SimpleScriptProposal; type RefTxIn = { txHash: string; txIndex: number; scriptSize?: number; }; type TxInParameter = { txHash: string; txIndex: number; amount?: Asset[]; address?: string; scriptSize?: number; }; type TxIn = PubKeyTxIn | SimpleScriptTxIn | ScriptTxIn; type PubKeyTxIn = { type: "PubKey"; txIn: TxInParameter; }; type SimpleScriptTxIn = { type: "SimpleScript"; txIn: TxInParameter; simpleScriptTxIn: SimpleScriptTxInParameter; }; type SimpleScriptTxInParameter = { scriptSource?: SimpleScriptSourceInfo; }; type ScriptTxInParameter = { scriptSource?: ScriptSource; datumSource?: DatumSource; redeemer?: Redeemer; }; type ScriptTxIn = { type: "Script"; txIn: TxInParameter; scriptTxIn: ScriptTxInParameter; }; declare const txInToUtxo: (txIn: TxInParameter) => UTxO; type Vote = BasicVote | ScriptVote | SimpleScriptVote; type BasicVote = { type: "BasicVote"; vote: VoteType; }; type SimpleScriptVote = { type: "SimpleScriptVote"; vote: VoteType; simpleScriptSource: SimpleScriptSourceInfo; }; type ScriptVote = { type: "ScriptVote"; vote: VoteType; redeemer?: Redeemer; scriptSource?: ScriptSource; }; type VoteType = { voter: Voter; govActionId: RefTxIn; votingProcedure: VotingProcedure; }; type Voter = { type: "ConstitutionalCommittee"; hotCred: Credential; } | { type: "DRep"; drepId: string; } | { type: "StakingPool"; keyHash: string; }; type VotingProcedure = { voteKind: VoteKind; anchor?: Anchor; }; type VoteKind = "Yes" | "No" | "Abstain"; type Withdrawal = PubKeyWithdrawal | ScriptWithdrawal | SimpleScriptWithdrawal; type PubKeyWithdrawal = { type: "PubKeyWithdrawal"; address: string; coin: string; }; type ScriptWithdrawal = { type: "ScriptWithdrawal"; address: string; coin: string; scriptSource?: ScriptSource; redeemer?: Redeemer; }; type SimpleScriptWithdrawal = { type: "SimpleScriptWithdrawal"; address: string; coin: string; scriptSource?: SimpleScriptSourceInfo; }; type MeshTxBuilderBody = { inputs: TxIn[]; outputs: Output[]; fee: Quantity; collaterals: PubKeyTxIn[]; requiredSignatures: string[]; referenceInputs: RefTxIn[]; mints: MintParam[]; changeAddress: string; metadata: TxMetadata; scriptMetadata: ScriptMetadata[]; validityRange: ValidityRange; certificates: Certificate[]; withdrawals: Withdrawal[]; votes: Vote[]; proposals: Proposal[]; signingKey: string[]; extraInputs: UTxO[]; chainedTxs: string[]; inputsForEvaluation: Record; network: Network | number[][]; expectedNumberKeyWitnesses: number; expectedByronAddressWitnesses: string[]; totalCollateral?: Quantity; collateralReturnAddress?: string; }; declare const emptyTxBuilderBody: () => MeshTxBuilderBody; declare function cloneTxBuilderBody(body: MeshTxBuilderBody): MeshTxBuilderBody; type ValidityRange = { invalidBefore?: number; invalidHereafter?: number; }; type MetadatumMap = Map; type Metadatum = bigint | number | string | Uint8Array | MetadatumMap | Metadatum[]; type TxMetadata = Map; type Metadata = { tag: string; metadata: string; }; type ScriptMetadata = { scriptType: "PlutusV1" | "PlutusV2" | "PlutusV3" | "Native"; scriptCbor: string; }; type RequiredWith = Required & { [P in K]: Required; }; declare const validityRangeToObj: (validityRange: ValidityRange) => object; declare const validityRangeFromObj: (obj: any) => ValidityRange; type DeserializedAddress = { pubKeyHash: string; scriptHash: string; stakeCredentialHash: string; stakeScriptCredentialHash: string; }; type DeserializedScript = { scriptHash: string; scriptCbor?: string; }; interface IMintingBlueprint { version: LanguageVersion; cbor: string; hash: string; paramScript(compiledCode: string, params: string[], paramsType: PlutusDataType): this; noParamScript(compiledCode: string): this; } interface ISpendingBlueprint { version: LanguageVersion; networkId: number; cbor: string; hash: string; address: string; stakeHash?: string; isStakeScriptCredential: boolean; paramScript(compiledCode: string, params: string[], paramsType: PlutusDataType): this; noParamScript(compiledCode: string): this; } interface IWithdrawalBlueprint { version: LanguageVersion; networkId: number; cbor: string; hash: string; address: string; paramScript(compiledCode: string, params: string[], paramsType: PlutusDataType): this; noParamScript(compiledCode: string): this; } declare const DEFAULT_PROTOCOL_PARAMETERS: Protocol; declare const DREP_DEPOSIT = "500000000"; declare const VOTING_PROPOSAL_DEPOSIT = "100000000000"; declare const resolveTxFees: (txSize: number, minFeeA?: number, minFeeB?: number) => string; declare const SUPPORTED_WALLETS: string[]; declare const DEFAULT_V1_COST_MODEL_LIST: number[]; declare const DEFAULT_V2_COST_MODEL_LIST: number[]; declare const DEFAULT_V3_COST_MODEL_LIST: number[]; declare const SUPPORTED_LANGUAGE_VIEWS: Record>>; declare const resolveLanguageView: (era: Era, version: LanguageVersion) => string | undefined; declare const DEFAULT_REDEEMER_BUDGET: Budget; declare const POLICY_ID_LENGTH = 56; declare const LANGUAGE_VERSIONS: { V1: string; V2: string; V3: string; }; declare const HARDENED_KEY_START = 2147483648; declare const SUPPORTED_CLOCKS: Record; declare const SUPPORTED_HANDLES: Record; declare const SUPPORTED_OGMIOS_LINKS: Record; declare const SUPPORTED_TOKENS: { LQ: string; MIN: string; NTX: string; iBTC: string; iETH: string; iUSD: string; MILK: string; AGIX: string; MELD: string; INDY: string; CLAY: string; MCOS: string; DING: string; GERO: string; NMKR: string; PAVIA: string; HOSKY: string; YUMMI: string; C3: string; GIMBAL: string; SUNDAE: string; GREENS: string; GENS: string; SOCIETY: string; DJED: string; SHEN: string; WMT: string; COPI: string; }; /** * The utility function to append the bytes for CIP-68 100 token in front of the token hex * @param tokenNameHex The hex of the token name * @returns The hex of the token name with the CIP-68 100 bytes appended */ declare const CIP68_100: (tokenNameHex: string) => string; /** * The utility function to append the bytes for CIP-68 222 token in front of the token hex * @param tokenNameHex The hex of the token name * @returns The hex of the token name with the CIP-68 222 bytes appended */ declare const CIP68_222: (tokenNameHex: string) => string; type IFetcherOptions = { maxPage?: number; order?: "asc" | "desc"; [key: string]: any; }; declare const DEFAULT_FETCHER_OPTIONS: IFetcherOptions; /** * Fetcher interface defines end points to query blockchain data. */ interface IFetcher { fetchAccountInfo(address: string): Promise; fetchAddressUTxOs(address: string, asset?: string): Promise; fetchAddressTxs(address: string, options?: IFetcherOptions): Promise; fetchAssetAddresses(asset: string): Promise<{ address: string; quantity: string; }[]>; fetchAssetMetadata(asset: string): Promise; fetchBlockInfo(hash: string): Promise; fetchCollectionAssets(policyId: string, cursor?: number | string): Promise<{ assets: Asset[]; next?: string | number | null; }>; fetchProtocolParameters(epoch: number): Promise; fetchTxInfo(hash: string): Promise; fetchUTxOs(hash: string, index?: number): Promise; fetchGovernanceProposal(txHash: string, certIndex: number): Promise; get(url: string): Promise; } interface IInitiator { getChangeAddress(): Promise; getCollateral(): Promise; getUtxos(): Promise; } interface IListener { onTxConfirmed(txHash: string, callback: () => void, limit?: number): void; } interface ISubmitter { submitTx(tx: string): Promise; } /** * TxTester class for evaluating transactions */ declare class TxTester { txBody: MeshTxBuilderBody; inputsEvaluating: TxIn[]; outputsEvaluating: Output[]; traces: string[]; /** * Create a new TxTester instance * @param txBody The transaction builder body */ constructor(txBody: MeshTxBuilderBody); /** * Add a trace to the TxTester * @param funcName The function name where the error occurred * @param message The error message */ addTrace(funcName: string, message: string): void; /** * Check if the transaction evaluation was successful * @returns true if there are no errors, false otherwise */ success(): boolean; /** * Get the error messages if any * @returns A string representation of the errors or "No errors" if there are none */ errors(): string; /** * Checks if the transaction is valid after a specified timestamp. * @param requiredTimestamp The timestamp after which the transaction should be valid * @returns The TxTester instance for chaining */ validAfter: (requiredTimestamp: number) => this; /** * Checks if the transaction is valid before a specified timestamp. * @param requiredTimestamp The timestamp before which the transaction should be valid * @returns The TxTester instance for chaining */ validBefore: (requiredTimestamp: number) => this; /** * Checks if a specific key is signed in the transaction. * @param keyHash The key hash to check * @returns The TxTester instance for chaining */ keySigned: (keyHash: string) => this; /** * Checks if any one of the specified keys is signed in the transaction. * @param keyHashes The array of key hashes to check * @returns The TxTester instance for chaining */ oneOfKeysSigned: (keyHashes: string[]) => this; /** * Checks if all specified keys are signed in the transaction. * @param keyHashes The array of key hashes to check * @returns The TxTester instance for chaining */ allKeysSigned: (keyHashes: string[]) => this; /** * Checks if a specific token is minted in the transaction. * @param policyId The policy ID of the token * @param assetName The asset name of the token * @param quantity The quantity of the token * @returns The TxTester instance for chaining */ tokenMinted: (policyId: string, assetName: string, quantity: number) => this; /** * Checks if a specific token is minted in the transaction and that it is the only mint. * @param policyId The policy ID of the token * @param assetName The asset name of the token * @param quantity The quantity of the token * @returns The TxTester instance for chaining */ onlyTokenMinted: (policyId: string, assetName: string, quantity: number) => this; /** * Checks if a specific token is minted in the transaction, ensuring that it is the only mint for the given policy ID. * @param policyId The policy ID of the token * @param assetName The asset name of the token * @param quantity The quantity of the token * @returns The TxTester instance for chaining */ policyOnlyMintedToken: (policyId: string, assetName: string, quantity: number) => this; /** * Checks if a specific policy ID is burned in the transaction, ensuring that it is the only minting (i.e. burning item). * @param policyId The policy ID to check * @returns true if the policy is the only burn, false otherwise */ checkPolicyOnlyBurn: (policyId: string) => boolean; /** * Not apply filter to inputs * @returns The TxTester instance for chaining */ allInputs: () => this; /** * Filter inputs by address * @param address The address to filter by * @returns The TxTester instance for chaining */ inputsAt: (address: string) => this; /** * Filter inputs by unit * @param unit The unit to filter by * @returns The TxTester instance for chaining */ inputsWith: (unit: string) => this; /** * Filter inputs by policy ID * @param policyId The policy ID to filter by * @returns The TxTester instance for chaining */ inputsWithPolicy: (policyId: string) => this; /** * Filter inputs by address and policy ID * @param address The address to filter by * @param policyId The policy ID to filter by * @returns The TxTester instance for chaining */ inputsAtWithPolicy: (address: string, policyId: string) => this; /** * Filter inputs by address and unit * @param address The address to filter by * @param unit The unit to filter by * @returns The TxTester instance for chaining */ inputsAtWith: (address: string, unit: string) => this; /** * Check if inputs contain the expected value. * *Reminder - It must be called after filtering methods for inputs* * @param expectedValue The expected value * @returns The TxTester instance for chaining */ inputsValue: (expectedValue: any) => this; /** * Not apply filter to outputs * @returns The TxTester instance for chaining */ allOutputs: () => this; /** * Filter outputs by address * @param address The address to filter by * @returns The TxTester instance for chaining */ outputsAt: (address: string) => this; /** * Filter outputs by unit * @param unit The unit to filter by * @returns The TxTester instance for chaining */ outputsWith: (unit: string) => this; /** * Filter outputs by policy ID * @param policyId The policy ID to filter by * @returns The TxTester instance for chaining */ outputsWithPolicy: (policyId: string) => this; /** * Filter outputs by address and policy ID * @param address The address to filter by * @param policyId The policy ID to filter by * @returns The TxTester instance for chaining */ outputsAtWithPolicy: (address: string, policyId: string) => this; /** * Filter outputs by address and unit * @param address The address to filter by * @param unit The unit to filter by * @returns The TxTester instance for chaining */ outputsAtWith: (address: string, unit: string) => this; /** * Check if outputs contain the expected value. * *Reminder - It must be called after filtering methods for outputs* * @param expectedValue The expected value * @returns The TxTester instance for chaining */ outputsValue: (expectedValue: MeshValue) => this; /** * Check if outputs contain a specific inline datum. * *Reminder - It must be called after filtering methods for outputs* * @param datumCbor The datum CBOR to check * @returns The TxTester instance for chaining */ outputsInlineDatumExist: (datumCbor: string) => this; } /** * Internal logic to check if a key is signed * @param requiredSignatures The required signatures of the tx builder body * @param keyHash The key hash to check * @returns true if the key is signed, false otherwise */ declare function keySignedLogic(requiredSignatures: string[], keyHash: string): boolean; /** * Internal logic to check if a token is minted * @param mints The mints info of the tx builder body * @param policyId The policy ID of the token * @param assetName The asset name of the token * @param quantity The quantity of the token * @returns true if the token is minted, false otherwise */ declare function tokenMintedLogic(mints: MintParam[], policyId: string, assetName: string, quantity: number): boolean; interface IMeshTxSerializer { serializeTxBody(txBuilderBody: MeshTxBuilderBody, protocolParams: Protocol): string; serializeTxBodyWithMockSignatures(txBuilderBody: MeshTxBuilderBody, protocolParams: Protocol): string; addSigningKeys(txHex: string, signingKeys: string[]): string; serializeData(data: BuilderData): string; serializeAddress(address: DeserializedAddress, networkId?: 0 | 1): string; serializePoolId(hash: string): string; serializeRewardAddress(stakeKeyHash: string, isScriptHash?: boolean, network_id?: 0 | 1): string; serializeOutput(output: Output): string; serializeValue(value: Asset[]): string; resolver: IResolver; deserializer: IDeserializer; parser: ITxParser; } interface ITxParser { getRequiredInputs(txHex: string): TxInput[]; parse(txHex: string, resolvedUtxos?: UTxO[]): void; toTester(): TxTester; getBuilderBody(): MeshTxBuilderBody; getBuilderBodyWithoutChange(): MeshTxBuilderBody; } interface IResolver { keys: { resolvePrivateKey(words: string[]): string; resolveRewardAddress(bech32: string): string; resolveEd25519KeyHash(bech32: string): string; resolveStakeKeyHash(bech32: string): string; }; tx: { resolveTxHash(txHex: string): string; }; data: { resolveDataHash(rawData: BuilderData["content"], type?: PlutusDataType): string; }; script: { resolveScriptRef(script: NativeScript | PlutusScript): string; }; } interface IDeserializer { key: { deserializeAddress(bech32: string): DeserializedAddress; }; script: { deserializeNativeScript(script: NativeScript): DeserializedScript; deserializePlutusScript(script: PlutusScript): DeserializedScript; }; cert: { deserializePoolId(poolId: string): string; }; } interface ISigner { signData(payload: string, address?: string): Promise; signTx(unsignedTx: string, partialSign?: boolean, returnFullTx?: boolean): Promise; signTxs(unsignedTxs: string[], partialSign?: boolean): Promise; } interface IEvaluator { evaluateTx(tx: string, additionalUtxos?: UTxO[], additionalTxs?: string[]): Promise[]>; } interface IWallet extends IInitiator, ISigner, ISubmitter { getAssets(): Promise; getBalance(): Promise; getExtensions(): Promise; getUsedAddresses(): Promise; getLovelace(): Promise; getNetworkId(): Promise; getRewardAddresses(): Promise; getDRep(): Promise<{ publicKey: string; publicKeyHash: string; dRepIDCip105: string; } | undefined>; getUnusedAddresses(): Promise; getPolicyIdAssets(policyId: string): Promise; getPolicyIds(): Promise; getRegisteredPubStakeKeys(): Promise<{ pubStakeKeys: string[]; pubStakeKeyHashes: string[]; } | undefined>; getUnregisteredPubStakeKeys(): Promise<{ pubStakeKeys: string[]; pubStakeKeyHashes: string[]; } | undefined>; } declare const resolveFingerprint: (policyId: string, assetName: string) => string; declare class AssetFingerprint { readonly hashBuf: Uint8Array; private constructor(); static fromHash(hash: Uint8Array): AssetFingerprint; static fromParts(policyId: Uint8Array, assetName: Uint8Array): AssetFingerprint; static fromBech32(fingerprint: string): AssetFingerprint; fingerprint(): string; hash(): string; prefix(): string; checksum(): string; } declare class BigNum { value: bigint; constructor(value?: bigint | number | string); static new(value: number | string | bigint | undefined): BigNum; divFloor(other: BigNum): BigNum; checkedMul(other: BigNum): BigNum; checkedAdd(other: BigNum): BigNum; checkedSub(other: BigNum): BigNum; clampedSub(other: BigNum): BigNum; lessThan(other: BigNum): boolean; compare(other: BigNum): -1 | 0 | 1; toString(): string; } declare const hashDrepAnchor: (jsonLD: object) => string; declare function getFile(url: string): string; declare const experimentalSelectUtxos: (requiredAssets: Map, inputs: UTxO[], threshold: Quantity) => UTxO[]; declare const keepRelevant: (requiredAssets: Map, inputs: UTxO[], threshold?: string) => UTxO[]; declare const largestFirst: (lovelace: Quantity, initialUTxOSet: UTxO[], includeTxFees?: boolean, { maxTxSize, minFeeA, minFeeB }?: Protocol) => UTxO[]; declare const largestFirstMultiAsset: (requestedOutputSet: Map, initialUTxOSet: UTxO[], includeTxFees?: boolean, parameters?: Protocol) => UTxO[]; /** * All UTxO selection algorithms follows below's interface * * Supported algorithms: * - largestFirst - CIP2 suggested algorithm * - largestFirstMultiAsset - CIP2 suggested algorithm * - keepRelevant - CIP2 suggested algorithm * - experimental - The always evolving algorithm according to the latest research * * @param requestedOutputSet * @param initialUTxOSet * @returns */ declare class UtxoSelection { private threshold; private includeTxFees; constructor(threshold?: string, includeTxFees?: boolean); largestFirst(requiredAssets: Map, inputs: UTxO[]): UTxO[]; keepRelevant(requiredAssets: Map, inputs: UTxO[]): UTxO[]; largestFirstMultiAsset(requiredAssets: Map, inputs: UTxO[]): UTxO[]; experimental(requiredAssets: Map, inputs: UTxO[]): UTxO[]; } type UtxoSelectionStrategy = keyof UtxoSelection; export { type AccountInfo, type Action, type Anchor, type Asset, type AssetClass, type AssetExtended, AssetFingerprint, type AssetMetadata, type AssetName, type AssocMap, type AssocMapItem, type BasicProposal, type BasicVote, BigNum, type BlockInfo, type Bool, type Budget, type BuilderData, type BuiltinByteString, type ByteString, CIP68_100, CIP68_222, type Certificate, type CertificateType, type Committee, type CommitteeMember, type ConStr, type ConStr0, type ConStr1, type ConStr2, type ConStr3, type Constitution, type Credential$1 as Credential, type CurrencySymbol, DEFAULT_FETCHER_OPTIONS, DEFAULT_PROTOCOL_PARAMETERS, DEFAULT_REDEEMER_BUDGET, DEFAULT_V1_COST_MODEL_LIST, DEFAULT_V2_COST_MODEL_LIST, DEFAULT_V3_COST_MODEL_LIST, DREP_DEPOSIT, type DRep, type Data, type DataSignature, type DatumSource, type DeserializedAddress, type DeserializedScript, type Dict, type DictItem, type Era, type Extension, type Files, type ForkNeighbor, type FungibleAssetMetadata, type GovernanceAction, type GovernanceActionId, GovernanceActionKind, type GovernanceProposalInfo, HARDENED_KEY_START, type HardForkInitiationAction, type IDeserializer, type IEvaluator, type IFetcher, type IFetcherOptions, type IInitiator, type IListener, type IMeshTxSerializer, type IMintingBlueprint, type IResolver, type ISigner, type ISpendingBlueprint, type ISubmitter, type ITxParser, type IWallet, type IWithdrawalBlueprint, type ImageAssetMetadata, type InfoAction, type Integer, LANGUAGE_VERSIONS, type LanguageVersion, type List, type MAssetClass, type MBool, type MConStr, type MConStr0, type MConStr1, type MConStr2, type MConStr3, type MCredential, type MMaybeStakingHash, type MNone, type MOption, type MOutputReference, type MPubKeyAddress, type MScript, type MScriptAddress, type MSome, type MTuple, type MTxOutRef, type MValue, type MVerificationKey, type MaybeStakingHash, type MeshTxBuilderBody, MeshValue, type Message, type Metadata, type Metadatum, type MetadatumMap, type Mint, type MintItem, type MintParam, type NativeScript, type Network, type NewConstitutionAction, type NoConfidenceAction, type NonFungibleAssetMetadata, type None, type Option, type Output, type OutputReference, POLICY_ID_LENGTH, type POSIXTime, type Pair, type Pairs, type ParameterChangeAction, type PlutusData, type PlutusDataType, type PlutusScript, type PolicyId, type PoolMetadata, type PoolParams, type ProofStep, type ProofStepBranch, type ProofStepFork, type ProofStepLeaf, type Proposal, type ProposalType, type Protocol, type ProtocolParamUpdate, type ProtocolVersion, type PubKeyAddress, type PubKeyHash, type PubKeyTxIn, type PubKeyWithdrawal, type Quantity, type Rational, type Recipient, type Redeemer, type RedeemerTagType, type RefTxIn, type Relay, type RequiredWith, type RewardAddress, type RoyaltiesStandard, SLOT_CONFIG_NETWORK, SUPPORTED_CLOCKS, SUPPORTED_HANDLES, SUPPORTED_LANGUAGE_VIEWS, SUPPORTED_OGMIOS_LINKS, SUPPORTED_TOKENS, SUPPORTED_WALLETS, type Script, type ScriptAddress, type ScriptHash, type ScriptMetadata, type ScriptProposal, type ScriptSource, type ScriptTxIn, type ScriptTxInParameter, type ScriptVote, type ScriptWithdrawal, type SimpleScriptProposal, type SimpleScriptSourceInfo, type SimpleScriptTxIn, type SimpleScriptTxInParameter, type SimpleScriptVote, type SimpleScriptWithdrawal, type SlotConfig, type Some, type Token, type TokenName, type TransactionInfo, type TreasuryWithdrawals, type TreasuryWithdrawalsAction, type Tuple, type TxIn, type TxInParameter, type TxInput, type TxMetadata, type TxOutRef, type TxOutput, TxTester, type UTxO, type Unit, type UpdateCommitteeAction, UtxoSelection, type UtxoSelectionStrategy, VOTING_PROPOSAL_DEPOSIT, type ValidityRange, type Value, type VerificationKey, type Vote, type VoteKind, type VoteType, type Voter, type VotingProcedure, type Wallet, type Withdrawal, assetClass, assetName, assocMap, bool, builtinByteString, byteString, bytesToHex, castProtocol, cloneTxBuilderBody, conStr, conStr0, conStr1, conStr2, conStr3, credential, currencySymbol, dict, emptyTxBuilderBody, experimentalSelectUtxos, fromUTF8, fungibleAssetKeys, getFile, hashByteString, hashDrepAnchor, hexToBytes, hexToString, integer, isHexString, isNetwork, jsonProofToPlutusData, keepRelevant, keySignedLogic, largestFirst, largestFirstMultiAsset, list, mAssetClass, mBool, mConStr, mConStr0, mConStr1, mConStr2, mConStr3, mCredential, mMaybeStakingHash, mNone, mOption, mOutputReference, mPlutusBSArrayToString, mPubKeyAddress, mScript, mScriptAddress, mSome, mStringToPlutusBSArray, mTuple, mTxOutRef, mValue, mVerificationKey, maybeStakingHash, mergeAssets, metadataStandardKeys, metadataToCip68, none, option, outputReference, pairs, parseAssetUnit, plutusBSArrayToString, policyId, posixTime, pubKeyAddress, pubKeyHash, resolveEpochNo, resolveFingerprint, resolveLanguageView, resolveSlotNo, resolveTxFees, royaltiesStandardKeys, script, scriptAddress, scriptHash, slotToBeginUnixTime, some, stringToBSArray, stringToHex, toBytes, toUTF8, tokenMintedLogic, tokenName, tuple, txInToUtxo, txOutRef, unixTimeToEnclosingSlot, validityRangeFromObj, validityRangeToObj, value, verificationKey };