* 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>
* feat: switch to pending state when receive lockup is in the mempool
* rebasing
* fix: move socket update logic to sub-crate
* Update payments query, to avoid duplicate Receive Swaps
This can happen if the app is stopped before the temporary lockup tx is removed from the DB. The Receive Swap would then forever result in two payments in list_payments.
* Add comments to clarify use of temp lockup txid
* Re-generate flutter bridge bindings
* feat: set Payment `tx_id` as optional and change `list_payments` logic
* fix: debug typo
* fix: undo `remove_temporary_tx` changes
* fix: switch to full join rather than manual filtering
* fix: bindings
* fix: improve error handling when tx data is not present
* fix: RN bindings
* fix: exclude Created receives from the list
* fix: fixing nits
* Re-generate FRB bindings
---------
Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
* Receive: Add magic routing hint support
* Send: add MRH support
* Filter out and reject self-transfers
* Extract self-transfer validation in own fn
* PrepareSendResponse: use onchain fee as fees_sat if MRH present
* Use onchain tx fee as payment fee, if MRH used for direct onchain tx
* Fix swap fee calculation when MRH is used
* Apply boltz-client patch that aborts send if tx broadcast fails
* Send with MRH: return pending payment
* Receive with MRH: validate BIP21 amount, address
* Emit remaining events for MRH Send, Receive
* Sync: update swap info and emit events after new tx data is persisted
* Extract MRH send into its own send_payment_via_mrh()
* Pending Send via swap: store tx fees for pseudo-tx
* Fix clippy
* 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
* feat: add random keypair generation
* Encapsulate decode_keypair in SendSwap::get_refund_keypair()
* Add refund_tx_id and refund_tx_amount_sat to Payment
* fix: remove blocking on refund
* fix: change `refund_private_key` order
* fix: rebasing
* fix: set `next_unused_address` as refund output
* Handle refunds in `get_info`, `list_payments` (#226)
* Exclude refund txs from payment list
* Adjust balance calculation to account for refunds
* fix: revert boltz changes and fix locktime
* Replace subquery with LEFT JOIN to get refund data
* Rewrite locktime check for more clarity
* Rewrite locktime check for more clarity
* Fix select_payment_query in case of refunds
* Include boltz-client fixes (handling of unwraps for failed broadcasts)
* Cargo.toml: Use boltz-client branch instead of commit
---------
Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>