Commit Graph

41 Commits

Author SHA1 Message Date
yse
c1fff12cda feat[rt-sync]: add failsafe mechanism (#871)
* fix[rt-sync]: improve logging

* feat[rt-sync]: add failsafe mechanism on event loop

* fix[rt-sync]: apply review suggestions

Co-authored-by: Daniel Granhão <32176319+danielgranhao@users.noreply.github.com>

* fix[rt-sync]: only consider record conflicts for db wipe

* fix[rt-sync]: add better error handling

- Removes DecryptionError in favor of PullError
- Extends PushError variant
- Increments push failed counter on
`PushError::ExcessiveRecordConflicts` variant

---------

Co-authored-by: Daniel Granhão <32176319+danielgranhao@users.noreply.github.com>
2025-04-16 18:50:13 +02:00
Daniel Granhão
1122896a70 Wasm: Run tests on node.js (#872) 2025-04-11 17:12:13 +01:00
Ross Savage
cf601f4622 Store claim/refund addresses (#849)
* Store claim/refund addresses

* Store receive claim address before constructing the tx
2025-04-03 06:28:32 +02:00
Ross Savage
0c88e09fc3 Pay fees with USDT asset (payjoin) (#779)
* Add payjoin implementation

* Fix Core Wasm tests
2025-04-02 11:05:02 +00:00
Daniel Granhão
35aeb62e36 WASM: fix clippy and tests (#823) 2025-03-27 22:56:53 +00:00
Ross Savage
1d111d0c30 Use MaybeSend + MaybeSync for all traits (#817) 2025-03-27 13:26:24 +01:00
Daniel Granhão
37979e6052 WASM: spawn task (#797) 2025-03-24 14:50:46 +00:00
Daniel Granhão
95fade5c1c WASM: sync grpc client (#790) 2025-03-24 14:00:16 +00:00
Daniel Granhão
a06c6d522e WASM: prevent filesystem access (#792)
* WASM: prevent filesystem access

* Exclude logger module on wasm

* Drop use of conditional compilation in `LiquidOnchainWallet`

* Expose `LiquidSdkBuilder` and configure build for wasm

* Move working_dir setup and log header to connect with signer

* Add in memory persister constructor

* Drop builder connect method

* Remove `empty_wallet_cache` from WASM interface

* Impose custom persister on wasm
2025-03-24 13:31:22 +00:00
Daniel Granhão
116a898c21 Fix swap recovery before wallet scan (#775)
* Fix swap recovery before wallet scan

* Only do full scan when required

* Move scan to `recover_from_onchain`

* Cache index without buffer
2025-03-17 13:29:19 +00:00
Ross Savage
6d72fdce57 WASM: Interface (#757)
* Define common types

* Define sdk types

* Add SDK methods

* Add LiquidSdkBuilder

* Add callback interfaces

* Update CI for WASM

* Replace async and test macros

* Update sdk-common/macros dependencies
2025-03-11 06:21:46 +01:00
yse
b616ca1877 feat(wasm): split dependencies and add base wrapper (#753)
Co-authored-by: Ross Savage <551697+dangeross@users.noreply.github.com>
2025-03-05 23:01:18 +01:00
Roei Erez
61ea9c5582 subscribe incoming synced records to swapper updates 2025-02-27 16:02:42 +02:00
yse
9fbf7774b8 feat: add client_id to rt-sync notifications (#747) 2025-02-17 16:31:31 +01:00
Daniel Granhão
3ec57ad93e Add tx propagation grace period to swap recovery (#733)
* Add tx propagation grace period to swap recovery

* Add missing tx reset checks and improve logs
2025-02-17 13:23:32 +00:00
Roei Erez
206d0a3065 Merge pull request #732 from breez/lock-free-sync
Refactor sync notifications loop
2025-02-11 18:46:28 +02:00
Roei Erez
cb4da697f4 Some more logs 2025-02-11 18:37:35 +02:00
Roei Erez
fb953c3386 lock free sync trigger 2025-02-11 17:58:43 +02:00
Daniel Granhão
fc03572588 Persist and expose BIP353 addresses (#718)
* Persist and expose BIP353 addresses

* Increment schema minor version

* Move bip353 address from LNURL context to SendDestination

* Update after sdk-common merge

* Address review

* Only try to insert bip353 address when available
2025-02-11 15:29:16 +00:00
Roei Erez
2216e8859f fix log message 2025-02-11 15:18:13 +02:00
Roei Erez
453feca8b1 refactor sync notifications loop 2025-02-11 10:25:58 +02:00
yse
e6747058d7 feat(rt-sync): add notifications endpoint (#694) 2025-02-09 04:01:23 +01:00
yse
e7a7adaf8a feat: remove swapper initialization at startup (#712) 2025-02-06 14:24:55 +01:00
Daniel Granhão
71a8c6ed57 Add logging to handle_push 2025-02-04 16:36:08 +00:00
Ross Savage
79462db2e2 Verify and claim swap if not verifiable in swap loop (#681)
* Verify and claim swap if not verifiable in swap loop

* Verify lockup amount

* Tolerate overpayment

* Adapt receive swap test

* Separate verification functions and set swap Failed if underpaid
2025-01-25 09:30:24 +01:00
Daniel Granhão
7841939e6a Expose amountless swap fees auto acceptance (#690)
* Expose amountless swap fees auto acceptance

* Move field behind optional ones

* Add serde default to auto_accepted_fees
2025-01-24 10:18:34 +00:00
Daniel Granhão
0cdfa2057c Prevent claiming of overpaid swaps (#667)
* Handle overpayments gracefully

* Fix test mock txs and swaps

* Get actual payer amount from blockchain

* Check first tx output instead of script balance

* Fetch actual payer amount if not available

* Remove user lockup amount verification in recoverer

* Refactor user lockup amount check into appropriate method
2025-01-21 10:13:13 +00:00
yse
95998013a9 fix: remove mandatory API key checks (#639) 2025-01-21 08:32:05 +01:00
yse
3a09bbe653 fix: increase keep-alive time and add cli sync flag (#672)
Reflects changes from breez/data-sync#14
2025-01-17 18:25:47 +01:00
yse
b185ff0e35 feat: add cooperative preimage recovery and optimize flow (#669) 2025-01-17 14:32:58 +01:00
yse
bb0b370d17 fix: remove auto-formatting command from build (#655)
* feat: use `include_protos` macro instead of builder
* fix: pin boltz to rev SatoshiPortal/boltz-rust@3bbc0dd
2025-01-15 11:02:35 +01:00
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
Ross Savage
66810ecdf6 feat: add swap expiry timestamp (#622) 2025-01-08 14:55:47 +01:00
Daniel Granhão
b18ad6d097 Fix update_fields 2025-01-03 09:37:02 +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
a1e5576286 Store actual payer and accepted receiver amounts 2025-01-02 10:40:25 +00:00
Daniel Granhão
0394a66d4c Fix after rebase 2025-01-02 10:35:45 +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
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