File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,11 @@ impl SenderSessionHistory {
7373 pub fn endpoints ( & self ) -> Option < Arc < Url > > {
7474 self . 0 . 0 . endpoint ( ) . map ( |url| Arc :: new ( url. clone ( ) . into ( ) ) )
7575 }
76+
77+ /// Fallback transaction from the session if present
78+ pub fn fallback_tx ( & self ) -> Option < Arc < crate :: Transaction > > {
79+ self . 0 . 0 . fallback_tx ( ) . map ( |tx| Arc :: new ( tx. into ( ) ) )
80+ }
7681}
7782
7883#[ derive( uniffi:: Object ) ]
Original file line number Diff line number Diff line change @@ -67,6 +67,15 @@ pub struct SessionHistory {
6767}
6868
6969impl SessionHistory {
70+ /// Fallback transaction from the session if present
71+ pub fn fallback_tx ( & self ) -> Option < bitcoin:: Transaction > {
72+ self . events . iter ( ) . find_map ( |event| match event {
73+ SessionEvent :: CreatedReplyKey ( proposal) =>
74+ Some ( proposal. v1 . psbt . clone ( ) . extract_tx_unchecked_fee_rate ( ) ) ,
75+ _ => None ,
76+ } )
77+ }
78+
7079 pub fn endpoint ( & self ) -> Option < & Url > {
7180 self . events . iter ( ) . find_map ( |event| match event {
7281 SessionEvent :: V2GetContext ( ctx) => Some ( & ctx. endpoint ) ,
You can’t perform that action at this time.
0 commit comments