Skip to content

Commit c3e518a

Browse files
committed
fix: fee types update
1 parent 84cb376 commit c3e518a

File tree

10 files changed

+11
-16
lines changed

10 files changed

+11
-16
lines changed

example/ldk/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ export const setupLdk = async (
132132
channelCloseMinimum: 10,
133133
minAllowedAnchorChannelRemoteFee: 10,
134134
maxAllowedNonAnchorChannelRemoteFee: 10,
135-
onChainSweep: 10,
136135
minAllowedNonAnchorChannelRemoteFee: 10,
137136
outputSpendingFee: 10,
137+
maximumFeeEstimate: 10,
138+
urgentOnChainSweep: 10,
138139
}),
139140
getTransactionData,
140141
getTransactionPosition,

example/tests/eclair.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,15 @@ describe('Eclair', function () {
105105
...profile.getStartParams(),
106106
getFees: () => {
107107
return Promise.resolve({
108-
onChainSweep: 30,
109108
maxAllowedNonAnchorChannelRemoteFee: Math.max(25, 30 * 10),
110109
minAllowedAnchorChannelRemoteFee: 5,
111110
minAllowedNonAnchorChannelRemoteFee: Math.max(5 - 1, 0),
112111
anchorChannelFee: 10,
113112
nonAnchorChannelFee: 20,
114113
channelCloseMinimum: 5,
115114
outputSpendingFee: 10,
115+
urgentOnChainSweep: 30,
116+
maximumFeeEstimate: 30
116117
});
117118
},
118119
});

