Commit Graph

494 Commits

Author SHA1 Message Date
Daniel Granhão
95bbd0e49b Implement optimistic locking for read-update-write swap operations (#652)
* Implement optimistic locking for read-update-write swap operations

* Fail on stale swap update and add tests
2025-01-12 22:44:15 +00:00
Ross Savage
50cb8be18c Add destination pubkey and bolt12 invoice to payment details (#649)
* Add destination pubkey and bolt12 invoice to payment details

* Change macro to fn
2025-01-10 13:53:43 +03:00
Daniel Granhão
95352b9d75 Fix actual payer amount recovery 2025-01-09 15:10:39 +00:00
Ross Savage
66810ecdf6 feat: add swap expiry timestamp (#622) 2025-01-08 14:55:47 +01:00
Daniel Granhão
ad71cde463 Fix missing dart bindings 2025-01-07 15:45:29 +00:00
Erdem Yerebasmaz
1695c88d9c Update flutter_rust_bridge to 2.7.0 (#642)
* 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
2025-01-07 14:03:08 +03:00
Daniel Granhão
eadcdbf8da Merge pull request #641 from breez/fix-chain-swap-fee-display
Fix fees shown for send chain swaps
2025-01-07 10:13:48 +00:00
Daniel Granhão
8897352895 Merge pull request #638 from breez/bolt12-parsing-in-sdk-common
Move bolt12 parsing to sdk-common
2025-01-06 19:24:17 +00:00
Daniel Granhão
87c7a9fb40 Move bolt12 parsing to sdk-common 2025-01-06 18:40:13 +00:00
Daniel Granhão
a9ec1c01dd Fix fees shown for send chain swaps 2025-01-06 12:45:56 +00:00
Ross Savage
73d13b4e54 Increase the max zero-conf amount for receive swaps (#640) 2025-01-06 13:14:23 +01:00
Daniel Granhão
fa70c0b6df Add receiver amount to FetchPaymentProposedFeesResponse 2025-01-03 09:53:12 +00:00
Daniel Granhão
b18ad6d097 Fix update_fields 2025-01-03 09:37:02 +00:00
Daniel Granhão
a020ed5ddb Optimistically persist accepted receiver amount 2025-01-02 10:40:31 +00:00
Daniel Granhão
c4f707f87e Derive chain swap fees using claim tx amount when available 2025-01-02 10:40:31 +00:00
Daniel Granhão
dd6038be60 Implement accepted_receiver_amount_sat merge 2025-01-02 10:40:31 +00:00
Daniel Granhão
9383be49bc Bump schema minor version 2025-01-02 10:40:31 +00:00
Daniel Granhão
ed8cc4f24f Address review comments 2025-01-02 10:40:30 +00:00
Daniel Granhão
535d2ec063 Always fill in the actual_payer_amount_sat 2025-01-02 10:40:30 +00:00
Daniel Granhão
39fab35cfa Fix logs using non-existent txid 2025-01-02 10:40:30 +00:00
Daniel Granhão
0a371e087b Show notification if payment requires fee acceptance 2025-01-02 10:40:30 +00:00
Daniel Granhão
b120e707cd Fix server lockup tx verification 2025-01-02 10:40:30 +00:00
Daniel Granhão
cd433446c2 Fix recoverer over/underpayment condition 2025-01-02 10:40:29 +00:00
Daniel Granhão
5198de8b4b Prevent accepted_receiver_amount_sat overwritting with null 2025-01-02 10:40:29 +00:00
Daniel Granhão
d09a9ab6d8 Fix missing update for new chain swap fields 2025-01-02 10:40:29 +00:00
Daniel Granhão
74d9466804 Fix: use lockup amount instead of lockup address balance for setting actual_payer_amount 2025-01-02 10:40:29 +00:00
Daniel Granhão
a1e5576286 Store actual payer and accepted receiver amounts 2025-01-02 10:40:25 +00:00
Daniel Granhão
d2be2ea49a Prevent recovering state from WaitingFeeAcceptance to Pending 2025-01-02 10:35:45 +00:00
Daniel Granhão
0394a66d4c Fix after rebase 2025-01-02 10:35:45 +00:00
Daniel Granhão
351473a41e Expose fees for review + auto accept 2025-01-02 10:35:45 +00:00
Daniel Granhão
08f0fd26cc [skip ci] Define interface 2025-01-02 10:35:44 +00:00
Ross Savage
ba6c41106c fix: pre-check updated fields before committing for real-time sync (#623)
---------
Co-authored-by: yse <hydra_yse@proton.me>
2025-01-02 09:44:18 +01:00
Ross Savage
9253caa388 Store unblinding data for the tx (#584) 2025-01-02 09:03:01 +01:00
yse
d3a3b2b171 fix: consider only L-BTC when calculating wallet balance (#630) 2024-12-30 06:00:32 +01:00
yse
6782e8beef feat: add real-time sync service (#629)
* feat(rt-sync): add persistency layer (#555)

* feat(rt-sync): add pull and merge (#556)

* feat(rt-sync): add push logic and run method (#568)

* feat(rt-sync): integrate rt-sync with the sdk

fix: add formatting command to build

feat: add secondary trigger to sync

deps: add tonic tls-webpki-roots

feat: prevent double claiming on status stream handlers

fix: add tx commit to chain swap update (#588)

fix: ensure we pull records before prepare_send

fix: fmt and tests

* fix: set initial pulled state to `Recoverable`

* feat(rt-sync): add `last_derivation_index` to sync service

* Single chain source

* Handle Recoverable state

* fix(rt-sync): chain recovery integration (#590)

Co-authored-by: yse <hydra_yse@proton.me>

* feat(rt-sync): add `pair_fees_json`

* fix(rt-sync): clean already persisted incoming records

* feat: cache wallet info (#591)

* log: add status-stream logging for non-local swaps

* Sync improvements (#598)

* Full sync on new Bitcoin block

* Track the last unconfirmed refund tx

* Trigger synced event on partial sync

* fix: remove `REPLACE` clause from swap insert/update

* fix(rt-sync): update chain swap payer/receiver amount (#604)

* Fix syncing last derivation index

* fix: update bindings and lockfile

* remove logs

* fix(rt-sync): avoid reuse of derivation index update logic (#608)

* Add 5 index buffer to full scan

* Fix storing claim_address (#609)

* Filter incoming MRH txs by swap timestamp

* fix liquid panding timestamp

* persist tx data timestamp

* Update unconfirmed transactions

* feat: add API key (#618)

* Use configured lazy connect channel in sync service

* fix: set lower-case header (#624)

* fix error message

* Store & Sync LNURL info (#617)

* Persist and decrypt LNURL info

* Update Notification Plugin

* Sync payment details

* Update list payments to include chain swaps with only user lockup (#620)

* Update payments query to include chain swaps without txs

* Allow emitting a payment event without tx_id

* fix: bindings

---------

Co-authored-by: Ross Savage <hello@satimoto.com>
Co-authored-by: Ross Savage <551697+dangeross@users.noreply.github.com>
Co-authored-by: Roei Erez <roeierez@gmail.com>
2024-12-24 10:39:43 +01:00
Daniel Granhão
b0b88b8f1c Merge pull request #614 from breez/default-external-input-parsers
Support default external input parsers
2024-12-20 14:50:37 +00:00
Daniel Granhão
bac98a6ddf Move get_all_external_input_parsers to Config 2024-12-17 10:32:42 +00:00
Daniel Granhão
015823c8b5 Remove Option from parsers field 2024-12-17 10:08:14 +00:00
Daniel Granhão
72a9aa66ff Support default external input parsers 2024-12-16 19:37:35 +00:00
Daniel Granhão
456de3c0a4 Minor docs fixes 2024-12-16 19:07:49 +00:00
Ross Savage
c773e8d7a5 Add ExternalInputParser mirror for frb (#605) 2024-12-14 15:31:57 +01:00
Ross Savage
e3fa3d62d1 Zero-amount quote get balance retry (#603)
* Use non-blocking sleep

* Use script_get_balance_with_retry to get user lockup balance
2024-12-13 14:21:01 +01:00
Ross Savage
a57083f520 Check MRH has already been paid (#596) 2024-12-13 13:11:56 +01:00
Daniel Granhão
3705175093 Default external parsers config to null 2024-12-12 15:15:56 +00:00
Daniel Granhão
895e64b823 Implement external input parsing 2024-12-12 12:02:53 +00:00
ok300
eba09c6faf Fix clippy CI step (#593)
* Add workspace-wide clippy lint config

* CLI: fix clippy
2024-12-09 16:43:29 +00:00
ok300
cfc883ae00 Add zero-amount Receive Chain Swap (#538)
Add support for Zero-Amount Receive Chain Swaps
2024-12-09 16:10:52 +00:00
ok300
790dfa91be Persist swapper fees for swaps (#586)
* Add new Payment field swapper_fees_sat

* Add swapper fee handling for Receive Swaps

* Add swapper fee handling for Send Swaps

* Add swapper fee handling for Chain Swaps

* Fix tests

* Send Swap: persist pair JSON instead of service fee

* Receive Swap: persist pair JSON instead of service fee

* Chain Swap: persist pair JSON instead of service fee
2024-12-06 08:32:03 +00:00
ok300
84f444d44b Fix handling of Esplora API call results (#585) 2024-11-30 09:07:53 +00:00
Ross Savage
f5fb65bb54 Use lockup or claim address for Bitcoin address query (#582) 2024-11-30 07:49:00 +01:00