File tree Expand file tree Collapse file tree 5 files changed +9
-6
lines changed
android/src/main/java/com/reactnativeldk Expand file tree Collapse file tree 5 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,8 @@ val RouteHop.asJson: WritableMap
203
203
fun ChannelMonitor.asJson (channelId : String ): WritableMap {
204
204
val result = Arguments .createMap()
205
205
result.putString(" channel_id" , channelId)
206
- result.putHexString(" funding_txo" , _funding_txo ._b )
206
+ result.putInt(" funding_txo_index" , _funding_txo ._a ._index .toInt())
207
+ result.putHexString(" funding_txo_txid" , _funding_txo ._a .to_channel_id().reversedArray())
207
208
result.putHexString(" counterparty_node_id" , _counterparty_node_id )
208
209
209
210
val balances = Arguments .createArray()
Original file line number Diff line number Diff line change @@ -967,7 +967,7 @@ class LdkModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMod
967
967
968
968
if (channelMonitor.is_ok) {
969
969
val channelMonitorResult = (channelMonitor as Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_OK )
970
- result.pushMap(channelMonitorResult.res._b .asJson(channelMonitorResult.res. _a .hexEncodedString() ))
970
+ result.pushMap(channelMonitorResult.res._b .asJson(channelId ))
971
971
}
972
972
}
973
973
Original file line number Diff line number Diff line change @@ -191,7 +191,8 @@ extension ChannelMonitor {
191
191
func asJson( channelId: String ) -> [ String : Any ? ] {
192
192
return [
193
193
" channel_id " : channelId,
194
- " funding_txo " : Data ( getFundingTxo ( ) . 1 ) . hexEncodedString ( ) ,
194
+ " funding_txo_index " : getFundingTxo ( ) . 0 . getIndex ( ) ,
195
+ " funding_txo_txid " : Data ( getFundingTxo ( ) . 0 . getTxid ( ) ? . reversed ( ) ?? [ ] ) . hexEncodedString ( ) ,
195
196
" counterparty_node_id " : Data ( getCounterpartyNodeId ( ) ?? [ ] ) . hexEncodedString ( ) ,
196
197
" claimable_balances " : getClaimableBalances ( ) . map ( { $0. asJson } )
197
198
]
Original file line number Diff line number Diff line change @@ -1040,12 +1040,12 @@ class Ldk: NSObject {
1040
1040
argB: keysManager. signerProvider
1041
1041
)
1042
1042
1043
- guard let ( channelId , channelMonitor) = channelMonitorResult. getValue ( ) else {
1043
+ guard let ( _ , channelMonitor) = channelMonitorResult. getValue ( ) else {
1044
1044
LdkEventEmitter . shared. send ( withEvent: . native_log, body: " Loading channel error. No channel value. " )
1045
1045
continue
1046
1046
}
1047
1047
1048
- result. append ( channelMonitor. asJson ( channelId: Data ( channelId) . hexEncodedString ( ) ) )
1048
+ result. append ( channelMonitor. asJson ( channelId: channelId) )
1049
1049
}
1050
1050
1051
1051
return resolve ( result)
Original file line number Diff line number Diff line change @@ -166,7 +166,8 @@ export type TChannel = {
166
166
167
167
export type TChannelMonitor = {
168
168
channel_id : string ;
169
- funding_txo : string ;
169
+ funding_txo_index : number ;
170
+ funding_txo_txid : string ;
170
171
counterparty_node_id : string ;
171
172
claimable_balances : [ TClaimableBalance ] ;
172
173
} ;
You can’t perform that action at this time.
0 commit comments