example/tests/unit.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ describe('Unit', function () {
7070
channelCloseMinimum: 5,
7171
minAllowedAnchorChannelRemoteFee: 5,
7272
minAllowedNonAnchorChannelRemoteFee: 5,
73-
onChainSweep: 5,
7473
outputSpendingFee: 5,
74+
urgentOnChainSweep: 5,
75+
maximumFeeEstimate: 5,
7576
});
7677
},
7778
getTransactionData: async () => ({
@@ -214,8 +215,9 @@ describe('Unit', function () {
214215
channelCloseMinimum: 5,
215216
minAllowedAnchorChannelRemoteFee: 5,
216217
minAllowedNonAnchorChannelRemoteFee: 5,
217-
onChainSweep: 5,
218218
outputSpendingFee: 5,
219+
urgentOnChainSweep: 5,
220+
maximumFeeEstimate: 5,
219221
});
220222
},
221223
getTransactionData: async () => ({

example/tests/utils/test-profile.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,15 @@ export default class TestProfile {
7575
getScriptPubKeyHistory: this.getScriptPubKeyHistory,
7676
getFees: () =>
7777
Promise.resolve({
78-
onChainSweep: 4,
7978
maxAllowedNonAnchorChannelRemoteFee: Math.max(25, 4 * 10),
8079
minAllowedAnchorChannelRemoteFee: 1,
8180
minAllowedNonAnchorChannelRemoteFee: Math.max(1 - 1, 0),
8281
anchorChannelFee: 2,
8382
nonAnchorChannelFee: 3,
8483
channelCloseMinimum: 1,
8584
outputSpendingFee: 5,
85+
urgentOnChainSweep: 5,
86+
maximumFeeEstimate: 5,
8687
}),
8788
getTransactionData: this.getTransactionData,
8889
getTransactionPosition: this.getTransactionPosition,

lib/ios/Classes/LdkFeeEstimator.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class LdkFeeEstimator: FeeEstimator {
1313
private var nonAnchorChannelFee: UInt32 = 0
1414
private var channelCloseMinimum: UInt32 = 0
1515
private var minAllowedAnchorChannelRemoteFee: UInt32 = 0
16-
private var onChainSweep: UInt32 = 0
1716
private var minAllowedNonAnchorChannelRemoteFee: UInt32 = 0
1817
private var outputSpendingFee: UInt32 = 0
1918
private var maximumFeeEstimate: UInt32 = 0
@@ -24,7 +23,6 @@ class LdkFeeEstimator: FeeEstimator {
2423
nonAnchorChannelFee: UInt32,
2524
channelCloseMinimum: UInt32,
2625
minAllowedAnchorChannelRemoteFee: UInt32,
27-
onChainSweep: UInt32,
2826
minAllowedNonAnchorChannelRemoteFee: UInt32,
2927
outputSpendingFee: UInt32,
3028
maximumFeeEstimate: UInt32,
@@ -34,7 +32,6 @@ class LdkFeeEstimator: FeeEstimator {
3432
self.nonAnchorChannelFee = nonAnchorChannelFee
3533
self.channelCloseMinimum = channelCloseMinimum
3634
self.minAllowedAnchorChannelRemoteFee = minAllowedAnchorChannelRemoteFee
37-
self.onChainSweep = onChainSweep
3835
self.minAllowedNonAnchorChannelRemoteFee = minAllowedNonAnchorChannelRemoteFee
3936
self.outputSpendingFee = outputSpendingFee
4037
self.maximumFeeEstimate = maximumFeeEstimate

lib/ios/Ldk.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ @interface RCT_EXTERN_MODULE(Ldk, NSObject)
4949
nonAnchorChannelFee:(NSInteger *)nonAnchorChannelFee
5050
channelCloseMinimum:(NSInteger *)channelCloseMinimum
5151
minAllowedAnchorChannelRemoteFee:(NSInteger *)minAllowedAnchorChannelRemoteFee
52-
onChainSweep:(NSInteger *)onChainSweep
5352
minAllowedNonAnchorChannelRemoteFee:(NSInteger *)minAllowedNonAnchorChannelRemoteFee
5453
outputSpendingFee:(NSInteger *)outputSpendingFee
5554
maximumFeeEstimate:(NSInteger *)maximumFeeEstimate

lib/ios/Ldk.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,6 @@ class Ldk: NSObject {
623623
nonAnchorChannelFee: NSInteger,
624624
channelCloseMinimum: NSInteger,
625625
minAllowedAnchorChannelRemoteFee: NSInteger,
626-
onChainSweep: NSInteger,
627626
minAllowedNonAnchorChannelRemoteFee: NSInteger,
628627
outputSpendingFee: NSInteger,
629628
maximumFeeEstimate: NSInteger,
@@ -636,7 +635,6 @@ class Ldk: NSObject {
636635
nonAnchorChannelFee: UInt32(nonAnchorChannelFee),
637636
channelCloseMinimum: UInt32(channelCloseMinimum),
638637
minAllowedAnchorChannelRemoteFee: UInt32(minAllowedAnchorChannelRemoteFee),
639-
onChainSweep: UInt32(onChainSweep),
640638
minAllowedNonAnchorChannelRemoteFee: UInt32(minAllowedNonAnchorChannelRemoteFee),
641639
outputSpendingFee: UInt32(outputSpendingFee),
642640
maximumFeeEstimate: UInt32(maximumFeeEstimate),

lib/src/ldk.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ class LDK {
344344
nonAnchorChannelFee,
345345
channelCloseMinimum,
346346
minAllowedAnchorChannelRemoteFee,
347-
onChainSweep,
348347
minAllowedNonAnchorChannelRemoteFee,
349348
outputSpendingFee,
350349
maximumFeeEstimate,
@@ -357,7 +356,6 @@ class LDK {
357356
nonAnchorChannelFee * satsPerKw,
358357
channelCloseMinimum * satsPerKw,
359358
minAllowedAnchorChannelRemoteFee * satsPerKw,
360-
onChainSweep * satsPerKw,
361359
minAllowedNonAnchorChannelRemoteFee * satsPerKw,
362360
outputSpendingFee * satsPerKw,
363361
maximumFeeEstimate * satsPerKw,

lib/src/lightning-manager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ class LightningManager {
139139
channelCloseMinimum: 5,
140140
minAllowedAnchorChannelRemoteFee: 5,
141141
minAllowedNonAnchorChannelRemoteFee: 5,
142-
onChainSweep: 5,
143142
outputSpendingFee: 5,
144143
maximumFeeEstimate: 5,
145144
urgentOnChainSweep: 5,
@@ -2209,7 +2208,7 @@ class LightningManager {
22092208
*/
22102209
private async getOnChainSweepFeeRate(): Promise<number> {
22112210
try {
2212-
let satsPerVByte = (await this.getFees()).onChainSweep;
2211+
let satsPerVByte = (await this.getFees()).urgentOnChainSweep;
22132212
// Multiply by 250 because https://docs.rs/lightning/latest/lightning/chain/chaininterface/trait.FeeEstimator.html#tymethod.get_est_sat_per_1000_weight
22142213
return satsPerVByte * 250;
22152214
} catch (error) {

lib/src/utils/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ export type TFeeUpdateReq = {
250250
nonAnchorChannelFee: number;
251251
channelCloseMinimum: number;
252252
minAllowedAnchorChannelRemoteFee: number;
253-
onChainSweep: number;
254253
minAllowedNonAnchorChannelRemoteFee: number;
255254
outputSpendingFee: number;
256255
maximumFeeEstimate: number;

0 commit comments

Comments
 (0)