pub struct TxInputsBuilder { /* private fields */ }
Implementations§
Source§impl TxInputsBuilder
impl TxInputsBuilder
pub fn new() -> Self
pub fn add_regular_utxo( &mut self, utxo: &TransactionUnspentOutput, ) -> Result<(), JsError>
pub fn add_plutus_script_utxo( &mut self, utxo: &TransactionUnspentOutput, witness: &PlutusWitness, ) -> Result<(), JsError>
pub fn add_native_script_utxo( &mut self, utxo: &TransactionUnspentOutput, witness: &NativeScriptSource, ) -> Result<(), JsError>
Sourcepub fn add_key_input(
&mut self,
hash: &Ed25519KeyHash,
input: &TransactionInput,
amount: &Value,
)
pub fn add_key_input( &mut self, hash: &Ed25519KeyHash, input: &TransactionInput, amount: &Value, )
We have to know what kind of inputs these are to know what kind of mock witnesses to create since
- mock witnesses have different lengths depending on the type which changes the expecting fee
- Witnesses are a set so we need to get rid of duplicates to avoid over-estimating the fee
Sourcepub fn add_native_script_input(
&mut self,
script: &NativeScriptSource,
input: &TransactionInput,
amount: &Value,
)
pub fn add_native_script_input( &mut self, script: &NativeScriptSource, input: &TransactionInput, amount: &Value, )
This method will add the input to the builder and also register the required native script witness
Sourcepub fn add_plutus_script_input(
&mut self,
witness: &PlutusWitness,
input: &TransactionInput,
amount: &Value,
)
pub fn add_plutus_script_input( &mut self, witness: &PlutusWitness, input: &TransactionInput, amount: &Value, )
This method will add the input to the builder and also register the required plutus witness
pub fn add_bootstrap_input( &mut self, address: &ByronAddress, input: &TransactionInput, amount: &Value, )
Sourcepub fn add_regular_input(
&mut self,
address: &Address,
input: &TransactionInput,
amount: &Value,
) -> Result<(), JsError>
pub fn add_regular_input( &mut self, address: &Address, input: &TransactionInput, amount: &Value, ) -> Result<(), JsError>
Adds non script input, in case of script or reward address input it will return an error
pub fn get_ref_inputs(&self) -> TransactionInputs
Sourcepub fn get_native_input_scripts(&self) -> Option<NativeScripts>
pub fn get_native_input_scripts(&self) -> Option<NativeScripts>
Returns a copy of the current script input witness scripts in the builder
Sourcepub fn get_plutus_input_scripts(&self) -> Option<PlutusWitnesses>
pub fn get_plutus_input_scripts(&self) -> Option<PlutusWitnesses>
Returns a copy of the current plutus input witness scripts in the builder. NOTE: each plutus witness will be cloned with a specific corresponding input index
pub fn len(&self) -> usize
pub fn add_required_signer(&mut self, key: &Ed25519KeyHash)
pub fn add_required_signers(&mut self, keys: &RequiredSigners)
pub fn total_value(&self) -> Result<Value, JsError>
pub fn inputs(&self) -> TransactionInputs
pub fn inputs_option(&self) -> Option<TransactionInputs>
Trait Implementations§
Source§impl Clone for TxInputsBuilder
impl Clone for TxInputsBuilder
Source§fn clone(&self) -> TxInputsBuilder
fn clone(&self) -> TxInputsBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TxInputsBuilder
impl Debug for TxInputsBuilder
Source§impl From<&TxInputsBuilder> for Ed25519KeyHashes
impl From<&TxInputsBuilder> for Ed25519KeyHashes
Source§fn from(inputs: &TxInputsBuilder) -> Self
fn from(inputs: &TxInputsBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TxInputsBuilder
impl RefUnwindSafe for TxInputsBuilder
impl !Send for TxInputsBuilder
impl !Sync for TxInputsBuilder
impl Unpin for TxInputsBuilder
impl UnwindSafe for TxInputsBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more