Commit Graph

21 Commits

Author SHA1 Message Date
Erdem Yerebasmaz
6d5aa3fc82 Update flutter_rust_bridge to version 2.9.0 (#789)
chore: update dependencies to latest resolvable on Dart/Flutter packages
2025-03-19 13:42:15 +03:00
Ross Savage
15968b0ead Handle transition error on TimedOut (#765)
* Remove internal error

* Handle transition error on TimedOut
2025-03-06 10:55:21 +01:00
Erdem Yerebasmaz
5a6b495f6c chore: Update flutter_rust_bridge to 2.8.0 & update Flutter dependencies to latest (#727)
* chore: update Flutter dependencies to latest

Use Flutter version 3.27.4 on CI workflows

* chore: update flutter_rust_bridge to 2.8.0 and generate bindings

chore: update dependencies to latest

* Use Flutter 3.29.0 on CI workflows
2025-02-19 13:25:01 +03:00
Ross Savage
652c23800e Configure asset metadata (#659)
* Configure asset metadata

* Apply suggestions from code review

* Return BIP21 URI also when only non-bitcoin asset_id is defined

* Rename AssetMetadata functions
2025-01-24 16:57:22 +01:00
Ross Savage
deb9ed1b09 Add description hash to receive payment (#440)
* Add option to hash description

* Fix Flutter gen

* Switch to upstream boltz-rust

* Address feedback
2024-08-29 08:17:10 +02:00
yse
1a89bcd6c1 feat: add BIP21 support (#414)
Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
2024-08-22 12:23:36 +02:00
Ross Savage
da43f7ff78 Rename namespace (#345)
* Rename namespace

* Fix flutter build

* Fix kotlin-multiplatform CI

* Rename repositories
2024-07-09 17:25:05 +02:00
Erdem Yerebasmaz
3597530058 Rename wallet to instance (#379)
* Rename wallet of BreezLiquidSDK to instance on example Flutter project
* Generate Dart bindings
* Update dependencies to latest
2024-07-09 16:17:00 +03:00
Ross Savage
428d69729b Implement Chain Swaps for sending (#298) 2024-06-19 12:48:13 +02:00
ok300
2928e0fa58 Add magic routing hint support (#265)
* 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
2024-06-07 00:40:42 +00:00
yse
054b8c6d3b feat: add checks for TimedOut payments (#266) 2024-06-06 17:03:01 +02:00
Ross Savage
dd00a0b328 Return pending payment (#245)
* Return pending payment

* Simplify select loop

* Revert dart pubspec

* Add error logging for payment events without swap ids

Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>

---------

Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
2024-05-30 17:59:35 +02:00
ok300
434fb80d49 Add shutdown signal (#238)
* 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
2024-05-30 08:04:30 +00:00
Erdem Yerebasmaz
1fe5bb353c Stop using singleton instance on Dart bindings
Apply changes to test cases on Dart plugin
2024-05-23 10:10:42 +03:00
ok300
c975da5b3c Payment lifecycle (#184)
* 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
2024-05-22 20:00:38 +00:00
ok300
177127d376 Update flutter bindings 2024-05-15 09:41:06 +02:00
ok300
50a654b49c Merge branch 'main' into yse-remove-api-fields
# Conflicts:
#	packages/dart/lib/src/bindings.dart
#	packages/dart/lib/src/frb_generated.dart
#	packages/dart/lib/src/frb_generated.io.dart
#	packages/dart/lib/src/model.dart
#	packages/flutter/example/lib/main.dart
#	packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart
2024-05-15 09:20:53 +02:00
yse
28d4f264eb feat: add refund and improve send flow 2024-05-14 13:05:27 +02:00
yse
be3120c935 feat: remove PrepareSendResponse fields
feat: add `PrepareSendRequest` object

fix: rename to `claim_tx_feerate`

fix: fix reverse submarine test

feat: improve prepare_send and prepare_receive interfaces

fix: use v2 to broadcast lowball tx

feat: finalize prepare_send and prepare_receive

feat: remove manual BTC pair from response

fix: remove `pair_hash` from PrepareReceive

rebasing

updating Cargo.lock

fix: update lbtc pair method names

fixing bindings

fix: re-add uniffi_macros

add comment to elements dependency

fix: switch back to v1 fee calculation

fix: revert to v1 pair hash

fix: simplify migrations

fix: rename `FeesExpired` to `InvalidOrExpiredFees`

Log error when list_ongoing_swaps() fails

Log swap ID when list_ongoing_swaps() succeeds

Migrations: add missing ongoing_receive_swaps field

Clarify swap type (reverse vs submarine) in logs
2024-05-09 11:26:10 +03:00
Erdem Yerebasmaz
4dc16e565a Run dart format -l 110 2024-05-08 01:19:46 +03:00
Erdem Yerebasmaz
5d966fc856 Move dart & flutter packages to packages folder on root 2024-05-03 16:05:39 +03:00