Skip to content

Commit

Permalink
Update RN bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
ok300 committed Oct 16, 2023
1 parent 86d0e99 commit 458c304
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ fun asClosedChannelPaymentDetails(data: ReadableMap): ClosedChannelPaymentDetail
"shortChannelId",
"state",
"fundingTxid",
"closingTxid",
),
)
) {
Expand All @@ -331,7 +330,7 @@ fun asClosedChannelPaymentDetails(data: ReadableMap): ClosedChannelPaymentDetail
val shortChannelId = data.getString("shortChannelId")!!
val state = data.getString("state")?.let { asChannelState(it) }!!
val fundingTxid = data.getString("fundingTxid")!!
val closingTxid = data.getString("closingTxid")!!
val closingTxid = if (hasNonNullKey(data, "closingTxid")) data.getString("closingTxid") else null
return ClosedChannelPaymentDetails(
shortChannelId,
state,
Expand Down
4 changes: 2 additions & 2 deletions libs/sdk-react-native/ios/BreezSDKMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class BreezSDKMapper {
let state = try asChannelState(type: stateTmp)

guard let fundingTxid = data["fundingTxid"] as? String else { throw SdkError.Generic(message: "Missing mandatory field fundingTxid for type ClosedChannelPaymentDetails") }
guard let closingTxid = data["closingTxid"] as? String else { throw SdkError.Generic(message: "Missing mandatory field closingTxid for type ClosedChannelPaymentDetails") }
let closingTxid = data["closingTxid"] as? String

return ClosedChannelPaymentDetails(
shortChannelId: shortChannelId,
Expand All @@ -309,7 +309,7 @@ class BreezSDKMapper {
"shortChannelId": closedChannelPaymentDetails.shortChannelId,
"state": valueOf(channelState: closedChannelPaymentDetails.state),
"fundingTxid": closedChannelPaymentDetails.fundingTxid,
"closingTxid": closedChannelPaymentDetails.closingTxid,
"closingTxid": closedChannelPaymentDetails.closingTxid == nil ? nil : closedChannelPaymentDetails.closingTxid,
]
}

Expand Down
2 changes: 1 addition & 1 deletion libs/sdk-react-native/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export type ClosedChannelPaymentDetails = {
shortChannelId: string
state: ChannelState
fundingTxid: string
closingTxid: string
closingTxid?: string
}

export type Config = {
Expand Down

0 comments on commit 458c304

Please sign in to comment.