pub enum AddressType {
P2PKH,
P2WPKH,
P2TR,
Ethereum,
}Expand description
Supported address types for vanity generation.
Variants§
P2PKH
Legacy P2PKH address (starts with 1 on mainnet).
P2WPKH
Native SegWit P2WPKH address (starts with bc1q on mainnet).
P2TR
Taproot P2TR address (starts with bc1p on mainnet).
Ethereum
Ethereum address (starts with 0x).
Implementations§
Source§impl AddressType
impl AddressType
Sourcepub fn valid_chars(&self) -> &'static str
pub fn valid_chars(&self) -> &'static str
Get the valid characters for this address type’s variable portion.
Sourcepub fn fixed_prefix(&self, testnet: bool) -> &'static str
pub fn fixed_prefix(&self, testnet: bool) -> &'static str
Get the fixed prefix for this address type on mainnet.
Sourcepub fn validate_pattern(
&self,
pattern: &str,
testnet: bool,
) -> Result<(), PatternError>
pub fn validate_pattern( &self, pattern: &str, testnet: bool, ) -> Result<(), PatternError>
Validate that a pattern is compatible with this address type.
Sourcepub fn derive_address(
&self,
key: &PrivateKey,
testnet: bool,
) -> Result<String, String>
pub fn derive_address( &self, key: &PrivateKey, testnet: bool, ) -> Result<String, String>
Derive an address from a private key.
Trait Implementations§
Source§impl Clone for AddressType
impl Clone for AddressType
Source§fn clone(&self) -> AddressType
fn clone(&self) -> AddressType
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 AddressType
impl Debug for AddressType
Source§impl Default for AddressType
impl Default for AddressType
Source§fn default() -> AddressType
fn default() -> AddressType
Returns the “default value” for a type. Read more
Source§impl Display for AddressType
impl Display for AddressType
Source§impl PartialEq for AddressType
impl PartialEq for AddressType
impl Copy for AddressType
impl Eq for AddressType
impl StructuralPartialEq for AddressType
Auto Trait Implementations§
impl Freeze for AddressType
impl RefUnwindSafe for AddressType
impl Send for AddressType
impl Sync for AddressType
impl Unpin for AddressType
impl UnwindSafe for AddressType
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 more