pub struct TxBuilder {Show 19 fields
pub core: TxBuilderCore,
pub protocol_params: Option<Protocol>,
pub tx_in_item: Option<TxIn>,
pub withdrawal_item: Option<Withdrawal>,
pub vote_item: Option<Vote>,
pub mint_item: Option<MintItem>,
pub collateral_item: Option<PubKeyTxIn>,
pub tx_output: Option<Output>,
pub adding_script_input: Option<LanguageVersion>,
pub adding_plutus_mint: Option<LanguageVersion>,
pub adding_plutus_withdrawal: Option<LanguageVersion>,
pub adding_plutus_vote: Option<LanguageVersion>,
pub fetcher: Option<Box<dyn Fetcher>>,
pub evaluator: Option<Box<dyn Evaluator>>,
pub submitter: Option<Box<dyn Submitter>>,
pub extra_inputs: Vec<UTxO>,
pub selection_threshold: u64,
pub chained_txs: Vec<String>,
pub inputs_for_evaluation: HashMap<String, UTxO>,
}
Fields§
§core: TxBuilderCore
§protocol_params: Option<Protocol>
§tx_in_item: Option<TxIn>
§withdrawal_item: Option<Withdrawal>
§vote_item: Option<Vote>
§mint_item: Option<MintItem>
§collateral_item: Option<PubKeyTxIn>
§tx_output: Option<Output>
§adding_script_input: Option<LanguageVersion>
§adding_plutus_mint: Option<LanguageVersion>
§adding_plutus_withdrawal: Option<LanguageVersion>
§adding_plutus_vote: Option<LanguageVersion>
§fetcher: Option<Box<dyn Fetcher>>
§evaluator: Option<Box<dyn Evaluator>>
§submitter: Option<Box<dyn Submitter>>
§extra_inputs: Vec<UTxO>
§selection_threshold: u64
§chained_txs: Vec<String>
§inputs_for_evaluation: HashMap<String, UTxO>
Implementations§
source§impl TxBuilder
impl TxBuilder
sourcepub fn register_pool_certificate(
&mut self,
pool_params: &PoolParams,
) -> &mut Self
pub fn register_pool_certificate( &mut self, pool_params: &PoolParams, ) -> &mut Self
sourcepub fn register_stake_certificate(
&mut self,
stake_key_address: &str,
) -> &mut Self
pub fn register_stake_certificate( &mut self, stake_key_address: &str, ) -> &mut Self
sourcepub fn delegate_stake_certificate(
&mut self,
stake_key_address: &str,
pool_id: &str,
) -> &mut Self
pub fn delegate_stake_certificate( &mut self, stake_key_address: &str, pool_id: &str, ) -> &mut Self
sourcepub fn deregister_stake_certificate(
&mut self,
stake_key_address: &str,
) -> &mut Self
pub fn deregister_stake_certificate( &mut self, stake_key_address: &str, ) -> &mut Self
sourcepub fn retire_pool_certificate(
&mut self,
pool_id: &str,
epoch: u32,
) -> &mut Self
pub fn retire_pool_certificate( &mut self, pool_id: &str, epoch: u32, ) -> &mut Self
sourcepub fn vote_delegation_certificate(
&mut self,
stake_key_address: &str,
drep: &DRep,
) -> &mut Self
pub fn vote_delegation_certificate( &mut self, stake_key_address: &str, drep: &DRep, ) -> &mut Self
sourcepub fn stake_and_vote_delegation_certificate(
&mut self,
stake_key_address: &str,
pool_key_hash: &str,
drep: &DRep,
) -> &mut Self
pub fn stake_and_vote_delegation_certificate( &mut self, stake_key_address: &str, pool_key_hash: &str, drep: &DRep, ) -> &mut Self
§Transaction building method
Add a stake and vote delegation certificate to the TxBuilder instance
§Arguments
stake_key_address
- Address of the stake keypool_key_hash
- Hash of pool key that will be delegated to, same as pool iddrep
- The drep that will be voted for, or always abstain / always no confidence
§Returns
Self
- The TxBuilder instance
sourcepub fn stake_registration_and_delegation(
&mut self,
stake_key_address: &str,
pool_key_hash: &str,
coin: u64,
) -> &mut Self
pub fn stake_registration_and_delegation( &mut self, stake_key_address: &str, pool_key_hash: &str, coin: u64, ) -> &mut Self
§Transaction building method
Add a stake registration and delegation certificate to the TxBuilder instance
§Arguments
stake_key_address
- Address of the stake keypool_key_hash
- Hash of pool key that will be delegated to, same as pool idcoin
- Deposit for certificate registration
§Returns
Self
- The TxBuilder instance
sourcepub fn vote_registration_and_delegation(
&mut self,
stake_key_address: &str,
drep: &DRep,
coin: u64,
) -> &mut Self
pub fn vote_registration_and_delegation( &mut self, stake_key_address: &str, drep: &DRep, coin: u64, ) -> &mut Self
§Transaction building method
Add a vote registration and delegation certificate to the TxBuilder instance
§Arguments
stake_key_address
- Address of the stake keydrep
- The drep that will be voted for, or always abstain / always no confidencecoin
- Deposit for certificate registration
§Returns
Self
- The TxBuilder instance
sourcepub fn stake_vote_registration_and_delegation(
&mut self,
stake_key_address: &str,
pool_key_hash: &str,
drep: &DRep,
coin: u64,
) -> &mut Self
pub fn stake_vote_registration_and_delegation( &mut self, stake_key_address: &str, pool_key_hash: &str, drep: &DRep, coin: u64, ) -> &mut Self
§Transaction building method
Add a stake vote registration and delegation certificate to the TxBuilder instance
§Arguments
stake_key_address
- Address of the stake keypool_key_hash
- Hash of pool key that will be delegated to, same as pool iddrep
- The drep that will be voted for, or always abstain / always no confidencecoin
- Deposit for certificate registration
§Returns
Self
- The TxBuilder instance
sourcepub fn committee_hot_auth(
&mut self,
committee_cold_key_address: &str,
committee_hot_key_address: &str,
) -> &mut Self
pub fn committee_hot_auth( &mut self, committee_cold_key_address: &str, committee_hot_key_address: &str, ) -> &mut Self
sourcepub fn commitee_cold_resign(
&mut self,
committee_cold_key_address: &str,
anchor: Option<Anchor>,
) -> &mut Self
pub fn commitee_cold_resign( &mut self, committee_cold_key_address: &str, anchor: Option<Anchor>, ) -> &mut Self
sourcepub fn drep_registration(
&mut self,
drep_id: &str,
coin: u64,
anchor: Option<Anchor>,
) -> &mut Self
pub fn drep_registration( &mut self, drep_id: &str, coin: u64, anchor: Option<Anchor>, ) -> &mut Self
sourcepub fn drep_deregistration(&mut self, drep_id: &str, coin: u64) -> &mut Self
pub fn drep_deregistration(&mut self, drep_id: &str, coin: u64) -> &mut Self
sourcepub fn certificate_script(
&mut self,
script_cbor: &str,
version: Option<LanguageVersion>,
) -> &mut Self
pub fn certificate_script( &mut self, script_cbor: &str, version: Option<LanguageVersion>, ) -> &mut Self
sourcepub fn certificate_tx_in_reference(
&mut self,
tx_hash: &str,
tx_index: u32,
script_hash: &str,
version: Option<LanguageVersion>,
script_size: usize,
) -> &mut Self
pub fn certificate_tx_in_reference( &mut self, tx_hash: &str, tx_index: u32, script_hash: &str, version: Option<LanguageVersion>, script_size: usize, ) -> &mut Self
§Transaction building method
Add a Certificate transaction input reference to the TxBuilder instance
§Arguments
tx_hash
- The transaction hashtx_index
- The transaction indexscript_hash
- The script hashversion
- The language version, if the language version is None, the script is assumed to be a Native Scriptscript_size
- Size of the script
§Returns
Self
- The TxBuilder instance
source§impl TxBuilder
impl TxBuilder
sourcepub async fn complete(
&mut self,
customized_tx: Option<TxBuilderBody>,
) -> Result<&mut Self, JsError>
pub async fn complete( &mut self, customized_tx: Option<TxBuilderBody>, ) -> Result<&mut Self, JsError>
sourcepub fn complete_sync(
&mut self,
customized_tx: Option<TxBuilderBody>,
) -> Result<&mut Self, JsError>
pub fn complete_sync( &mut self, customized_tx: Option<TxBuilderBody>, ) -> Result<&mut Self, JsError>
sourcepub fn complete_signing(&mut self) -> Result<String, JsError>
pub fn complete_signing(&mut self) -> Result<String, JsError>
source§impl TxBuilder
impl TxBuilder
sourcepub fn mint_plutus_script(
&mut self,
language_version: &LanguageVersion,
) -> &mut Self
pub fn mint_plutus_script( &mut self, language_version: &LanguageVersion, ) -> &mut Self
sourcepub fn mint_plutus_script_v1(&mut self) -> &mut Self
pub fn mint_plutus_script_v1(&mut self) -> &mut Self
sourcepub fn mint_plutus_script_v2(&mut self) -> &mut Self
pub fn mint_plutus_script_v2(&mut self) -> &mut Self
sourcepub fn mint_plutus_script_v3(&mut self) -> &mut Self
pub fn mint_plutus_script_v3(&mut self) -> &mut Self
sourcepub fn minting_script(&mut self, script_cbor: &str) -> &mut Self
pub fn minting_script(&mut self, script_cbor: &str) -> &mut Self
sourcepub fn mint_tx_in_reference(
&mut self,
tx_hash: &str,
tx_index: u32,
script_hash: &str,
script_size: usize,
) -> &mut Self
pub fn mint_tx_in_reference( &mut self, tx_hash: &str, tx_index: u32, script_hash: &str, script_size: usize, ) -> &mut Self
§Transaction building method
Add a minting transaction input reference to the TxBuilder instance
§Arguments
tx_hash
- The transaction hashtx_index
- The transaction indexscript_hash
- The script hashversion
- The language version, if the language version is None, the script is assumed to be a Native Scriptscript_size
- Size of the script
§Returns
Self
- The TxBuilder instance
sourcepub fn mint_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self
pub fn mint_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self
source§impl TxBuilder
impl TxBuilder
pub fn set_evaluator(&mut self, evaluator: Box<dyn Evaluator>) -> &mut Self
source§impl TxBuilder
impl TxBuilder
sourcepub fn spending_plutus_script(
&mut self,
language_version: &LanguageVersion,
) -> &mut Self
pub fn spending_plutus_script( &mut self, language_version: &LanguageVersion, ) -> &mut Self
sourcepub fn spending_plutus_script_v1(&mut self) -> &mut Self
pub fn spending_plutus_script_v1(&mut self) -> &mut Self
sourcepub fn spending_plutus_script_v2(&mut self) -> &mut Self
pub fn spending_plutus_script_v2(&mut self) -> &mut Self
sourcepub fn spending_plutus_script_v3(&mut self) -> &mut Self
pub fn spending_plutus_script_v3(&mut self) -> &mut Self
sourcepub fn tx_in(
&mut self,
tx_hash: &str,
tx_index: u32,
amount: &[Asset],
address: &str,
) -> &mut Self
pub fn tx_in( &mut self, tx_hash: &str, tx_index: u32, amount: &[Asset], address: &str, ) -> &mut Self
sourcepub fn tx_in_script(&mut self, script_cbor: &str) -> &mut Self
pub fn tx_in_script(&mut self, script_cbor: &str) -> &mut Self
sourcepub fn tx_in_datum_value(&mut self, data: &WData) -> &mut Self
pub fn tx_in_datum_value(&mut self, data: &WData) -> &mut Self
sourcepub fn tx_in_inline_datum_present(&mut self) -> &mut Self
pub fn tx_in_inline_datum_present(&mut self) -> &mut Self
sourcepub fn tx_in_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self
pub fn tx_in_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self
sourcepub fn spending_tx_in_reference(
&mut self,
tx_hash: &str,
tx_index: u32,
script_hash: &str,
script_size: usize,
) -> &mut Self
pub fn spending_tx_in_reference( &mut self, tx_hash: &str, tx_index: u32, script_hash: &str, script_size: usize, ) -> &mut Self
sourcepub fn spending_reference_tx_in_inline_datum_present(&mut self) -> &mut Self
pub fn spending_reference_tx_in_inline_datum_present(&mut self) -> &mut Self
sourcepub fn spending_reference_tx_in_redeemer_value(
&mut self,
redeemer: &WRedeemer,
) -> &mut Self
pub fn spending_reference_tx_in_redeemer_value( &mut self, redeemer: &WRedeemer, ) -> &mut Self
sourcepub fn read_only_tx_in_reference(
&mut self,
tx_hash: &str,
tx_index: u32,
) -> &mut Self
pub fn read_only_tx_in_reference( &mut self, tx_hash: &str, tx_index: u32, ) -> &mut Self
source§impl TxBuilder
impl TxBuilder
sourcepub fn tx_out_datum_hash_value(&mut self, data: &WData) -> &mut Self
pub fn tx_out_datum_hash_value(&mut self, data: &WData) -> &mut Self
sourcepub fn tx_out_datum_embed_value(&mut self, data: &WData) -> &mut Self
pub fn tx_out_datum_embed_value(&mut self, data: &WData) -> &mut Self
sourcepub fn tx_out_inline_datum_value(&mut self, data: &WData) -> &mut Self
pub fn tx_out_inline_datum_value(&mut self, data: &WData) -> &mut Self
sourcepub fn tx_out_reference_script(
&mut self,
script_cbor: &str,
version: Option<LanguageVersion>,
) -> &mut Self
pub fn tx_out_reference_script( &mut self, script_cbor: &str, version: Option<LanguageVersion>, ) -> &mut Self
source§impl TxBuilder
impl TxBuilder
sourcepub fn voting_plutus_script(
&mut self,
language_version: &LanguageVersion,
) -> &mut Self
pub fn voting_plutus_script( &mut self, language_version: &LanguageVersion, ) -> &mut Self
sourcepub fn voting_plutus_script_v1(&mut self) -> &mut Self
pub fn voting_plutus_script_v1(&mut self) -> &mut Self
sourcepub fn voting_plutus_script_v2(&mut self) -> &mut Self
pub fn voting_plutus_script_v2(&mut self) -> &mut Self
sourcepub fn voting_plutus_script_v3(&mut self) -> &mut Self
pub fn voting_plutus_script_v3(&mut self) -> &mut Self
sourcepub fn vote_tx_in_reference(
&mut self,
tx_hash: &str,
tx_index: u32,
vote_script_hash: &str,
script_size: usize,
) -> &mut Self
pub fn vote_tx_in_reference( &mut self, tx_hash: &str, tx_index: u32, vote_script_hash: &str, script_size: usize, ) -> &mut Self
§Transaction building method
Add a vote reference to the TxBuilder instance
§Arguments
tx_hash
- The transaction hashtx_index
- The transaction indexvote_script_hash
- The vote script hashversion
- The language version, if the language version is None, the script is assumed to be a Native Scriptscript_size
- Size of the script
§Returns
Self
- The TxBuilder instance
sourcepub fn vote(
&mut self,
voter: &Voter,
gov_action_id: &RefTxIn,
voting_procedure: &VotingProcedure,
) -> &mut Self
pub fn vote( &mut self, voter: &Voter, gov_action_id: &RefTxIn, voting_procedure: &VotingProcedure, ) -> &mut Self
§Transaction building method
Add a vote in the TxBuilder instance
§Arguments
voter
- The voter, can be a ConstitutionalCommittee, a DRep or a StakePoolgov_action_id
- The transaction hash and transaction id of the governance actionvoting_precedure
- The voting kind (yes, no, abstain) with an optional anchor
§Returns
Self
- The TxBuilder instance
sourcepub fn vote_script(&mut self, script_cbor: &str) -> &mut Self
pub fn vote_script(&mut self, script_cbor: &str) -> &mut Self
sourcepub fn vote_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self
pub fn vote_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self
source§impl TxBuilder
impl TxBuilder
sourcepub fn withdrawal_plutus_script(
&mut self,
language_version: &LanguageVersion,
) -> &mut Self
pub fn withdrawal_plutus_script( &mut self, language_version: &LanguageVersion, ) -> &mut Self
sourcepub fn withdrawal_plutus_script_v1(&mut self) -> &mut Self
pub fn withdrawal_plutus_script_v1(&mut self) -> &mut Self
sourcepub fn withdrawal_plutus_script_v2(&mut self) -> &mut Self
pub fn withdrawal_plutus_script_v2(&mut self) -> &mut Self
sourcepub fn withdrawal_plutus_script_v3(&mut self) -> &mut Self
pub fn withdrawal_plutus_script_v3(&mut self) -> &mut Self
sourcepub fn withdrawal_tx_in_reference(
&mut self,
tx_hash: &str,
tx_index: u32,
withdrawal_script_hash: &str,
script_size: usize,
) -> &mut Self
pub fn withdrawal_tx_in_reference( &mut self, tx_hash: &str, tx_index: u32, withdrawal_script_hash: &str, script_size: usize, ) -> &mut Self
sourcepub fn withdrawal(&mut self, stake_address: &str, coin: u64) -> &mut Self
pub fn withdrawal(&mut self, stake_address: &str, coin: u64) -> &mut Self
sourcepub fn withdrawal_script(&mut self, script_cbor: &str) -> &mut Self
pub fn withdrawal_script(&mut self, script_cbor: &str) -> &mut Self
sourcepub fn withdrawal_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self
pub fn withdrawal_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self
source§impl TxBuilder
impl TxBuilder
sourcepub fn new(param: TxBuilderParam) -> Self
pub fn new(param: TxBuilderParam) -> Self
sourcepub fn required_signer_hash(&mut self, pub_key_hash: &str) -> &mut Self
pub fn required_signer_hash(&mut self, pub_key_hash: &str) -> &mut Self
sourcepub fn change_address(&mut self, address: &str) -> &mut Self
pub fn change_address(&mut self, address: &str) -> &mut Self
sourcepub fn change_output_datum(&mut self, data: WData) -> &mut Self
pub fn change_output_datum(&mut self, data: WData) -> &mut Self
sourcepub fn invalid_before(&mut self, slot: u64) -> &mut Self
pub fn invalid_before(&mut self, slot: u64) -> &mut Self
sourcepub fn invalid_hereafter(&mut self, slot: u64) -> &mut Self
pub fn invalid_hereafter(&mut self, slot: u64) -> &mut Self
sourcepub fn metadata_value(&mut self, tag: &str, metadata: &str) -> &mut Self
pub fn metadata_value(&mut self, tag: &str, metadata: &str) -> &mut Self
sourcepub fn signing_key(&mut self, skey_hex: &str) -> &mut Self
pub fn signing_key(&mut self, skey_hex: &str) -> &mut Self
sourcepub fn input_for_evaluation(&mut self, input: &UTxO) -> &mut Self
pub fn input_for_evaluation(&mut self, input: &UTxO) -> &mut Self
sourcepub fn select_utxos_from(
&mut self,
extra_inputs: &[UTxO],
threshold: u64,
) -> &mut Self
pub fn select_utxos_from( &mut self, extra_inputs: &[UTxO], threshold: u64, ) -> &mut Self
§Transaction building method
Selects utxos to fill output value and puts them into inputs
§Arguments
inputs
- The inputs already placed into the object will remain, these extra inputs will be used to fill the remaining value neededthreshold
- Extra value needed to be selected for, usually for paying fees and min UTxO value of change output
§Returns
Self
- The TxBuilder instance
sourcepub fn network(&mut self, network: Network) -> &mut Self
pub fn network(&mut self, network: Network) -> &mut Self
§Transaction building method
Selects the network to use, primarily to decide which cost models to use for evaluation and calculating script integrity hash
§Arguments
network
- The network the current Tx is being built for. Custom Network takes in a vec of cost models
§Returns
Self
- The TxBuilder instance
sourcepub fn queue_input(&mut self)
pub fn queue_input(&mut self)
§Internal method
Queue an input in the TxBuilder instance
sourcepub fn queue_withdrawal(&mut self)
pub fn queue_withdrawal(&mut self)
§Internal method
Queue a withdrawal in the TxBuilder instance
sourcepub fn queue_vote(&mut self)
pub fn queue_vote(&mut self)
§Internal method
Queue a vote in the TxBuilder instance
sourcepub fn queue_mint(&mut self)
pub fn queue_mint(&mut self)
§Internal method
Queue a mint in the TxBuilder instance
sourcepub fn queue_all_last_item(&mut self)
pub fn queue_all_last_item(&mut self)
§Internal method
Queue all last items in the TxBuilder instance
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TxBuilder
impl !RefUnwindSafe for TxBuilder
impl Send for TxBuilder
impl !Sync for TxBuilder
impl Unpin for TxBuilder
impl !UnwindSafe for TxBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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