Skip to content

Commit

Permalink
Update Breez SDK Flutter package to version v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed May 4, 2024
1 parent 6fc4037 commit eb0a5d7
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 18 deletions.
50 changes: 43 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,46 @@
SDK release notes can be found at [breez-sdk/releases](https://github.com/breez/breez-sdk/releases/)
## 0.4.0
* **Breaking** Update Dart SDK range to be compatible with Flutter 3.19
* **Breaking** Replace parameters of `connect` with `ConnectRequest`.
* **Breaking** `serviceHealthCheck` API now requires an `apiKey` which properly conducts a health check when services are offline.
* **Deprecation** `sendOnchain` is now deprecated. Use `payOnchain` instead.
* **Deprecation** `inProgressReverseSwaps` is now deprecated. Use `inProgressOnchainPayments` instead.
* **Deprecation** `fetchReverseSwapFees` is now deprecated. Use `prepareOnchainPayment` instead.
* Introduce `swapEventsStream` to listen in on swap events.
* Introduce `rescanSwaps` API to iterate all historical swap addresses and fetch their current status from the blockchain.
* Introduce `configureNode` API to configure an optional address to send funds to during a mutual channel close.
* Introduce `onchainPaymentLimits` API to fetch latest on-chain payment limits.
* Notification Service plugins are now bundled with the Flutter package. [Setup guide](https://sdk-doc-prerelease.breez.technology/notifications/setup_plugin.html).
* Various improvements to Notification Service plugins:
- Set log stream natively on Android.
- Allow setting channel setup fee limit through `ServiceConfig` that will be used to accept or decline LNURL-Payments that require a channel opening.
- Notifications on iOS are now grouped.
- Improved resource management.
- Notification Service is no longer attempted to start without permissions to show notifications on Android, which lead to an application crash.

## 0.3.9
* Introduce `generateDiagnosticData` API to generate diagnostic data.
* Fix swap confirmed block to be the earliest.

## 0.3.8
* Signer connects immediately on startup (fixes 30 seconds delay).
* Adapt signer policy to allow paying zero amount invoice.
* Update signer keep alive.

## 0.3.6
* Fix swap `INVOICE_AMOUNT_MISMATCH`.
* Defer signer start to increase overall startup time.
* Improve performance by reusing Breez server grpc connection.

## 0.3.3
* Upgrade to VLS 0.11.

## 0.3.2
* Fixed a signer crash
* Fixed a signer crash.

## 0.3.1
* Support notifications via a webhook after a swap transaction confirms.
* Reduced package size by not bundling pre-built binaries
* Reduced package size by not bundling pre-built binaries.

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

## 0.2.15
* This is a hotfix release that fixes a critical issue from previous release.
Expand Down Expand Up @@ -58,12 +94,12 @@ SDK release notes can be found at [breez-sdk/releases](https://github.com/breez/
## 0.2.7
* **Breaking** All APIs which previously allowed multiple parameters to be
passed now require their corresponding `Request` object.
These API's include: `sendOnchain`, `sendPayment`, `sendSpontaneousPayment`, `refund`, `lnurlPay`, `lnurlWithdraw`.
These APIs include: `sendOnchain`, `sendPayment`, `sendSpontaneousPayment`, `refund`, `lnurlPay`, `lnurlWithdraw`.
* **Breaking** All `request` params is renamed to `req`.
* **Breaking** All `reqData` params that belong to a `req` object(_lnurlPay, lnurlWithdraw except lnurlAuth_) is renamed to `data`.
* **Breaking** Use millisatoshi instead of satoshi for lightning amounts.
`ReceivePaymentRequest`, `SendPaymentRequest`, `SendSpontaneousPaymentRequest` now use `amount_msat` instead of `amount_sat`.
* Support pagination in `listPayments`.
* Add optional `claimTxid` and `lockTxid` to `ReverseSwapInfo`.
* Add `closingTxid` to closed channels received in payments list.
* Allow `GetInfo` command to be executed through `executeCommand` API.
* Allow `GetInfo` command to be executed through `executeCommand` API.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.breez.breez_sdk'
version '0.4.0-rc5'
version '0.4.0'

buildscript {
ext.kotlin_version = '1.8.20'
Expand Down
4 changes: 3 additions & 1 deletion ios/bindings-swift/Sources/BreezSDK/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct Constants {
static let PAYMENT_RECEIVED_NOTIFICATION_TITLE = "payment_received_notification_title"
static let PAYMENT_RECEIVED_NOTIFICATION_FAILURE_TITLE = "payment_received_notification_failure_title"
static let SWAP_TX_CONFIRMED_NOTIFICATION_TITLE = "swap_tx_confirmed_notification_title"
static let SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT = "swap_tx_confirmed_notification_failure_text"
static let SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE = "swap_tx_confirmed_notification_failure_title"

// Resource Identifier Defaults
Expand All @@ -35,5 +36,6 @@ struct Constants {
static let DEFAULT_PAYMENT_RECEIVED_NOTIFICATION_TITLE = "Received %d sats"
static let DEFAULT_PAYMENT_RECEIVED_NOTIFICATION_FAILURE_TITLE = "Receive Payment Failed"
static let DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_TITLE = "Swap Confirmed"
static let DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE = "Redeem Swap Failed"
static let DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT = "Tap to complete swap"
static let DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE = "Swap Ongoing"
}
9 changes: 5 additions & 4 deletions ios/bindings-swift/Sources/BreezSDK/Task/RedeemSwap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class RedeemSwapTask : TaskProtocol {
if address == swapInfo.bitcoinAddress {
if (swapInfo.paidMsat > 0) {
self.logger.log(tag: TAG, line: "Swap address \(swapInfo.bitcoinAddress) redeemed succesfully", level: "INFO")
let successRedeemSwap = ResourceHelper.shared.getString(key: Constants.SWAP_TX_CONFIRMED_NOTIFICATION_TITLE, fallback: Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_TITLE)
self.displayPushNotification(title: successRedeemSwap, logger: self.logger, threadIdentifier: Constants.NOTIFICATION_THREAD_SWAP_TX_CONFIRMED)
let notificationTitle = ResourceHelper.shared.getString(key: Constants.SWAP_TX_CONFIRMED_NOTIFICATION_TITLE, fallback: Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_TITLE)
self.displayPushNotification(title: notificationTitle, logger: self.logger, threadIdentifier: Constants.NOTIFICATION_THREAD_SWAP_TX_CONFIRMED)
}
}
break
Expand Down Expand Up @@ -65,7 +65,8 @@ class RedeemSwapTask : TaskProtocol {
}

func onShutdown() {
let failRedeemSwap = ResourceHelper.shared.getString(key: Constants.SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE, fallback: Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE)
self.displayPushNotification(title: failRedeemSwap, logger: self.logger, threadIdentifier: Constants.NOTIFICATION_THREAD_SWAP_TX_CONFIRMED)
let notificationTitle = ResourceHelper.shared.getString(key: Constants.SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE, fallback: Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TITLE)
let notificationBody = ResourceHelper.shared.getString(key: Constants.SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT, fallback: Constants.DEFAULT_SWAP_TX_CONFIRMED_NOTIFICATION_FAILURE_TEXT)
self.displayPushNotification(title: notificationTitle, body: notificationBody, logger: self.logger, threadIdentifier: Constants.NOTIFICATION_THREAD_SWAP_TX_CONFIRMED)
}
}
10 changes: 7 additions & 3 deletions ios/bindings-swift/Sources/BreezSDK/TaskProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public protocol TaskProtocol : EventListener {
}

extension TaskProtocol {
func displayPushNotification(title: String, logger: ServiceLogger, threadIdentifier: String? = nil) {
func displayPushNotification(title: String, body: String? = nil, logger: ServiceLogger, threadIdentifier: String? = nil) {
logger.log(tag: "TaskProtocol", line:"displayPushNotification \(title)", level: "INFO")
guard
let contentHandler = contentHandler,
Expand All @@ -19,8 +19,12 @@ extension TaskProtocol {
return
}

if threadIdentifier != nil {
bestAttemptContent.threadIdentifier = threadIdentifier!
if let body = body {
bestAttemptContent.body = body
}

if let threadIdentifier = threadIdentifier {
bestAttemptContent.threadIdentifier = threadIdentifier
}

bestAttemptContent.title = title
Expand Down
2 changes: 1 addition & 1 deletion ios/breez_sdk.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tag_version = '0.4.0-rc5'
tag_version = '0.4.0'
framework = 'breez_sdkFFI.xcframework'
lib_name = "breez-sdkFFI.#{tag_version}"
url = "https://github.com/breez/breez-sdk-swift/releases/download/#{tag_version}/#{framework}.zip"
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: breez_sdk
description: Flutter bindings for the Breez SDK
repository: https://github.com/breez/breez-sdk-flutter
version: 0.4.0-rc5
version: 0.4.0

environment:
sdk: '>=3.3.0 <4.0.0'
Expand Down

0 comments on commit eb0a5d7

Please sign in to comment.