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

Commit 3846c43

Browse files
committed
chore: update swift bindings to ldk 0.0.118
1 parent a5b2692 commit 3846c43

36 files changed

Lines changed: 41041 additions & 39355 deletions

File tree

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ PODS:
302302
- React-jsinspector (0.70.6)
303303
- React-logger (0.70.6):
304304
- glog
305-
- react-native-ldk (0.0.113):
305+
- react-native-ldk (0.0.120):
306306
- React
307307
- react-native-randombytes (3.6.1):
308308
- React-Core
@@ -593,7 +593,7 @@ SPEC CHECKSUMS:
593593
React-jsiexecutor: b4a65947391c658450151275aa406f2b8263178f
594594
React-jsinspector: 60769e5a0a6d4b32294a2456077f59d0266f9a8b
595595
React-logger: 1623c216abaa88974afce404dc8f479406bbc3a0
596-
react-native-ldk: dd463969f46a47599bd622fc02a67d878f13abe5
596+
react-native-ldk: fc83520c891e58888c8f975a02ed394a4c4e1c36
597597
react-native-randombytes: 421f1c7d48c0af8dbcd471b0324393ebf8fe7846
598598
react-native-tcp-socket: c1b7297619616b4c9caae6889bcb0aba78086989
599599
React-perflogger: 8c79399b0500a30ee8152d0f9f11beae7fc36595

