cardano/tx
This module incorporates additional code that expands the functionality of the standard library.
Functions
Create an OutputReference
from the TxId#Idx
information. This is useful
for building correct output references of specific UTxOs. It can be combined
with the find
module for some very convenient requests.
tx.output_reference(that_tx_id, that_tx_idx)
Check if the list of signatures inside a transaction contains the verification key.
tx.verify_signature(context.transaction, wallet_pkh)
verify_multisig(
sigs: List<VerificationKeyHash>,
vks: List<VerificationKeyHash>,
minimum: Int,
) -> Bool
This counts the number of signatures inside a transaction that are from the list of signers then checks if its at least the minimum amount.
tx.verify_multisig(context.transaction, lst_of_sigs, sig_threshold)
Check if a specific input by output reference is being spent. This is useful when a minting script requires a utxo to be spent but doesn’t need any specific information about that input.
tx.is_spending_input(tx.inputs, output_reference)
Given a set of validator hashes prove that none of them are being spent. Assume every address is not staked and that the is list is complete.
tx.not_being_spent_from(not_these_vkhs, tx.inputs)
Calculate the total amount of a token within the set of inputs for the transaction and check if it is at least equal to the provided threshold.
tx.total_token_amount(tx.inputs, datum.pid, datum.tkn, datum.threshold)