Struct whisky::builder::TxBuilder

source ·
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

source

pub fn register_pool_certificate( &mut self, pool_params: &PoolParams, ) -> &mut Self

§Transaction building method

Add a pool registration certificate to the TxBuilder instance

§Arguments
  • pool_params - Parameters of pool to be registered
§Returns
  • Self - The TxBuilder instance
source

pub fn register_stake_certificate( &mut self, stake_key_address: &str, ) -> &mut Self

§Transaction building method

Add a stake registration certificate to the TxBuilder instance

§Arguments
  • stake_key_address - Address of the stake key
§Returns
  • Self - The TxBuilder instance
source

pub fn delegate_stake_certificate( &mut self, stake_key_address: &str, pool_id: &str, ) -> &mut Self

§Transaction building method

Add a stake delegation certificate to the TxBuilder instance

§Arguments
  • stake_key_address - Address of the stake key
  • pool_id - id of the pool that will be delegated to
§Returns
  • Self - The TxBuilder instance
source

pub fn deregister_stake_certificate( &mut self, stake_key_address: &str, ) -> &mut Self

§Transaction building method

Add a stake deregistration certificate to the TxBuilder instance

§Arguments
  • stake_key_address - Address of the stake key
§Returns
  • Self - The TxBuilder instance
source

pub fn retire_pool_certificate( &mut self, pool_id: &str, epoch: u32, ) -> &mut Self

§Transaction building method

Add a pool retire certificate to the TxBuilder instance

§Arguments
  • pool_id - id of the pool that will be retired
  • epoch - The epoch that the pool will be retired from
§Returns
  • Self - The TxBuilder instance
source

pub fn vote_delegation_certificate( &mut self, stake_key_address: &str, drep: &DRep, ) -> &mut Self

§Transaction building method

Add a vote delegation certificate to the TxBuilder instance

§Arguments
  • stake_key_address - Address of the stake key
  • drep - The drep that will be voted for, or always abstain / always no confidence
§Returns
  • Self - The TxBuilder instance
source

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 key
  • pool_key_hash - Hash of pool key that will be delegated to, same as pool id
  • drep - The drep that will be voted for, or always abstain / always no confidence
§Returns
  • Self - The TxBuilder instance
source

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 key
  • pool_key_hash - Hash of pool key that will be delegated to, same as pool id
  • coin - Deposit for certificate registration
§Returns
  • Self - The TxBuilder instance
source

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 key
  • drep - The drep that will be voted for, or always abstain / always no confidence
  • coin - Deposit for certificate registration
§Returns
  • Self - The TxBuilder instance
source

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 key
  • pool_key_hash - Hash of pool key that will be delegated to, same as pool id
  • drep - The drep that will be voted for, or always abstain / always no confidence
  • coin - Deposit for certificate registration
§Returns
  • Self - The TxBuilder instance
source

pub fn committee_hot_auth( &mut self, committee_cold_key_address: &str, committee_hot_key_address: &str, ) -> &mut Self

§Transaction building method

Add commitee hot auth certificate to the TxBuilder instance

§Arguments
  • committee_cold_key_address - Address of the committee cold key
  • committee_hot_key_address - Address of the commitee hot key
§Returns
  • Self - The TxBuilder instance
source

pub fn commitee_cold_resign( &mut self, committee_cold_key_address: &str, anchor: Option<Anchor>, ) -> &mut Self

§Transaction building method

Add commitee cold resign certificate to the TxBuilder instance

§Arguments
  • committee_cold_key_address - Address of the committee cold key
  • anchor - The Anchor, this is a URL and a hash of the doc at this URL
§Returns
  • Self - The TxBuilder instance
source

pub fn drep_registration( &mut self, drep_id: &str, coin: u64, anchor: Option<Anchor>, ) -> &mut Self

§Transaction building method

Add DRep registration certificate to the TxBuilder instance

§Arguments
  • voting_key_address - Address of the voting key
  • coin - Deposit for certificate registration
  • anchor - The Anchor, this is a URL and a hash of the doc at this URL
§Returns
  • Self - The TxBuilder instance
source

pub fn drep_deregistration(&mut self, drep_id: &str, coin: u64) -> &mut Self

§Transaction building method

Add DRep deregistration certificate to the TxBuilder instance

§Arguments
  • voting_key_address - Address of the voting key
  • coin - Deposit for certificate registration
§Returns
  • Self - The TxBuilder instance
