pub struct SpAddress { /* private fields */ }Expand description
A BIP 352 Silent Payment address.
Contains a scan public key, a spend public key, a protocol version, and
a network identifier. Constructed via FromStr (parsing) or
SpAddress::new (from key components).
§Examples
use std::str::FromStr;
use silent_payments_core::address::SpAddress;
// Parse a mainnet SP address (would succeed with a real address)
// let addr = SpAddress::from_str("sp1qq...")?;
// assert_eq!(addr.version(), 0);Implementations§
Source§impl SpAddress
impl SpAddress
Sourcepub fn new(
scan: ScanPublicKey,
spend: SpendPublicKey,
network: Network,
) -> SpAddress
pub fn new( scan: ScanPublicKey, spend: SpendPublicKey, network: Network, ) -> SpAddress
Construct a new version-0 SP address from key components.
Sourcepub fn scan_pubkey(&self) -> &ScanPublicKey
pub fn scan_pubkey(&self) -> &ScanPublicKey
The receiver’s scan public key (B_scan).
Sourcepub fn spend_pubkey(&self) -> &SpendPublicKey
pub fn spend_pubkey(&self) -> &SpendPublicKey
The receiver’s spend public key (B_spend).
Trait Implementations§
Source§impl From<SpAddress> for SpDescriptor
impl From<SpAddress> for SpDescriptor
Source§fn from(address: SpAddress) -> SpDescriptor
fn from(address: SpAddress) -> SpDescriptor
Converts to this type from the input type.
impl Eq for SpAddress
impl StructuralPartialEq for SpAddress
Auto Trait Implementations§
impl Freeze for SpAddress
impl RefUnwindSafe for SpAddress
impl Send for SpAddress
impl Sync for SpAddress
impl Unpin for SpAddress
impl UnsafeUnpin for SpAddress
impl UnwindSafe for SpAddress
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