This repository was archived by the owner on Feb 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,20 @@ class PaymentAction {
8181 }
8282 }
8383
84+ async estimateLightningFee ( { destination, satAmt } ) {
85+ try {
86+ const { payment, settings } = this . _store ;
87+ const { routes } = await this . _grpc . sendCommand ( 'queryRoutes' , {
88+ pub_key : destination ,
89+ amt : satAmt ,
90+ num_routes : 1 ,
91+ } ) ;
92+ payment . fee = toAmount ( parseSat ( routes [ 0 ] . total_fees ) , settings . unit ) ;
93+ } catch ( err ) {
94+ log . error ( `Estimating lightning fee failed!` , err ) ;
95+ }
96+ }
97+
8498 async payBitcoin ( ) {
8599 try {
86100 const { payment, settings } = this . _store ;
@@ -118,20 +132,6 @@ class PaymentAction {
118132 }
119133 await this . _transaction . update ( ) ;
120134 }
121-
122- async estimateLightningFee ( { destination, satAmt } ) {
123- try {
124- const { payment, settings } = this . _store ;
125- const { routes } = await this . _grpc . sendCommand ( 'queryRoutes' , {
126- pub_key : destination ,
127- amt : satAmt ,
128- num_routes : 1 ,
129- } ) ;
130- payment . fee = toAmount ( parseSat ( routes [ 0 ] . total_fees ) , settings . unit ) ;
131- } catch ( err ) {
132- log . error ( `Estimating lightning fee failed!` , err ) ;
133- }
134- }
135135}
136136
137137export default PaymentAction ;
You can’t perform that action at this time.
0 commit comments