* Suppress no-nullability-completeness errors
* Use 'dart run' instead of the deprecated 'flutter pub run' cmd
* Update flutter_rust_bridge to version 2.7.0
Set flutter_rust_bridge range to ">=2.4.0 <=2.7.0" on Dart plugin.
* Generate Dart bindings
* Update Flutter to latest version
* Update melos to latest version
* Make Flutter plugin compatible with AGP 8.+
- Declare 'namespace' property on module-level build script
- Change default namespace
- Remove package name from AndroidManifest
- Bump compileSdkVersion to latest
- Update source and target compatibility
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
* Integrate webhooks
* Make hash_swap_id optional
* Hash and store the swap id
* Add webhook status include lists
* Remove superfluous webhook statuses
* Verify and fetch user_lockup_tx_id if missing
* Fix tests
* Use bitcoin sha256
* Fix flutter CI
* List payments in reverse chonological order
* Add payment filtering and paging
* Fix examples
* Apply suggestions from code review
Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
* Set timestamp for pseudo payments
* Filter by the first non-null timestamp from the join query
---------
Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
* Check chain swap addresses for unspent outputs
* Monitoring expired swaps up to 4320 blocks after expiration
* Refactor chain swap monitoring
* Handle the error to prevent the loop exiting
* Add RefundPending state
* Check if RefundPendingbefore setting to Refundable
* Use script_get_balance to determine spent state
* Use unconfirmed balance to check if RefundPending should be reset to Refundable
* Implement Chain Swaps for receiving
* Send: validate if we have sufficient funds (#321)
* Implement Chain Swaps for receiving
* Fix rebase of flutter_rust_bridge version
* Send: validate if we have sufficient funds
* Re-generate FRB
---------
Co-authored-by: Ross Savage <hello@satimoto.com>
* Chaim swap claim: remove refund_tx arg (#328)
---------
Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
* Generate Dart bindings
* flutter_rust_bridge has relative path issues with this new approach introduced in 2.0.0-dev.38, we'll be using the default rust_output path until it's addressed.
* Add SDK global logger
* Add bindings
* Fix path to internal uniffi log
* Exclude "set_log_stream" from generated RN methods
* Move logger-specific structs to a separate module
* Delegate init_logging to method in logger.rs
* Rename uniffi BindingLogger to UniffiBindingLogger
* Add set_log_stream for dart bindings
* Add SDK logger to Dart bindings
* Rename dart binding logger to DartBindingLogger
* Add rustdocs
* RN bindings: Add manual handling for setLogStream()
* Re-generate dart bindings
* Re-generate RN bindings
* Remove LOG_INIT cell
* Set global maximum log level once on initialization
Return a LiquidSdkError::Generic instead of Anyhow error when initializing log stream on Dart bindings
* Do not panic when initializing binding loggers
* Rename LogStream to Logger
---------
Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
* Add shutdown signal handling
Revert periodic sync interval change
Revert keep-alive interval change
CLI: Add disconnect command
SDK: Add scaffolding for is_started, shutdown()
Simplify instance init
* Rebase on savage-async-ws branch
* Avoid waiting when shutdown signal is received in the sync loop
* Directly use shutdown signal in background threads
* Acquire is_started lock at the very beginning of start()
* Fix cargo clippy warnings
* Update RN generator (kt): set bindingLiquidSdk to null on disconnect()
* Update RN generator (swift): set bindingLiquidSdk to nil on disconnect()
* Startup: only run foreground sync() if this could be the first run
* Start a sync() in background, before regular sync() loop
* Remove ensure_started check from start()
* Add bindings for disconnect()
* Remove foreground sync condition from startup
* Simplify background sync loop
* Rename swap tables: remove ongoing_ prefix
* Add swap status enums and filtering
* Swap-in: add claim_txid
* Swap-out: add claim_txid
* resolve_swap: Don't remove swap when complete
* Fixups after rebase
* Remove unused method
* Consider payment as pending based on confirmations
An onchain payment with no confirmations is considered
pending. The previous logic of converting pending swaps
into pending payments is removed, since we may have
pending swaps that should not result in pending
payments (for example on Receive, before the invoice
is paid).
* Fix swap-in query
* GetInfoResponse: fix balance, include pending
* Remove unused method
* Re-generate flutter bridge files
* Re-generate RN bindings
* Fix payment_type detection in list_payments
* Send: persist to DB when claim tx is seen
* Receive: fix occasional error when broadcasting claim
* Remove fixed TODO
* Receive: only rescan on testnet, where Electrum is used to broadcast
* Log more details when broadcasting fails
* Improve AlreadyClaimed error detection and handling
* Rename SubmarineSwapStatus::Initial to Created
* Split pending payment types into separate field status
* Rename swap status enums
* Fix INSERT query
* Bump lwk libraries
* Simplify Receive try_handle_reverse_swap_status loop
* Change resolve_swap to insert_or_update_payment
* Refactor payment data persistence
* Remove unused dependency
* Bump LWK dependencies
* Rename reconcile_payments_with_onchain
* Rename try_claim_v2
* Rename address() to next_unused_address()
* Move all claim persistence writes in try_claim
* Flatten Payment struct
* Re-generate bindings
* Expose sync() in service interface
* Set Send ws stream as nonblocking, use singleton stream
* Send_payment: sync() before handling new state
* Sync() on sdk.connect()
* Remove unused args from list_payments()
* Receive: rename DB field redeem_script to response JSON
* Convert to and from internal structs to persist CreateResponse JSON
* De-duplicate internal CreateResponse structs to prevent storing same field twice
* Schedule a periodic sync() thread on startup
* Persist swap states and add methods to transition between them
* Handle unwrap() when subscribing for WS updates
* Status Stream: handle remaining unwraps() and TODOs
* Consolidate status transitions into two SDK methods
* Status Stream: reconnect and resume tracking on disconnect
* Remove superfluous TODO
* Send swaps: correctly transition to Complete even if app killed during send_payment()
* State transitions: Move SQL queries to persistence layer
* Send: handle edge TransactionClaimed edge-case
* Send: mark as Complete after we check the preimage
* Send: remove marking as Complete on TransactionClaimed