pub struct StacksAddress { /* private fields */ }
Expand description
A Stacks address
Implementations§
Source§impl StacksAddress
impl StacksAddress
Sourcepub fn new(version: AddressVersion, hash: Hash160Hasher) -> Self
pub fn new(version: AddressVersion, hash: Hash160Hasher) -> Self
Create a new Stacks address from the given version and hash
Sourcepub fn version(&self) -> AddressVersion
pub fn version(&self) -> AddressVersion
Get the address version
Sourcepub fn hash(&self) -> &Hash160Hasher
pub fn hash(&self) -> &Hash160Hasher
Get the address hash
Sourcepub fn p2pkh(version: AddressVersion, key: &PublicKey) -> Self
pub fn p2pkh(version: AddressVersion, key: &PublicKey) -> Self
Create a new Stacks address with a pay-2-public-key-hash
Sourcepub fn p2sh<'a>(
version: AddressVersion,
keys: impl IntoIterator<Item = &'a PublicKey>,
signature_threshold: usize,
) -> Self
pub fn p2sh<'a>( version: AddressVersion, keys: impl IntoIterator<Item = &'a PublicKey>, signature_threshold: usize, ) -> Self
Create a new Stacks address with a pay-2-script-hash
Sourcepub fn p2wpkh(version: AddressVersion, key: &PublicKey) -> Self
pub fn p2wpkh(version: AddressVersion, key: &PublicKey) -> Self
Create a new Stacks address with a pay-2-witness-public-key-hash
Sourcepub fn p2wsh<'a>(
version: AddressVersion,
keys: impl IntoIterator<Item = &'a PublicKey>,
signature_threshold: usize,
) -> Self
pub fn p2wsh<'a>( version: AddressVersion, keys: impl IntoIterator<Item = &'a PublicKey>, signature_threshold: usize, ) -> Self
Create a new Stacks address with a pay-2-witness-script-hash
Sourcepub fn from_public_key(version: AddressVersion, key: &PublicKey) -> Self
pub fn from_public_key(version: AddressVersion, key: &PublicKey) -> Self
Create a Stacks address from the public key. This is always a P2PKH address, by convention.
Trait Implementations§
Source§impl Clone for StacksAddress
impl Clone for StacksAddress
Source§fn clone(&self) -> StacksAddress
fn clone(&self) -> StacksAddress
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 Codec for StacksAddress
impl Codec for StacksAddress
Source§fn serialize<W: Write>(&self, dest: &mut W) -> StacksResult<()>
fn serialize<W: Write>(&self, dest: &mut W) -> StacksResult<()>
Serialize to a writer and return a StacksResult
Source§fn deserialize<R: Read>(data: &mut R) -> StacksResult<Self>where
Self: Sized,
fn deserialize<R: Read>(data: &mut R) -> StacksResult<Self>where
Self: Sized,
Deserialize from a reader and return a StacksResult
Source§impl Debug for StacksAddress
impl Debug for StacksAddress
Source§impl Display for StacksAddress
impl Display for StacksAddress
Source§impl From<StacksAddress> for PrincipalData
impl From<StacksAddress> for PrincipalData
Source§fn from(address: StacksAddress) -> Self
fn from(address: StacksAddress) -> Self
Converts to this type from the input type.
Source§impl From<StacksAddress> for StandardPrincipalData
impl From<StacksAddress> for StandardPrincipalData
Source§fn from(address: StacksAddress) -> Self
fn from(address: StacksAddress) -> Self
Converts to this type from the input type.
Source§impl From<StacksAddress> for String
impl From<StacksAddress> for String
Source§fn from(address: StacksAddress) -> Self
fn from(address: StacksAddress) -> Self
Converts to this type from the input type.
Source§impl PartialEq for StacksAddress
impl PartialEq for StacksAddress
Source§impl Serialize for StacksAddress
impl Serialize for StacksAddress
Source§impl TryFrom<&str> for StacksAddress
impl TryFrom<&str> for StacksAddress
impl Eq for StacksAddress
impl StructuralPartialEq for StacksAddress
Auto Trait Implementations§
impl Freeze for StacksAddress
impl RefUnwindSafe for StacksAddress
impl Send for StacksAddress
impl Sync for StacksAddress
impl Unpin for StacksAddress
impl UnwindSafe for StacksAddress
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