Struct breez_sdk_liquid::lightning::offers::refund::RefundBuilder

pub struct RefundBuilder<'a, T>
where T: Signing,
{ /* private fields */ }
Expand description

Builds a Refund for the “offer for money” flow.

See module-level documentation for usage.

This is not exported to bindings users as builder patterns don’t map outside of move semantics.

Implementations§

§

impl<'a> RefundBuilder<'a, SignOnly>

pub fn new( description: String, metadata: Vec<u8>, payer_id: PublicKey, amount_msats: u64, ) -> Result<RefundBuilder<'a, SignOnly>, Bolt12SemanticError>

Creates a new builder for a refund using the Refund::payer_id for the public node id to send to if no Refund::paths are set. Otherwise, it may be a transient pubkey.

Additionally, sets the required Refund::description, Refund::metadata, and Refund::amount_msats.

§

impl<'a, T> RefundBuilder<'a, T>
where T: Signing,

pub fn deriving_payer_id<ES>( description: String, node_id: PublicKey, expanded_key: &ExpandedKey, entropy_source: ES, secp_ctx: &'a Secp256k1<T>, amount_msats: u64, ) -> Result<RefundBuilder<'a, T>, Bolt12SemanticError>
where ES: Deref, <ES as Deref>::Target: EntropySource,

Similar to RefundBuilder::new except, if RefundBuilder::path is called, the payer id is derived from the given ExpandedKey and nonce. This provides sender privacy by using a different payer id for each refund, assuming a different nonce is used. Otherwise, the provided node_id is used for the payer id.

Also, sets the metadata when RefundBuilder::build is called such that it can be used to verify that an InvoiceRequest was produced for the refund given an ExpandedKey.

pub fn absolute_expiry(self, absolute_expiry: Duration) -> RefundBuilder<'a, T>

Sets the Refund::absolute_expiry as seconds since the Unix epoch. Any expiry that has already passed is valid and can be checked for using Refund::is_expired.

Successive calls to this method will override the previous setting.

pub fn issuer(self, issuer: String) -> RefundBuilder<'a, T>

Sets the Refund::issuer.

Successive calls to this method will override the previous setting.

pub fn path(self, path: BlindedPath) -> RefundBuilder<'a, T>

Adds a blinded path to Refund::paths. Must include at least one path if only connected by private channels or if Refund::payer_id is not a public node id.

Successive calls to this method will add another blinded path. Caller is responsible for not adding duplicate paths.

pub fn chain(self, network: Network) -> RefundBuilder<'a, T>

Sets the Refund::chain of the given Network for paying an invoice. If not called, Network::Bitcoin is assumed.

Successive calls to this method will override the previous setting.

pub fn quantity(self, quantity: u64) -> RefundBuilder<'a, T>

Sets Refund::quantity of items. This is purely for informational purposes. It is useful when the refund pertains to a Bolt12Invoice that paid for more than one item from an Offer as specified by InvoiceRequest::quantity.

Successive calls to this method will override the previous setting.

pub fn payer_note(self, payer_note: String) -> RefundBuilder<'a, T>

Sets the Refund::payer_note.

Successive calls to this method will override the previous setting.

pub fn build(self) -> Result<Refund, Bolt12SemanticError>

Builds a Refund after checking for valid semantics.

Auto Trait Implementations§

§

impl<'a, T> Freeze for RefundBuilder<'a, T>

§

impl<'a, T> RefUnwindSafe for RefundBuilder<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for RefundBuilder<'a, T>

§

impl<'a, T> Sync for RefundBuilder<'a, T>

§

impl<'a, T> Unpin for RefundBuilder<'a, T>

§

impl<'a, T> UnwindSafe for RefundBuilder<'a, T>
where T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> DartSafe for T

§

impl<T> TaskRetFutTrait for T
where T: Send,