Struct bip47::PublicCode
source · [−]pub struct PublicCode {
pub network: Network,
/* private fields */
}
Expand description
Represents the public side of a payment code. This is what the party that wishes to receive funds shares with sending parties.
Fields
network: Network
Implementations
sourceimpl PublicCode
impl PublicCode
sourcepub fn from_wif(payment_code: &str) -> Result<Self, Error>
pub fn from_wif(payment_code: &str) -> Result<Self, Error>
Parses a WIF-formatted payment code.
sourcepub fn notification_mode(&self) -> NotificationMode<'_>
pub fn notification_mode(&self) -> NotificationMode<'_>
Returns the notification mode to be used with this payment code.
sourcepub fn address(
&self,
code: &PrivateCode,
i: u32,
segwit: bool
) -> Result<Address, Error>
pub fn address(
&self,
code: &PrivateCode,
i: u32,
segwit: bool
) -> Result<Address, Error>
Derives a send address at the given index. If the index is invalid, it should be incremented.
sourcepub fn from_notification(
receiver_code: &PrivateCode,
designated: Option<(PublicKey, OutPoint)>,
tx: &Transaction
) -> Result<Self, Error>
pub fn from_notification(
receiver_code: &PrivateCode,
designated: Option<(PublicKey, OutPoint)>,
tx: &Transaction
) -> Result<Self, Error>
Attempts to extract a public payment code from a notification transaction. If the designated pubkey
and input are unknown and set to None
, automatic extraction will be attempted. They can also be
supplied if they are known (for example if acquired through a side channel).
Trait Implementations
sourceimpl Debug for PublicCode
impl Debug for PublicCode
Auto Trait Implementations
impl RefUnwindSafe for PublicCode
impl Send for PublicCode
impl Sync for PublicCode
impl Unpin for PublicCode
impl UnwindSafe for PublicCode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more