Skip to content

Commit b08215d

Browse files
authored
Merge pull request #956 from breez/savage-v0.4.0
Prepare v0.4.0 release
2 parents cd65efc + 5387b59 commit b08215d

File tree

15 files changed

+101
-29
lines changed

15 files changed

+101
-29
lines changed

libs/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ members = [
1313
resolver = "2"
1414

1515
[workspace.package]
16-
version = "0.4.0-rc5"
16+
version = "0.4.0"
1717

1818
[workspace.dependencies]
1919
uniffi = "0.23.0"

libs/sdk-bindings/bindings-android/lib/src/main/kotlin/breez_sdk_notification/Constants.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ object Constants {
6969
"swap_tx_confirmed_notification_channel_description"
7070
const val SWAP_TX_CONFIRMED_NOTIFICATION_CHANNEL_NAME =
7171
"swap_tx_confirmed_notification_channel_name"
72-
const val SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE =
72+
const val SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT =
7373
"swap_tx_confirmed_notification_failure_text"
74+
const val SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE =
75+
"swap_tx_confirmed_notification_failure_title"
7476
const val SWAP_TX_CONFIRMED_NOTIFICATION_TITLE =
7577
"swap_tx_confirmed_notification_title"
7678
const val SWAP_TX_CONFIRMED_WORKGROUP_ID = "swap_tx"
@@ -116,8 +118,10 @@ object Constants {
116118
"Notifications for received swaps when the application is in the background"
117119
const val DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_CHANNEL_NAME =
118120
"Received Swaps"
121+
const val DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT =
122+
"Tap to complete swap"
119123
const val DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE =
120-
"Redeem Swap Failed"
124+
"Swap Ongoing"
121125
const val DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_TITLE =
122126
"Swap Confirmed"
123127
const val DEFAULT_SWAP_TX_CONFIRMED_WORKGROUP_DESCRIPTION =

libs/sdk-bindings/bindings-android/lib/src/main/kotlin/breez_sdk_notification/job/RedeemSwap.kt

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ package breez_sdk_notification.job
33
import android.content.Context
44
import breez_sdk.BlockingBreezServices
55
import breez_sdk.BreezEvent
6+
import breez_sdk_notification.Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT
67
import breez_sdk_notification.Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE
78
import breez_sdk_notification.Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_TITLE
89
import breez_sdk_notification.Constants.NOTIFICATION_CHANNEL_SWAP_TX_CONFIRMED
10+
import breez_sdk_notification.Constants.SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT
911
import breez_sdk_notification.Constants.SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE
1012
import breez_sdk_notification.Constants.SWAP_TX_CONFIRMED_NOTIFICATION_TITLE
1113
import breez_sdk_notification.NotificationHelper.Companion.notifyChannel
@@ -39,6 +41,7 @@ class RedeemSwapJob(
3941
logger.log(TAG, "Found swap for ${request.address}", "INFO")
4042
} catch (e: Exception) {
4143
logger.log(TAG, "Failed to manually redeem swap notification: ${e.message}", "WARN")
44+
notifyFailure()
4245
}
4346
}
4447

@@ -60,9 +63,11 @@ class RedeemSwapJob(
6063
}
6164
}
6265

63-
override fun onShutdown() {}
66+
override fun onShutdown() {
67+
notifyFailure()
68+
}
6469

65-
private fun notifySuccessAndShutdown(address: String) {
70+
private fun notifySuccessAndShutdown(address: String) {
6671
logger.log(TAG, "Swap address $address redeemed successfully", "INFO")
6772
notifyChannel(
6873
context,
@@ -75,4 +80,24 @@ class RedeemSwapJob(
7580
)
7681
fgService.onFinished(this)
7782
}
83+
84+
private fun notifyFailure() {
85+
this.bitcoinAddress?.let{address ->
86+
logger.log(TAG, "Swap address $address not redeemed", "INFO")
87+
notifyChannel(
88+
context,
89+
NOTIFICATION_CHANNEL_SWAP_TX_CONFIRMED,
90+
getString(
91+
context,
92+
SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE,
93+
DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE
94+
),
95+
getString(
96+
context,
97+
SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT,
98+
DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT
99+
),
100+
)
101+
}
102+
}
78103
}

libs/sdk-bindings/bindings-swift/Sources/BreezSDK/Constants.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct Constants {
2424
static let PAYMENT_RECEIVED_NOTIFICATION_TITLE = "payment_received_notification_title"
2525
static let PAYMENT_RECEIVED_NOTIFICATION_FAILURE_TITLE = "payment_received_notification_failure_title"
2626
static let SWAP_TX_CONFIRMED_NOTIFICATION_TITLE = "swap_tx_confirmed_notification_title"
27+
static let SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT = "swap_tx_confirmed_notification_failure_text"
2728
static let SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE = "swap_tx_confirmed_notification_failure_title"
2829

2930
// Resource Identifier Defaults
@@ -35,5 +36,6 @@ struct Constants {
3536
static let DEFAULT_PAYMENT_RECEIVED_NOTIFICATION_TITLE = "Received %d sats"
3637
static let DEFAULT_PAYMENT_RECEIVED_NOTIFICATION_FAILURE_TITLE = "Receive Payment Failed"
3738
static let DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_TITLE = "Swap Confirmed"
38-
static let DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE = "Redeem Swap Failed"
39+
static let DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT = "Tap to complete swap"
40+
static let DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE = "Swap Ongoing"
3941
}

libs/sdk-bindings/bindings-swift/Sources/BreezSDK/Task/RedeemSwap.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class RedeemSwapTask : TaskProtocol {
2929
if address == swapInfo.bitcoinAddress {
3030
if (swapInfo.paidMsat > 0) {
3131
self.logger.log(tag: TAG, line: "Swap address \(swapInfo.bitcoinAddress) redeemed succesfully", level: "INFO")
32-
let successRedeemSwap = ResourceHelper.shared.getString(key: Constants.SWAP_TX_CONFIRMED_NOTIFICATION_TITLE, fallback: Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_TITLE)
33-
self.displayPushNotification(title: successRedeemSwap, logger: self.logger, threadIdentifier: Constants.NOTIFICATION_THREAD_SWAP_TX_CONFIRMED)
32+
let notificationTitle = ResourceHelper.shared.getString(key: Constants.SWAP_TX_CONFIRMED_NOTIFICATION_TITLE, fallback: Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_TITLE)
33+
self.displayPushNotification(title: notificationTitle, logger: self.logger, threadIdentifier: Constants.NOTIFICATION_THREAD_SWAP_TX_CONFIRMED)
3434
}
3535
}
3636
break
@@ -65,7 +65,8 @@ class RedeemSwapTask : TaskProtocol {
6565
}
6666

6767
func onShutdown() {
68-
let failRedeemSwap = ResourceHelper.shared.getString(key: Constants.SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE, fallback: Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE)
69-
self.displayPushNotification(title: failRedeemSwap, logger: self.logger, threadIdentifier: Constants.NOTIFICATION_THREAD_SWAP_TX_CONFIRMED)
68+
let notificationTitle = ResourceHelper.shared.getString(key: Constants.SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE, fallback: Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE)
69+
let notificationBody = ResourceHelper.shared.getString(key: Constants.SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT, fallback: Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT)
70+
self.displayPushNotification(title: notificationTitle, body: notificationBody, logger: self.logger, threadIdentifier: Constants.NOTIFICATION_THREAD_SWAP_TX_CONFIRMED)
7071
}
7172
}

libs/sdk-bindings/bindings-swift/Sources/BreezSDK/TaskProtocol.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public protocol TaskProtocol : EventListener {
1010
}
1111

1212
extension TaskProtocol {
13-
func displayPushNotification(title: String, logger: ServiceLogger, threadIdentifier: String? = nil) {
13+
func displayPushNotification(title: String, body: String? = nil, logger: ServiceLogger, threadIdentifier: String? = nil) {
1414
logger.log(tag: "TaskProtocol", line:"displayPushNotification \(title)", level: "INFO")
1515
guard
1616
let contentHandler = contentHandler,
@@ -19,8 +19,12 @@ extension TaskProtocol {
1919
return
2020
}
2121

22-
if threadIdentifier != nil {
23-
bestAttemptContent.threadIdentifier = threadIdentifier!
22+
if let body = body {
23+
bestAttemptContent.body = body
24+
}
25+
26+
if let threadIdentifier = threadIdentifier {
27+
bestAttemptContent.threadIdentifier = threadIdentifier
2428
}
2529

2630
bestAttemptContent.title = title

libs/sdk-flutter/CHANGELOG.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,46 @@
11
SDK release notes can be found at [breez-sdk/releases](https://github.com/breez/breez-sdk/releases/)
2+
## 0.4.0
3+
* **Breaking** Update Dart SDK range to be compatible with Flutter 3.19
4+
* **Breaking** Replace parameters of `connect` with `ConnectRequest`.
5+
* **Breaking** `serviceHealthCheck` API now requires an `apiKey` which properly conducts a health check when services are offline.
6+
* **Deprecation** `sendOnchain` is now deprecated. Use `payOnchain` instead.
7+
* **Deprecation** `inProgressReverseSwaps` is now deprecated. Use `inProgressOnchainPayments` instead.
8+
* **Deprecation** `fetchReverseSwapFees` is now deprecated. Use `prepareOnchainPayment` instead.
9+
* Introduce `swapEventsStream` to listen in on swap events.
10+
* Introduce `rescanSwaps` API to iterate all historical swap addresses and fetch their current status from the blockchain.
11+
* Introduce `configureNode` API to configure an optional address to send funds to during a mutual channel close.
12+
* Introduce `onchainPaymentLimits` API to fetch latest on-chain payment limits.
13+
* Notification Service plugins are now bundled with the Flutter package. [Setup guide](https://sdk-doc-prerelease.breez.technology/notifications/setup_plugin.html).
14+
* Various improvements to Notification Service plugins:
15+
- Set log stream natively on Android.
16+
- Allow setting channel setup fee limit through `ServiceConfig` that will be used to accept or decline LNURL-Payments that require a channel opening.
17+
- Notifications on iOS are now grouped.
18+
- Improved resource management.
19+
- Notification Service is no longer attempted to start without permissions to show notifications on Android, which lead to an application crash.
20+
21+
## 0.3.9
22+
* Introduce `generateDiagnosticData` API to generate diagnostic data.
23+
* Fix swap confirmed block to be the earliest.
24+
25+
## 0.3.8
26+
* Signer connects immediately on startup (fixes 30 seconds delay).
27+
* Adapt signer policy to allow paying zero amount invoice.
28+
* Update signer keep alive.
29+
30+
## 0.3.6
31+
* Fix swap `INVOICE_AMOUNT_MISMATCH`.
32+
* Defer signer start to increase overall startup time.
33+
* Improve performance by reusing Breez server grpc connection.
34+
35+
## 0.3.3
36+
* Upgrade to VLS 0.11.
37+
238
## 0.3.2
3-
* Fixed a signer crash
39+
* Fixed a signer crash.
440

541
## 0.3.1
642
* Support notifications via a webhook after a swap transaction confirms.
7-
* Reduced package size by not bundling pre-built binaries
43+
* Reduced package size by not bundling pre-built binaries.
844

945
## 0.3.0
1046
* Fixes compatibility issues ith `bdk-flutter` plugin.
@@ -13,9 +49,9 @@ SDK release notes can be found at [breez-sdk/releases](https://github.com/breez/
1349
* Introduce `setPaymentMetadata` API to set the external metadata of a payment as a valid JSON string.
1450
* Add optional `chainnotifierUrl` to `Config`.
1551
* Include `openChannelBolt11`, `lnurlPayDomain`, `reverseSwapInfo` in `LnPaymentDetails`.
16-
`openChannelBolt11` for received payments which required to open a channel.
17-
`lnurlPayDomain` for sent payments that are not to a Lightning Address.
18-
`reverseSwapInfo` for payments that were sent in the context of a reverse swap.
52+
- `openChannelBolt11` for received payments which required to open a channel.
53+
- `lnurlPayDomain` for sent payments that are not to a Lightning Address.
54+
- `reverseSwapInfo` for payments that were sent in the context of a reverse swap.
1955

2056
## 0.2.15
2157
* This is a hotfix release that fixes a critical issue from previous release.
@@ -58,12 +94,12 @@ SDK release notes can be found at [breez-sdk/releases](https://github.com/breez/
5894
## 0.2.7
5995
* **Breaking** All APIs which previously allowed multiple parameters to be
6096
passed now require their corresponding `Request` object.
61-
These API's include: `sendOnchain`, `sendPayment`, `sendSpontaneousPayment`, `refund`, `lnurlPay`, `lnurlWithdraw`.
97+
These APIs include: `sendOnchain`, `sendPayment`, `sendSpontaneousPayment`, `refund`, `lnurlPay`, `lnurlWithdraw`.
6298
* **Breaking** All `request` params is renamed to `req`.
6399
* **Breaking** All `reqData` params that belong to a `req` object(_lnurlPay, lnurlWithdraw except lnurlAuth_) is renamed to `data`.
64100
* **Breaking** Use millisatoshi instead of satoshi for lightning amounts.
65101
`ReceivePaymentRequest`, `SendPaymentRequest`, `SendSpontaneousPaymentRequest` now use `amount_msat` instead of `amount_sat`.
66102
* Support pagination in `listPayments`.
67103
* Add optional `claimTxid` and `lockTxid` to `ReverseSwapInfo`.
68104
* Add `closingTxid` to closed channels received in payments list.
69-
* Allow `GetInfo` command to be executed through `executeCommand` API.
105+
* Allow `GetInfo` command to be executed through `executeCommand` API.

libs/sdk-flutter/android/build.gradle.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'com.breez.breez_sdk'
2-
version '0.4.0-rc5'
2+
version '0.4.0'
33

44
buildscript {
55
ext.kotlin_version = '1.8.20'

libs/sdk-flutter/ios/breez_sdk.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Run `pod lib lint breez_sdk.podspec` to validate before publishing.
33
Pod::Spec.new do |s|
44
s.name = 'breez_sdk'
5-
s.version = '0.4.0-rc5'
5+
s.version = '0.4.0'
66
s.summary = 'BreezSDK flutter plugin.'
77
s.description = <<-DESC
88
BreezSDK flutter plugin.

libs/sdk-flutter/ios/breez_sdk.podspec.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tag_version = '0.4.0-rc5'
1+
tag_version = '0.4.0'
22
framework = 'breez_sdkFFI.xcframework'
33
lib_name = "breez-sdkFFI.#{tag_version}"
44
url = "https://github.com/breez/breez-sdk-swift/releases/download/#{tag_version}/#{framework}.zip"

libs/sdk-flutter/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: breez_sdk
22
description: Flutter bindings for the Breez SDK
33
repository: https://github.com/breez/breez-sdk-flutter
4-
version: 0.4.0-rc5
4+
version: 0.4.0
55

66
environment:
77
sdk: '>=3.3.0 <4.0.0'

libs/sdk-react-native/example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"rebuild": "rm -rf node_modules && yarn && yarn pods"
1414
},
1515
"dependencies": {
16-
"@breeztech/react-native-breez-sdk": "0.4.0-rc5",
16+
"@breeztech/react-native-breez-sdk": "0.4.0",
1717
"@dreson4/react-native-quick-bip39": "^0.0.5",
1818
"react": "18.1.0",
1919
"react-native": "0.70.15",

libs/sdk-react-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@breeztech/react-native-breez-sdk",
3-
"version": "0.4.0-rc5",
3+
"version": "0.4.0",
44
"description": "React Native Breez SDK",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

tools/sdk-cli/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)