@@ -28,16 +28,16 @@ To add a `ChannelManager` to your application, run:
28
28
``` java
29
29
import org.ldk.batteries.ChannelManagerConstructor
30
30
31
- ChannelManagerConstructor channel_manager_constructor = new ChannelManagerConstructor (
31
+ ChannelManagerConstructor channelManagerConstructor = new ChannelManagerConstructor (
32
32
Network . LDKNetwork_Bitcoin ,
33
33
UserConfig . default (),
34
- best_block_hash ,
35
- block_height ,
36
- keys_manager . as_KeysInterface(),
37
- fee_estimator ,
38
- chain_monitor ,
34
+ latestBlockHash ,
35
+ latestBlockHeight ,
36
+ keysManager . as_KeysInterface(),
37
+ feeEstimator ,
38
+ chainMonitor ,
39
39
router,
40
- tx_broadcaster ,
40
+ txBroadcaster ,
41
41
logger
42
42
);
43
43
```
@@ -54,10 +54,10 @@ To add a `ChannelManager` to your application, run:
54
54
userConfig,
55
55
latestBlockHash,
56
56
latestBlockHeight,
57
- Global . keysManager? .as_KeysInterface(),
57
+ keysManager.as_KeysInterface(),
58
58
feeEstimator,
59
- Global . chainMonitor,
60
- Global . router,
59
+ chainMonitor,
60
+ router,
61
61
txBroadcaster,
62
62
logger
63
63
);
@@ -68,7 +68,7 @@ To add a `ChannelManager` to your application, run:
68
68
69
69
There are a few dependencies needed to get this working. Let's walk through setting up each one so we can plug them into our ` ChannelManager ` .
70
70
71
- ### Step 1. Initialize the ` FeeEstimator `
71
+ ### Initialize the ` FeeEstimator `
72
72
73
73
** What it's used for:** estimating fees for on-chain transactions that LDK wants broadcasted.
74
74
@@ -114,20 +114,33 @@ There are a few dependencies needed to get this working. Let's walk through sett
114
114
}
115
115
}
116
116
117
- FeeEstimator fee_estimator = FeeEstimator . new_impl(new YourFeeEstimator ());
117
+ FeeEstimator feeEstimator = FeeEstimator . new_impl(new YourFeeEstimator ());
118
118
```
119
119
120
120
</template >
121
121
122
122
<template v-slot:kotlin >
123
123
124
124
``` kotlin
125
- object LDKFeeEstimator: FeeEstimatorInterface {
126
- override fun get_est_sat_per_1000_weight (conf_target : ConfirmationTarget ? ): Int {
127
- // insert code to retieve a fee rate
125
+ object YourFeeEstimator : FeeEstimatorInterface {
126
+ override fun get_est_sat_per_1000_weight (confirmationTarget : ConfirmationTarget ? ): Int {
127
+ if (confirmationTarget == ConfirmationTarget .LDKConfirmationTarget_Background ) {
128
+ // <insert code to retrieve a background feerate>
129
+ }
130
+
131
+ if (confirmationTarget == ConfirmationTarget .LDKConfirmationTarget_Normal ) {
132
+ // <insert code to retrieve a normal (i.e. within ~6 blocks) feerate>
133
+ }
134
+
135
+ if (confirmationTarget == ConfirmationTarget .LDKConfirmationTarget_HighPriority ) {
136
+ // <insert code to retrieve a high-priority feerate>
137
+ }
138
+ // return default fee rate
128
139
}
129
- }
130
- ```
140
+ }
141
+
142
+ val feeEstimator: FeeEstimator = FeeEstimator .new_impl(YourFeeEstimator )
143
+ ```
131
144
132
145
</template >
133
146
</CodeSwitcher >
0 commit comments