Struct cml_chain_wasm::byron::AddressContent
source · pub struct AddressContent(/* private fields */);Implementations§
source§impl AddressContent
impl AddressContent
pub fn hash_and_create( addr_type: ByronAddrType, spending_data: &SpendingData, attributes: &AddrAttributes ) -> AddressContent
pub fn new_redeem( pubkey: &PublicKey, protocol_magic: Option<ProtocolMagic> ) -> Self
pub fn new_simple( xpub: &Bip32PublicKey, protocol_magic: Option<ProtocolMagic> ) -> Self
sourcepub fn to_address(&self) -> ByronAddress
pub fn to_address(&self) -> ByronAddress
Do we want to remove this or keep it for people who were using old Byron code?
sourcepub fn byron_protocol_magic(&self) -> ProtocolMagic
pub fn byron_protocol_magic(&self) -> ProtocolMagic
returns the byron protocol magic embedded in the address, or mainnet id if none is present note: for bech32 addresses, you need to use network_id instead
pub fn network_id(&self) -> Result<u8, JsError>
pub fn icarus_from_key( key: &Bip32PublicKey, protocol_magic: &ProtocolMagic ) -> AddressContent
sourcepub fn identical_with_pubkey(&self, xpub: &Bip32PublicKey) -> bool
pub fn identical_with_pubkey(&self, xpub: &Bip32PublicKey) -> bool
Check if the Addr can be reconstructed with a specific xpub
source§impl AddressContent
impl AddressContent
sourcepub fn to_cbor_bytes(&self) -> Vec<u8>
pub fn to_cbor_bytes(&self) -> Vec<u8>
- Serialize this type to CBOR bytes.
- This type does NOT support fine-tuned encoding options so this may or may not be
- canonical CBOR and may or may not preserve round-trip encodings.
sourcepub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<AddressContent, JsError>
pub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<AddressContent, 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 does NOT support fine-tuned encoding options so this may or may not be
- canonical CBOR and may or may not preserve round-trip encodings.
sourcepub fn from_cbor_hex(cbor_bytes: &str) -> Result<AddressContent, JsError>
pub fn from_cbor_hex(cbor_bytes: &str) -> Result<AddressContent, JsError>
- Create this type from the CBOR bytes encoded as a hex string.
- This is useful for interfacing with CIP30
source§impl AddressContent
impl AddressContent
pub fn address_id(&self) -> AddressId
pub fn addr_attributes(&self) -> AddrAttributes
pub fn addr_type(&self) -> ByronAddrType
pub fn new( address_id: &AddressId, addr_attributes: &AddrAttributes, addr_type: ByronAddrType ) -> Self
Trait Implementations§
source§impl AsRef<AddressContent> for AddressContent
impl AsRef<AddressContent> for AddressContent
source§fn as_ref(&self) -> &AddressContent
fn as_ref(&self) -> &AddressContent
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for AddressContent
impl Clone for AddressContent
source§fn clone(&self) -> AddressContent
fn clone(&self) -> AddressContent
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 AddressContent
impl Debug for AddressContent
source§impl From<AddressContent> for AddressContent
impl From<AddressContent> for AddressContent
source§fn from(native: AddressContent) -> Self
fn from(native: AddressContent) -> Self
Converts to this type from the input type.
source§impl From<AddressContent> for JsValue
impl From<AddressContent> for JsValue
source§fn from(value: AddressContent) -> Self
fn from(value: AddressContent) -> Self
Converts to this type from the input type.
source§impl FromWasmAbi for AddressContent
impl FromWasmAbi for AddressContent
source§impl Into<AddressContent> for AddressContent
impl Into<AddressContent> for AddressContent
source§fn into(self) -> AddressContent
fn into(self) -> AddressContent
Converts this type into the (usually inferred) input type.
source§impl IntoWasmAbi for AddressContent
impl IntoWasmAbi for AddressContent
source§impl OptionFromWasmAbi for AddressContent
impl OptionFromWasmAbi for AddressContent
source§impl OptionIntoWasmAbi for AddressContent
impl OptionIntoWasmAbi for AddressContent
source§impl RefFromWasmAbi for AddressContent
impl RefFromWasmAbi for AddressContent
§type Anchor = Ref<'static, AddressContent>
type Anchor = Ref<'static, AddressContent>
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 RefMutFromWasmAbi for AddressContent
impl RefMutFromWasmAbi for AddressContent
Auto Trait Implementations§
impl Freeze for AddressContent
impl RefUnwindSafe for AddressContent
impl Send for AddressContent
impl Sync for AddressContent
impl Unpin for AddressContent
impl UnwindSafe for AddressContent
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> 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.