Skip to content

Commit

Permalink
feat: expose funding_output_index
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasonvdb committed Aug 13, 2024
1 parent 7ed1708 commit f8be09a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ PODS:
- React-jsinspector (0.72.4)
- React-logger (0.72.4):
- glog
- react-native-ldk (0.0.145):
- react-native-ldk (0.0.148):
- React
- react-native-randombytes (3.6.1):
- React-Core
Expand Down Expand Up @@ -621,7 +621,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: c7f826e40fa9cab5d37cab6130b1af237332b594
React-jsinspector: aaed4cf551c4a1c98092436518c2d267b13a673f
React-logger: da1ebe05ae06eb6db4b162202faeafac4b435e77
react-native-ldk: 496216796eafbd77c43cd5228342460a242cf7ed
react-native-ldk: fda4d4381d40401bdc5c3a9965937d19b232ed08
react-native-randombytes: 421f1c7d48c0af8dbcd471b0324393ebf8fe7846
react-native-tcp-socket: c1b7297619616b4c9caae6889bcb0aba78086989
React-NativeModulesApple: edb5ace14f73f4969df6e7b1f3e41bef0012740f
Expand Down
1 change: 1 addition & 0 deletions lib/android/src/main/java/com/reactnativeldk/Helpers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ val ChannelDetails.asJson: WritableMap
result.putInt("balance_sat", (_balance_msat / 1000).toInt())
result.putHexString("counterparty_node_id", _counterparty._node_id)
result.putHexString("funding_txid", _funding_txo?._txid?.reversed()?.toByteArray())
_funding_txo?._index?.toInt()?.let { result.putInt("funding_output_index", it) }
result.putHexString("channel_type", _channel_type?.write())
result.putString("user_channel_id", _user_channel_id.leBytes.hexEncodedString())
result.putInt("confirmations_required", (_confirmations_required as Option_u32Z.Some).some)
Expand Down
1 change: 1 addition & 0 deletions lib/ios/Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ extension ChannelDetails {
"balance_sat": getBalanceMsat() / 1000,
"counterparty_node_id": Data(getCounterparty().getNodeId()).hexEncodedString(),
"funding_txid": Data(getFundingTxo()?.getTxid()?.reversed() ?? []).hexEncodedString(),
"funding_output_index": getFundingTxo()?.getIndex() as Any, // Optional number
"channel_type": Data(getChannelType()?.write() ?? []).hexEncodedString(),
"user_channel_id": Data(getUserChannelId()).hexEncodedString(), //String
"confirmations_required": getConfirmationsRequired() as Any, // Optional number
Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@synonymdev/react-native-ldk",
"title": "React Native LDK",
"version": "0.0.146",
"version": "0.0.148",
"description": "React Native wrapper for LDK",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions lib/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export type TChannel = {
balance_sat: number;
counterparty_node_id: string;
funding_txid?: string;
funding_output_index? : number;
channel_type?: string;
user_channel_id: string;
confirmations_required?: number;
Expand Down

0 comments on commit f8be09a

Please sign in to comment.