example/ldk/index.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,13 @@ export const setupLdk = async (
120120
getScriptPubKeyHistory,
121121
getFees: () =>
122122
Promise.resolve({
123-
highPriority: 10,
124-
normal: 5,
125-
background: 1,
126-
mempoolMinimum: 1,
123+
anchorChannelFee: 10,
124+
nonAnchorChannelFee: 10,
125+
channelCloseMinimum: 10,
126+
minAllowedAnchorChannelRemoteFee: 10,
127+
maxAllowedNonAnchorChannelRemoteFee: 10,
128+
onChainSweep: 10,
129+
minAllowedNonAnchorChannelRemoteFee: 10,
127130
}),
128131
getTransactionData,
129132
getTransactionPosition,

lib/android/libs/LDK-release.aar

93.9 KB
Binary file not shown.

lib/ios/Classes/LdkFeeEstimator.swift

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,47 @@ import Foundation
99
import LightningDevKit
1010

1111
class LdkFeeEstimator: FeeEstimator {
12-
private var high: UInt32 = 0
13-
private var normal: UInt32 = 0
14-
private var low: UInt32 = 0
15-
private var mempoolMinimum: UInt32 = 0
12+
private var anchorChannelFee: UInt32 = 0
13+
private var nonAnchorChannelFee: UInt32 = 0
14+
private var channelCloseMinimum: UInt32 = 0
15+
private var minAllowedAnchorChannelRemoteFee: UInt32 = 0
16+
private var maxAllowedNonAnchorChannelRemoteFee: UInt32 = 0
17+
private var onChainSweep: UInt32 = 0
18+
private var minAllowedNonAnchorChannelRemoteFee: UInt32 = 0
1619

17-
func update(high: UInt32, normal: UInt32, low: UInt32, mempoolMinimum: UInt32) {
18-
self.high = high
19-
self.normal = normal
20-
self.low = low
21-
self.mempoolMinimum = mempoolMinimum
20+
func update(anchorChannelFee: UInt32, nonAnchorChannelFee: UInt32, channelCloseMinimum: UInt32, minAllowedAnchorChannelRemoteFee: UInt32, maxAllowedNonAnchorChannelRemoteFee: UInt32, onChainSweep: UInt32, minAllowedNonAnchorChannelRemoteFee: UInt32) {
21+
self.anchorChannelFee = anchorChannelFee
22+
self.nonAnchorChannelFee = nonAnchorChannelFee
23+
self.channelCloseMinimum = channelCloseMinimum
24+
self.minAllowedAnchorChannelRemoteFee = minAllowedAnchorChannelRemoteFee
25+
self.maxAllowedNonAnchorChannelRemoteFee = maxAllowedNonAnchorChannelRemoteFee
26+
self.onChainSweep = onChainSweep
27+
self.minAllowedNonAnchorChannelRemoteFee = minAllowedNonAnchorChannelRemoteFee
2228

2329
LdkEventEmitter.shared.send(withEvent: .native_log, body: "Fee estimator updated")
2430
}
2531

2632
override func getEstSatPer1000Weight(confirmationTarget: Bindings.ConfirmationTarget) -> UInt32 {
2733
let target = confirmationTarget
2834

29-
if case ConfirmationTarget.HighPriority = target {
30-
return high
35+
switch target {
36+
case .AnchorChannelFee:
37+
return anchorChannelFee
38+
case .NonAnchorChannelFee:
39+
return nonAnchorChannelFee
40+
case .ChannelCloseMinimum:
41+
return channelCloseMinimum
42+
case .MinAllowedAnchorChannelRemoteFee:
43+
return minAllowedAnchorChannelRemoteFee
44+
case .MaxAllowedNonAnchorChannelRemoteFee:
45+
return maxAllowedNonAnchorChannelRemoteFee
46+
case .OnChainSweep:
47+
return onChainSweep
48+
case .MinAllowedNonAnchorChannelRemoteFee:
49+
return minAllowedNonAnchorChannelRemoteFee
50+
@unknown default:
51+
LdkEventEmitter.shared.send(withEvent: .native_log, body: "ERROR: New ConfirmationTarget added. Update LdkFeeEstimator.")
52+
return 0
3153
}
32-
33-
if case ConfirmationTarget.Normal = target {
34-
return normal
35-
}
36-
37-
if case ConfirmationTarget.Background = target {
38-
return low
39-
}
40-
41-
if case ConfirmationTarget.MempoolMinimum = target {
42-
return mempoolMinimum
43-
}
44-
45-
LdkEventEmitter.shared.send(withEvent: .native_log, body: "WARNING: New ConfirmationTarget added. Update LdkFeeEstimator.")
46-
47-
return normal
4854
}
4955
}

lib/ios/Ldk.m

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ @interface RCT_EXTERN_MODULE(Ldk, NSObject)
3737
reject:(RCTPromiseRejectBlock)reject)
3838

3939
//MARK: Update methods
40-
RCT_EXTERN_METHOD(updateFees:(NSInteger *)high
41-
normal:(NSInteger *)normal
42-
low:(NSInteger *)low
43-
mempoolMinimum:(NSInteger *)mempoolMinimum
40+
RCT_EXTERN_METHOD(updateFees:(NSInteger *)anchorChannelFee
41+
nonAnchorChannelFee:(NSInteger *)nonAnchorChannelFee
42+
channelCloseMinimum:(NSInteger *)channelCloseMinimum
43+
minAllowedAnchorChannelRemoteFee:(NSInteger *)minAllowedAnchorChannelRemoteFee
44+
maxAllowedNonAnchorChannelRemoteFee:(NSInteger *)maxAllowedNonAnchorChannelRemoteFee
45+
onChainSweep:(NSInteger *)onChainSweep
46+
minAllowedNonAnchorChannelRemoteFee:(NSInteger *)minAllowedNonAnchorChannelRemoteFee
4447
resolve:(RCTPromiseResolveBlock)resolve
4548
reject:(RCTPromiseRejectBlock)reject)
4649
RCT_EXTERN_METHOD(setLogLevel:(NSString *)level

lib/ios/Ldk.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,16 @@ class Ldk: NSObject {
525525
//MARK: Update methods
526526

527527
@objc
528-
func updateFees(_ high: NSInteger, normal: NSInteger, low: NSInteger, mempoolMinimum: NSInteger, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
529-
feeEstimator.update(high: UInt32(high), normal: UInt32(normal), low: UInt32(low), mempoolMinimum: UInt32(mempoolMinimum))
528+
func updateFees(_ anchorChannelFee: NSInteger, nonAnchorChannelFee: NSInteger, channelCloseMinimum: NSInteger, minAllowedAnchorChannelRemoteFee: NSInteger, maxAllowedNonAnchorChannelRemoteFee: NSInteger, onChainSweep: NSInteger, minAllowedNonAnchorChannelRemoteFee: NSInteger, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
529+
feeEstimator.update(
530+
anchorChannelFee: UInt32(anchorChannelFee),
531+
nonAnchorChannelFee: UInt32(nonAnchorChannelFee),
532+
channelCloseMinimum: UInt32(channelCloseMinimum),
533+
minAllowedAnchorChannelRemoteFee: UInt32(minAllowedAnchorChannelRemoteFee),
534+
maxAllowedNonAnchorChannelRemoteFee: UInt32(maxAllowedNonAnchorChannelRemoteFee),
535+
onChainSweep: UInt32(onChainSweep),
536+
minAllowedNonAnchorChannelRemoteFee: UInt32(minAllowedNonAnchorChannelRemoteFee)
537+
)
530538
return handleResolve(resolve, .fees_updated)
531539
}
532540

lib/ios/LightningDevKit.xcframework/Info.plist

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@
88
<key>DebugSymbolsPath</key>
99
<string>dSYMs</string>
1010
<key>LibraryIdentifier</key>
11-
<string>ios-arm64</string>
11+
<string>ios-arm64_x86_64-simulator</string>
1212
<key>LibraryPath</key>
1313
<string>LightningDevKit.framework</string>
1414
<key>SupportedArchitectures</key>
1515
<array>
1616
<string>arm64</string>
17+
<string>x86_64</string>
1718
</array>
1819
<key>SupportedPlatform</key>
1920
<string>ios</string>
21+
<key>SupportedPlatformVariant</key>
22+
<string>simulator</string>
2023
</dict>
2124
<dict>
2225
<key>DebugSymbolsPath</key>
2326
<string>dSYMs</string>
2427
<key>LibraryIdentifier</key>
25-
<string>ios-arm64_x86_64-simulator</string>
28+
<string>ios-arm64</string>
2629
<key>LibraryPath</key>
2730
<string>LightningDevKit.framework</string>
2831
<key>SupportedArchitectures</key>
2932
<array>
3033
<string>arm64</string>
31-
<string>x86_64</string>
3234
</array>
3335
<key>SupportedPlatform</key>
3436
<string>ios</string>
35-
<key>SupportedPlatformVariant</key>
36-
<string>simulator</string>
3737
</dict>
3838
</array>
3939
<key>CFBundlePackageType</key>

lib/ios/LightningDevKit.xcframework/ios-arm64/LightningDevKit.framework/Headers/ldk_rust_types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ struct nativeDelayedPaymentOutputDescriptorOpaque;
2424
typedef struct nativeDelayedPaymentOutputDescriptorOpaque LDKnativeDelayedPaymentOutputDescriptor;
2525
struct nativeStaticPaymentOutputDescriptorOpaque;
2626
typedef struct nativeStaticPaymentOutputDescriptorOpaque LDKnativeStaticPaymentOutputDescriptor;
27+
struct nativeChannelDerivationParametersOpaque;
28+
typedef struct nativeChannelDerivationParametersOpaque LDKnativeChannelDerivationParameters;
29+
struct nativeHTLCDescriptorOpaque;
30+
typedef struct nativeHTLCDescriptorOpaque LDKnativeHTLCDescriptor;
2731
struct LDKChannelSigner;
2832
struct nativeInMemorySignerOpaque;
2933
typedef struct nativeInMemorySignerOpaque LDKnativeInMemorySigner;
@@ -121,12 +125,8 @@ struct nativeNodeAliasOpaque;
121125
typedef struct nativeNodeAliasOpaque LDKnativeNodeAlias;
122126
struct nativeNodeInfoOpaque;
123127
typedef struct nativeNodeInfoOpaque LDKnativeNodeInfo;
124-
struct nativeChannelDerivationParametersOpaque;
125-
typedef struct nativeChannelDerivationParametersOpaque LDKnativeChannelDerivationParameters;
126128
struct nativeAnchorDescriptorOpaque;
127129
typedef struct nativeAnchorDescriptorOpaque LDKnativeAnchorDescriptor;
128-
struct nativeHTLCDescriptorOpaque;
129-
typedef struct nativeHTLCDescriptorOpaque LDKnativeHTLCDescriptor;
130130
struct nativeInputOpaque;
131131
typedef struct nativeInputOpaque LDKnativeInput;
132132
struct nativeUtxoOpaque;

lib/ios/LightningDevKit.xcframework/ios-arm64/LightningDevKit.framework/Headers/ldk_ver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ static inline int _ldk_strncmp(const char *s1, const char *s2, uint64_t n) {
88
return 0;
99
}
1010

11-
#define _LDK_HEADER_VER "v0.0.117-rc1-44-g4b81eb2c308e657b"
12-
#define _LDK_C_BINDINGS_HEADER_VER "v0.0.117.1"
11+
#define _LDK_HEADER_VER "v0.0.118-15-g5df414c25b1b710b"
12+
#define _LDK_C_BINDINGS_HEADER_VER "v0.0.118.0"
1313
static inline const char* check_get_ldk_version() {
1414
LDKStr bin_ver = _ldk_get_compiled_version();
1515
if (_ldk_strncmp(_LDK_HEADER_VER, (const char*)bin_ver.chars, bin_ver.len) != 0) {

0 commit comments

Comments
 (0)