Skip to content

Commit cda3ed9

Browse files
committed
fix: refactor getFeeEstimates, add comments to getFees
1 parent 021d686 commit cda3ed9

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/utils/lightning/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ export const getFees: TGetFees = async () => {
253253
});
254254
};
255255

256+
// fetch, validate and map fees from mempool.space to IOnchainFees
256257
const fetchMp = async (): Promise<IOnchainFees> => {
257258
const f1 = await fetch('https://mempool.space/api/v1/fees/recommended');
258259
const j: IGetFeeEstimatesResponse = await f1.json();
@@ -276,6 +277,7 @@ export const getFees: TGetFees = async () => {
276277
};
277278
};
278279

280+
// fetch, validate and map fees from Blocktank to IOnchainFees
279281
const fetchBt = async (): Promise<IOnchainFees> => {
280282
const f2 = await fetch('https://api1.blocktank.to/api/info');
281283
const j: IBtInfo = await f2.json();

src/utils/wallet/transactions.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -905,11 +905,7 @@ export const getFeeEstimates = async (
905905
}
906906

907907
const wallet = await getOnChainWalletAsync();
908-
const feeRes = await wallet.updateFeeEstimates(forceUpdate);
909-
if (feeRes.isErr()) {
910-
return err(feeRes.error);
911-
}
912-
return ok(feeRes.value);
908+
return wallet.updateFeeEstimates(forceUpdate);
913909
} catch (e) {
914910
return err(e);
915911
}

0 commit comments

Comments
 (0)