source

pub fn drep_update( &mut self, drep_id: &str, anchor: Option<Anchor>, ) -> &mut Self

§Transaction building method

Add DRep update certificate to the TxBuilder instance

§Arguments
  • voting_key_address - Address of the voting key
  • anchor - The Anchor, this is a URL and a hash of the doc at this URL
§Returns
  • Self - The TxBuilder instance
source

pub fn certificate_script( &mut self, script_cbor: &str, version: Option<LanguageVersion>, ) -> &mut Self

§Transaction building method

Add script witness to certificate

§Arguments
  • script_cbor - The script in CBOR format
  • version - The language version, if the language version is None, the script is assumed to be a Native Script
§Returns
  • Self - The TxBuilder instance
source

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 hash
  • tx_index - The transaction index
  • script_hash - The script hash
  • version - The language version, if the language version is None, the script is assumed to be a Native Script
  • script_size - Size of the script
§Returns
  • Self - The TxBuilder instance
source

pub fn certificate_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self

§Transaction building method

Add a Certificate Redeemer to the TxBuilder instance

§Arguments
  • redeemer - The redeemer value
§Returns
  • Self - The TxBuilder instance
source§

impl TxBuilder

source

pub async fn complete( &mut self, customized_tx: Option<TxBuilderBody>, ) -> Result<&mut Self, JsError>

§Transaction building method

Complete the transaction building process with fetching missing information & tx evaluation

§Arguments
  • customized_tx - An optional customized transaction body
§Returns
  • Self - The TxBuilder instance
source

pub fn complete_sync( &mut self, customized_tx: Option<TxBuilderBody>, ) -> Result<&mut Self, JsError>

§Transaction building method

Complete the transaction building process synchronously

§Arguments
  • customized_tx - An optional customized transaction body
§Returns
  • Self - The TxBuilder instance
source

pub fn complete_signing(&mut self) -> Result<String, JsError>

§Transaction building method

Complete the signing process

§Returns
  • String - The signed transaction in hex
source

pub fn tx_hex(&mut self) -> String

§Transaction building method

Obtain the transaction hex

§Returns
  • tx_hex - The current transaction hex from build
source§

impl TxBuilder

source

pub fn mint_plutus_script( &mut self, language_version: &LanguageVersion, ) -> &mut Self

§Transaction building method

Indicate that the transaction is withdrawing using a plutus staking script in the TxBuilder instance

§Arguments
  • language_version - The language version of the script
§Returns
  • Self - The TxBuilder instance
source

