Struct bip47::PrivateCode
source · [−]pub struct PrivateCode { /* private fields */ }
Expand description
Represents the private side of a payment code, as seen from the perspective of the sender. This is what the sender will use in conjunction with a receiver’s public payment code in order to be able to send funds.
Implementations
sourceimpl PrivateCode
impl PrivateCode
sourcepub fn from_seed(
seed: &[u8],
account: u32,
network: Network
) -> Result<Self, Error>
pub fn from_seed(
seed: &[u8],
account: u32,
network: Network
) -> Result<Self, Error>
Constructs a new payment code from the private side using a BIP32 seed.
sourcepub fn from_seed_ephemeral(
seed: &[u8],
account: u32,
network: Network,
ephemeral_index: u32
) -> Result<Self, Error>
pub fn from_seed_ephemeral(
seed: &[u8],
account: u32,
network: Network,
ephemeral_index: u32
) -> Result<Self, Error>
Constructs a new ephemeral payment code at the given index from the private side using a BIP32 seed.
sourcepub fn v1_public_code(
&self,
bitmessage: Option<BitMessagePreference>
) -> PublicCode
pub fn v1_public_code(
&self,
bitmessage: Option<BitMessagePreference>
) -> PublicCode
Generates a version 1 public payment code matching this private payment code, optionally with bitmessage.
sourcepub fn v2_public_code(&self) -> PublicCode
pub fn v2_public_code(&self) -> PublicCode
Generates a version 2 public payment code matching this private payment code.
sourcepub fn private_key(
&self,
sender_code: &PublicCode,
i: u32
) -> Result<PrivateKey, Error>
pub fn private_key(
&self,
sender_code: &PublicCode,
i: u32
) -> Result<PrivateKey, Error>
Derives a receive private key at the given index, with respect to a public payment code. Used for spending purposes. If the index is invalid, it should be incremented.
Auto Trait Implementations
impl RefUnwindSafe for PrivateCode
impl Send for PrivateCode
impl Sync for PrivateCode
impl Unpin for PrivateCode
impl UnwindSafe for PrivateCode
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