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 set_address(&mut self, addr: &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 to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ
pub fn to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ
- Serialize this type to CBOR bytes using canonical CBOR encodings
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 to_canonical_cbor_hex(&self) -> String
pub fn to_canonical_cbor_hex(&self) -> String
- Serialize this type to CBOR bytes using canonical CBOR encodings as hex bytes
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 duplicate 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
Source§type Anchor = RcRef<TransactionOutput>
type Anchor = RcRef<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.Source§impl TryFromJsValue for TransactionOutput
impl TryFromJsValue for TransactionOutput
Source§impl VectorFromWasmAbi for TransactionOutput
impl VectorFromWasmAbi for TransactionOutput
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[TransactionOutput]>
Source§impl VectorIntoJsValue for TransactionOutput
impl VectorIntoJsValue for TransactionOutput
fn vector_into_jsvalue(vector: Box<[TransactionOutput]>) -> JsValue
Source§impl VectorIntoWasmAbi for TransactionOutput
impl VectorIntoWasmAbi for TransactionOutput
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[TransactionOutput]>) -> Self::Abi
Source§impl WasmDescribeVector for TransactionOutput
impl WasmDescribeVector for TransactionOutput
impl SupportsConstructor for TransactionOutput
impl SupportsInstanceProperty for TransactionOutput
impl SupportsStaticProperty for TransactionOutput
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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,
Source§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.