Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 1904c61

Browse files
committed
Move function up
1 parent e06a946 commit 1904c61

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/action/payment.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff 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

137137
export default PaymentAction;

0 commit comments

Comments
 (0)