pub struct TransactionOutputBuilder(/* private fields */);Expand description
We introduce a builder-pattern format for creating transaction outputs This is because:
- Some fields (i.e. data hash) are optional, and we can’t easily expose Option<> in WASM
- Some fields like amounts have many ways it could be set (some depending on other field values being known)
- Easier to adapt as the output format gets more complicated in future Cardano releases
Implementations§
source§impl TransactionOutputBuilder
impl TransactionOutputBuilder
pub fn new() -> Self
pub fn with_address(&self, address: &Address) -> Self
sourcepub fn with_communication_data(&self, datum: &PlutusData) -> Self
pub fn with_communication_data(&self, datum: &PlutusData) -> Self
A communication datum is one where the data hash is used in the tx output Yet the full datum is included in the witness of the same transaction
pub fn with_data(&self, datum: &DatumOption) -> Self
pub fn with_reference_script(&self, script_ref: &ScriptRef) -> Self
pub fn next(&self) -> Result<TransactionOutputAmountBuilder, JsError>
Trait Implementations§
source§impl AsRef<TransactionOutputBuilder> for TransactionOutputBuilder
impl AsRef<TransactionOutputBuilder> for TransactionOutputBuilder
source§fn as_ref(&self) -> &TransactionOutputBuilder
fn as_ref(&self) -> &TransactionOutputBuilder
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for TransactionOutputBuilder
impl Clone for TransactionOutputBuilder
source§fn clone(&self) -> TransactionOutputBuilder
fn clone(&self) -> TransactionOutputBuilder
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 TransactionOutputBuilder
impl Debug for TransactionOutputBuilder
source§impl Default for TransactionOutputBuilder
impl Default for TransactionOutputBuilder
source§fn default() -> TransactionOutputBuilder
fn default() -> TransactionOutputBuilder
Returns the “default value” for a type. Read more
source§impl From<TransactionOutputBuilder> for JsValue
impl From<TransactionOutputBuilder> for JsValue
source§fn from(value: TransactionOutputBuilder) -> Self
fn from(value: TransactionOutputBuilder) -> Self
Converts to this type from the input type.
source§impl From<TransactionOutputBuilder> for TransactionOutputBuilder
impl From<TransactionOutputBuilder> for TransactionOutputBuilder
source§fn from(native: TransactionOutputBuilder) -> Self
fn from(native: TransactionOutputBuilder) -> Self
Converts to this type from the input type.
source§impl Into<TransactionOutputBuilder> for TransactionOutputBuilder
impl Into<TransactionOutputBuilder> for TransactionOutputBuilder
source§fn into(self) -> TransactionOutputBuilder
fn into(self) -> TransactionOutputBuilder
Converts this type into the (usually inferred) input type.
source§impl RefFromWasmAbi for TransactionOutputBuilder
impl RefFromWasmAbi for TransactionOutputBuilder
§type Anchor = Ref<'static, TransactionOutputBuilder>
type Anchor = Ref<'static, TransactionOutputBuilder>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Auto Trait Implementations§
impl Freeze for TransactionOutputBuilder
impl RefUnwindSafe for TransactionOutputBuilder
impl Send for TransactionOutputBuilder
impl Sync for TransactionOutputBuilder
impl Unpin for TransactionOutputBuilder
impl UnwindSafe for TransactionOutputBuilder
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> 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 moresource§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abisource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.