pub fn mint_plutus_script_v1(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is minting a Plutus script v1 in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn mint_plutus_script_v2(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is minting a Plutus script v2 in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn mint_plutus_script_v3(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is minting a Plutus script v2 in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn mint(&mut self, quantity: i128, policy: &str, name: &str) -> &mut Self

§Transaction building method

Mint assets in the TxBuilder instance

§Arguments
  • quantity - The quantity of assets to mint
  • policy - The policy
  • name - The name of the asset
§Returns
  • Self - The TxBuilder instance
source

pub fn minting_script(&mut self, script_cbor: &str) -> &mut Self

§Transaction building method

Add a minting script to the TxBuilder instance

§Arguments
  • script_cbor - The script in CBOR format
  • version - The language version, if the language version is None, the script is assumed to be a Native Script
§Returns
  • Self - The TxBuilder instance
source

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 hash
  • tx_index - The transaction index
  • script_hash - The script hash
  • version - The language version, if the language version is None, the script is assumed to be a Native Script
  • script_size - Size of the script
§Returns
  • Self - The TxBuilder instance
source

pub fn mint_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self

§Transaction building method

Set the minting redeemer value in the TxBuilder instance

§Arguments
  • redeemer - The redeemer value
§Returns
  • Self - The TxBuilder instance
source

pub fn mint_reference_tx_in_redeemer_value( &mut self, redeemer: &WRedeemer, ) -> &mut Self

§Transaction building method

Set the minting reference transaction input redeemer value in the TxBuilder instance

§Arguments
  • redeemer - The redeemer value
§Returns
  • Self - The TxBuilder instance
source§

impl TxBuilder

source

pub fn set_evaluator(&mut self, evaluator: Box<dyn Evaluator>) -> &mut Self

source§

impl TxBuilder

source

pub fn spending_plutus_script( &mut self, language_version: &LanguageVersion, ) -> &mut Self

§Transaction building method

Indicate that the transaction is spending a Plutus script in the TxBuilder instance

§Arguments
  • language_version - The language version of the script
§Returns
  • Self - The TxBuilder instance
source

pub fn spending_plutus_script_v1(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is spending a Plutus script v1 in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn spending_plutus_script_v2(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is spending a Plutus script v2 in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn spending_plutus_script_v3(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is spending a Plutus script v3 in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn tx_in( &mut self, tx_hash: &str, tx_index: u32, amount: &[Asset], address: &str, ) -> &mut Self

§Transaction building method

Add a transaction input to the TxBuilder instance

§Arguments
  • tx_hash - The transaction hash
  • tx_index - The transaction index
  • amount - The amount of assets
  • address - The address
§Returns
  • Self - The TxBuilder instance
source

pub fn tx_in_script(&mut self, script_cbor: &str) -> &mut Self

§Transaction building method

Add a transaction input script to the TxBuilder instance

§Arguments
  • script_cbor - The script in CBOR format
  • version - The language version, leave as None for Native scripts
§Returns
  • Self - The TxBuilder instance
source

pub fn tx_in_datum_value(&mut self, data: &WData) -> &mut Self

§Transaction building method

Set the transaction input datum value in the TxBuilder instance

§Arguments
  • data - The datum value
§Returns
  • Self - The TxBuilder instance
source

pub fn tx_in_inline_datum_present(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction input has an inline datum in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn tx_in_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self

§Transaction building method

Set the transaction input redeemer value in the TxBuilder instance

§Arguments
  • redeemer - The redeemer value
§Returns
  • Self - The TxBuilder instance
source

pub fn spending_tx_in_reference( &mut self, tx_hash: &str, tx_index: u32, script_hash: &str, script_size: usize, ) -> &mut Self

§Transaction building method

Add a spending transaction input reference to the TxBuilder instance

§Arguments
  • tx_hash - The transaction hash
  • tx_index - The transaction index
  • script_hash - The spending script hash
  • scrip_size - Size of the script
§Returns
  • Self - The TxBuilder instance
source

pub fn spending_reference_tx_in_inline_datum_present(&mut self) -> &mut Self

§Transaction building method

Indicate that the spending reference transaction input has an inline datum in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn spending_reference_tx_in_redeemer_value( &mut self, redeemer: &WRedeemer, ) -> &mut Self

§Transaction building method

Set the spending reference transaction input redeemer value in the TxBuilder instance

§Arguments
  • redeemer - The redeemer value
§Returns
  • Self - The TxBuilder instance
source

pub fn read_only_tx_in_reference( &mut self, tx_hash: &str, tx_index: u32, ) -> &mut Self

§Transaction building method

Add a read-only transaction input reference to the TxBuilder instance

§Arguments
  • tx_hash - The transaction hash
  • tx_index - The transaction index
§Returns
  • Self - The TxBuilder instance
source

pub fn tx_in_collateral( &mut self, tx_hash: &str, tx_index: u32, amount: &[Asset], address: &str, ) -> &mut Self

§Transaction building method

Add a transaction input collateral to the TxBuilder instance

§Arguments
  • tx_hash - The transaction hash
  • tx_index - The transaction index
  • amount - The amount of assets
  • address - The address
§Returns
  • Self - The TxBuilder instance
source§

impl TxBuilder

source

pub fn tx_out(&mut self, address: &str, amount: &[Asset]) -> &mut Self

§Transaction building method

Add a transaction output to the TxBuilder instance

§Arguments
  • address - The address
  • amount - The amount of assets
§Returns
  • Self - The TxBuilder instance
source

pub fn tx_out_datum_hash_value(&mut self, data: &WData) -> &mut Self

§Transaction building method

Set the transaction output datum hash value in the TxBuilder instance

§Arguments
  • data - The datum hash value
§Returns
  • Self - The TxBuilder instance
source

pub fn tx_out_datum_embed_value(&mut self, data: &WData) -> &mut Self

§Transaction building method

Set the transaction output embedded datum value in the TxBuilder instance

§Arguments
  • data - The embedded datum value
§Returns
  • Self - The TxBuilder instance
source

pub fn tx_out_inline_datum_value(&mut self, data: &WData) -> &mut Self

§Transaction building method

Set the transaction output inline datum value in the TxBuilder instance

§Arguments
  • data - The inline datum value
§Returns
  • Self - The TxBuilder instance
source

pub fn tx_out_reference_script( &mut self, script_cbor: &str, version: Option<LanguageVersion>, ) -> &mut Self

§Transaction building method

Add a transaction output reference script to the TxBuilder instance

§Arguments
  • script_cbor - The script in CBOR format
  • version - The language version, if the language version is None, the script is assumed to be a Native Script
§Returns
  • Self - The TxBuilder instance
source§

impl TxBuilder

source

pub fn voting_plutus_script( &mut self, language_version: &LanguageVersion, ) -> &mut Self

§Transaction building method

Indicate that the transaction is voting using a plutus staking script in the TxBuilder instance

§Arguments
  • language_version - The language version of the script
§Returns
  • Self - The TxBuilder instance
source

pub fn voting_plutus_script_v1(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is voting using a plutus V1 staking script in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn voting_plutus_script_v2(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is voting using a plutus V2 staking script in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn voting_plutus_script_v3(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is voting using a plutus V3 staking script in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

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 hash
  • tx_index - The transaction index
  • vote_script_hash - The vote script hash
  • version - The language version, if the language version is None, the script is assumed to be a Native Script
  • script_size - Size of the script
§Returns
  • Self - The TxBuilder instance
source

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 StakePool
  • gov_action_id - The transaction hash and transaction id of the governance action
  • voting_precedure - The voting kind (yes, no, abstain) with an optional anchor
§Returns
  • Self - The TxBuilder instance
source

pub fn vote_script(&mut self, script_cbor: &str) -> &mut Self

§Transaction building method

Add a vote script to the TxBuilder instance

§Arguments
  • script_cbor - The script in CBOR format
§Returns
  • Self - The TxBuilder instance
source

pub fn vote_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self

§Transaction building method

Set the transaction vote redeemer value in the TxBuilder instance

§Arguments
  • redeemer - The redeemer value
§Returns
  • Self - The TxBuilder instance
source

pub fn vote_reference_tx_in_redeemer_value( &mut self, redeemer: &WRedeemer, ) -> &mut Self

§Transaction building method

Set the vote reference redeemer value in the TxBuilder instance

§Arguments
  • redeemer - The redeemer value
§Returns
  • Self - The TxBuilder instance
source§

impl TxBuilder

source

pub fn withdrawal_plutus_script( &mut self, language_version: &LanguageVersion, ) -> &mut Self

§Transaction building method

Indicate that the transaction is withdrawing using a plutus staking script in the TxBuilder instance

§Arguments
  • language_version - The language version of the script
§Returns
  • Self - The TxBuilder instance
source

pub fn withdrawal_plutus_script_v1(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is withdrawing using a plutus V1 staking script in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn withdrawal_plutus_script_v2(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is withdrawing using a plutus V2 staking script in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn withdrawal_plutus_script_v3(&mut self) -> &mut Self

§Transaction building method

Indicate that the transaction is withdrawing using a plutus V3 staking script in the TxBuilder instance

§Returns
  • Self - The TxBuilder instance
source

pub fn withdrawal_tx_in_reference( &mut self, tx_hash: &str, tx_index: u32, withdrawal_script_hash: &str, script_size: usize, ) -> &mut Self

§Transaction building method

Add a withdrawal reference to the TxBuilder instance

§Arguments
  • tx_hash - The transaction hash
  • tx_index - The transaction index
  • withdrawal_script_hash - The withdrawal script hash
  • script_size - Size of the script
§Returns
  • Self - The TxBuilder instance
source

pub fn withdrawal(&mut self, stake_address: &str, coin: u64) -> &mut Self

§Transaction building method

Withdraw stake rewards in the TxBuilder instance

§Arguments
  • stake_address - The address corresponding to the stake key
  • coin - The amount of lovelaces in the withdrawal
§Returns
  • Self - The TxBuilder instance
source

pub fn withdrawal_script(&mut self, script_cbor: &str) -> &mut Self

§Transaction building method

Add a withdrawal script to the TxBuilder instance

§Arguments
  • script_cbor - The script in CBOR format
§Returns
  • Self - The TxBuilder instance
source

pub fn withdrawal_redeemer_value(&mut self, redeemer: &WRedeemer) -> &mut Self

§Transaction building method

Set the transaction withdrawal redeemer value in the TxBuilder instance

§Arguments
  • redeemer - The redeemer value
§Returns
  • Self - The TxBuilder instance
source

pub fn withdrawal_reference_tx_in_redeemer_value( &mut self, redeemer: &WRedeemer, ) -> &mut Self

§Transaction building method

Set the withdrawal reference redeemer value in the TxBuilder instance

§Arguments
  • redeemer - The redeemer value
§Returns
  • Self - The TxBuilder instance
source§

impl TxBuilder

source

pub fn new(param: TxBuilderParam) -> Self

§Transaction building method

Create a new TxBuilder instance with option params

§Arguments
  • param - Parameters for setting up the TxBuilder instance, including evaluator, fetcher, submitter, and protocol parameters
§Returns
  • Self - A new TxBuilder instance
source

pub fn new_core() -> Self

§Transaction building method

Create a new TxBuilder instance without option params

§Returns
  • Self - A new TxBuilder instance
source

pub fn required_signer_hash(&mut self, pub_key_hash: &str) -> &mut Self

§Transaction building method

Add a required signer hash to the TxBuilder instance

§Arguments
  • pub_key_hash - The public key hash
§Returns
  • Self - The TxBuilder instance
source

pub fn change_address(&mut self, address: &str) -> &mut Self

§Transaction building method

Change the address in the TxBuilder instance

§Arguments
  • address - The new address
§Returns
  • Self - The TxBuilder instance
source

pub fn change_output_datum(&mut self, data: WData) -> &mut Self

§Transaction building method

Change the output datum in the TxBuilder instance

§Arguments
  • data - The new output datum
§Returns
  • Self - The TxBuilder instance
source

pub fn invalid_before(&mut self, slot: u64) -> &mut Self

§Transaction building method

Set the invalid_before slot in the TxBuilder instance

§Arguments
  • slot - The new invalid_before slot
§Returns
  • Self - The TxBuilder instance
source

pub fn invalid_hereafter(&mut self, slot: u64) -> &mut Self

§Transaction building method

Set the invalid_hereafter slot in the TxBuilder instance

§Arguments
  • slot - The new invalid_hereafter slot
§Returns
  • Self - The TxBuilder instance
source

pub fn metadata_value(&mut self, tag: &str, metadata: &str) -> &mut Self

§Transaction building method

Add a metadata value to the TxBuilder instance

§Arguments
  • tag - The tag for the metadata
  • metadata - The metadata value
§Returns
  • Self - The TxBuilder instance
source

pub fn signing_key(&mut self, skey_hex: &str) -> &mut Self

§Transaction building method

Add a cli signing key to the TxBuilder instance

§Arguments
  • skey_hex - The signing key in hexadecimal
§Returns
  • Self - The TxBuilder instance
source

pub fn chain_tx(&mut self, tx_hex: &str) -> &mut Self

§Transaction building method

Add a transaction that used as input, but not yet reflected on global blockchain

§Arguments
  • tx_hex - The transaction hex of chained transaction
§Returns
  • Self - The TxBuilder instance
source

pub fn input_for_evaluation(&mut self, input: &UTxO) -> &mut Self

§Transaction building method

Add a transaction input to provide information for offline evaluation

§Arguments
  • input - The input to be added
§Returns
  • Self - The TxBuilder instance
source

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 needed
  • threshold - Extra value needed to be selected for, usually for paying fees and min UTxO value of change output
§Returns
  • Self - The TxBuilder instance
source

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
source

pub fn queue_input(&mut self)

§Internal method

Queue an input in the TxBuilder instance

source

pub fn queue_withdrawal(&mut self)

§Internal method

Queue a withdrawal in the TxBuilder instance

source

pub fn queue_vote(&mut self)

§Internal method

Queue a vote in the TxBuilder instance

source

pub fn queue_mint(&mut self)

§Internal method

Queue a mint in the TxBuilder instance

source

pub fn queue_all_last_item(&mut self)

§Internal method

Queue all last items in the TxBuilder instance

source

pub fn add_utxos_from( &mut self, extra_inputs: Vec<UTxO>, threshold: u64, ) -> Result<(), JsError>

§Internal method

Perform the utxo selection process

§Arguments
  • extra_inputs - A vector of extra inputs provided
  • threshold - The threshold as configured

Trait Implementations§

source§

impl Default for TxBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl TxEvaluation for TxBuilder

source§

fn update_redeemer(&mut self, tx_evaluation: Vec<Action>) -> &mut Self

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more