Struct cml_chain_wasm::transaction::TransactionOutput
source · pub struct TransactionOutput(/* private fields */);Implementations§
source§impl TransactionOutput
impl TransactionOutput
pub fn new( address: &Address, amount: &Value, datum_option: Option<DatumOption>, script_reference: Option<ScriptRef> ) -> Self
pub fn address(&self) -> Address
pub fn amount(&self) -> Value
pub fn set_amount(&mut self, amount: &Value)
pub fn datum(&self) -> Option<DatumOption>
sourcepub fn datum_hash(&self) -> Option<DatumHash>
pub fn datum_hash(&self) -> Option<DatumHash>
Get the datum hash from a tx output if present as a hash. Returns None if there is no datum, or the datum is inlined. Use TransactionOutput::datum() for inlined datums.
pub fn script_ref(&self) -> Option<ScriptRef>
source§impl TransactionOutput
impl TransactionOutput
sourcepub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
pub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
- Serialize this type to CBOR bytes
- This type type supports encoding preservation so this will preserve round-trip CBOR formats.
- If created from scratch the CBOR will be canonical.
sourcepub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<TransactionOutput, JsError>
pub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<TransactionOutput, JsError>
- Create this type from CBOR bytes
sourcepub fn to_cbor_hex(&self) -> String
pub fn to_cbor_hex(&self) -> String
- Serialize this type to CBOR bytes encoded as a hex string (useful for working with CIP30).
- This type type supports encoding preservation so this will preserve round-trip CBOR formats.
- If created from scratch the CBOR will be canonical.
sourcepub fn from_cbor_hex(cbor_bytes: &str) -> Result<TransactionOutput, JsError>
pub fn from_cbor_hex(cbor_bytes: &str) -> Result<TransactionOutput, JsError>
- Create this type from the CBOR bytes encoded as a hex string.
- This is useful for interfacing with CIP30
source§impl TransactionOutput
impl TransactionOutput
pub fn new_alonzo_format_tx_out( alonzo_format_tx_out: &AlonzoFormatTxOut ) -> Self
pub fn new_conway_format_tx_out( conway_format_tx_out: &ConwayFormatTxOut ) -> Self
pub fn kind(&self) -> TransactionOutputKind
pub fn as_alonzo_format_tx_out(&self) -> Option<AlonzoFormatTxOut>
pub fn as_conway_format_tx_out(&self) -> Option<ConwayFormatTxOut>
Trait Implementations§
source§impl AsRef<TransactionOutput> for TransactionOutput
impl AsRef<TransactionOutput> for TransactionOutput
source§fn as_ref(&self) -> &TransactionOutput
fn as_ref(&self) -> &TransactionOutput
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for TransactionOutput
impl Clone for TransactionOutput
source§fn clone(&self) -> TransactionOutput
fn clone(&self) -> TransactionOutput
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 TransactionOutput
impl Debug for TransactionOutput
source§impl From<TransactionOutput> for JsValue
impl From<TransactionOutput> for JsValue
source§fn from(value: TransactionOutput) -> Self
fn from(value: TransactionOutput) -> Self
Converts to this type from the input type.
source§impl From<TransactionOutput> for TransactionOutput
impl From<TransactionOutput> for TransactionOutput
source§fn from(native: TransactionOutput) -> Self
fn from(native: TransactionOutput) -> Self
Converts to this type from the input type.
source§impl FromWasmAbi for TransactionOutput
impl FromWasmAbi for TransactionOutput
source§impl Into<TransactionOutput> for TransactionOutput
impl Into<TransactionOutput> for TransactionOutput
source§fn into(self) -> TransactionOutput
fn into(self) -> TransactionOutput
Converts this type into the (usually inferred) input type.
source§impl IntoWasmAbi for TransactionOutput
impl IntoWasmAbi for TransactionOutput
source§impl RefFromWasmAbi for TransactionOutput
impl RefFromWasmAbi for TransactionOutput
§type Anchor = Ref<'static, TransactionOutput>
type Anchor = Ref<'static, TransactionOutput>
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 TransactionOutput
impl RefUnwindSafe for TransactionOutput
impl Send for TransactionOutput
impl Sync for TransactionOutput
impl Unpin for TransactionOutput
impl UnwindSafe for TransactionOutput
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.