pub struct TransactionOutputs(_);
Implementations§
source§impl TransactionOutputs
impl TransactionOutputs
pub fn from_bytes(
bytes: Vec<u8>
) -> Result<TransactionOutputs, DeserializeError>
source§impl TransactionOutputs
impl TransactionOutputs
pub fn from_hex(hex_str: &str) -> Result<TransactionOutputs, DeserializeError>
source§impl TransactionOutputs
impl TransactionOutputs
sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
src/tx_builder.rs (line 1234)
1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248
pub fn new(cfg: &TransactionBuilderConfig) -> Self {
Self {
config: cfg.clone(),
inputs: TxInputsBuilder::new(),
collateral: TxInputsBuilder::new(),
outputs: TransactionOutputs::new(),
fee: None,
ttl: None,
certs: None,
withdrawals: None,
auxiliary_data: None,
validity_start_interval: None,
mint: None,
script_data_hash: None,
required_signers: Ed25519KeyHashes::new(),
collateral_return: None,
total_collateral: None,
reference_inputs: HashSet::new(),
}
}
pub fn len(&self) -> usize
pub fn get(&self, index: usize) -> TransactionOutput
sourcepub fn add(&mut self, elem: &TransactionOutput)
pub fn add(&mut self, elem: &TransactionOutput)
Examples found in repository?
src/tx_builder.rs (line 923)
907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926
pub fn add_output(&mut self, output: &TransactionOutput) -> Result<(), JsError> {
let value_size = output.amount.to_bytes().len();
if value_size > self.config.max_value_size as usize {
return Err(JsError::from_str(&format!(
"Maximum value size of {} exceeded. Found: {}",
self.config.max_value_size, value_size
)));
}
let min_ada = min_ada_for_output(&output, &self.config.utxo_cost())?;
if output.amount().coin() < min_ada {
Err(JsError::from_str(&format!(
"Value {} less than the minimum UTXO value {}",
from_bignum(&output.amount().coin()),
from_bignum(&min_ada)
)))
} else {
self.outputs.add(output);
Ok(())
}
}
Trait Implementations§
source§impl Clone for TransactionOutputs
impl Clone for TransactionOutputs
source§fn clone(&self) -> TransactionOutputs
fn clone(&self) -> TransactionOutputs
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 TransactionOutputs
impl Debug for TransactionOutputs
source§impl<'de> Deserialize<'de> for TransactionOutputs
impl<'de> Deserialize<'de> for TransactionOutputs
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Deserialize for TransactionOutputs
impl Deserialize for TransactionOutputs
fn deserialize<R: BufRead + Seek>(
raw: &mut Deserializer<R>
) -> Result<Self, DeserializeError>
source§impl<'a> IntoIterator for &'a TransactionOutputs
impl<'a> IntoIterator for &'a TransactionOutputs
§type Item = &'a TransactionOutput
type Item = &'a TransactionOutput
The type of the elements being iterated over.
§type IntoIter = Iter<'a, TransactionOutput>
type IntoIter = Iter<'a, TransactionOutput>
Which kind of iterator are we turning this into?
source§impl JsonSchema for TransactionOutputs
impl JsonSchema for TransactionOutputs
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl PartialEq<TransactionOutputs> for TransactionOutputs
impl PartialEq<TransactionOutputs> for TransactionOutputs
source§fn eq(&self, other: &TransactionOutputs) -> bool
fn eq(&self, other: &TransactionOutputs) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.