Commit Graph

165 Commits

Author SHA1 Message Date
Roei Erez
59aefee0ef emit pending confirmation for liquid transactions 2024-08-29 17:37:30 +03:00
yse
0053007000 fix: ensure non-MRH invoices use lockup amount for fee calculation (#461) 2024-08-29 14:32:39 +02:00
Ross Savage
6b78919df8 Add sign_message and check_message (#443)
* Add sign and check message methods

* Use lightning message_signing module to verify the message signature

* Use hash engine
2024-08-29 08:42:16 +02: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
Ross Savage
34774647bf Integrate webhooks (#410)
* 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
2024-08-29 08:03:50 +02:00
ok300
ab63064343 Fix chain swap limits validation (#456)
* validate_chain_pairs: use payer_amount instead of ambiguous amount_sat

* validate_submarine_pairs: add comment

* prepare_receive_payment: clarify pair handling for PaymentMethod::Lightning

* Chain pair validation: use user_lockup_amount instead of payer_amount
2024-08-28 10:38:41 +00:00
ok300
152032dd82 pay-onchain: fix user lockup fee calculation, boltz fee calculation (#459) 2024-08-28 10:21:29 +00:00
yse
7b3085df8d send: consider request amount when preparing the payment (#454) 2024-08-27 01:37:56 +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
Erdem Yerebasmaz
5248dfc235 Depend on sdk-common with liquid feature (#452)
* Add copy script to packages/react-native makefile
  * Reorder scripts
* Depend on sdk-common with liquid feature
  * chore: cargo update
* Generate Dart bindings
* Generate UniFFI bindings
* Simplify import resolution by using prelude::*
  * Applies changes from https://github.com/breez/breez-sdk-greenlight/pull/1078
2024-08-20 18:50:27 +03:00
Ross Savage
9c683761e6 Confirm chain swap claims (#450)
* Confirm chain swap claims before setting to complete

* Fix tests

* Address feedback

* Apply suggestions from code review

Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>

---------

Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
2024-08-19 09:35:42 +02:00
ok300
44ee969e43 Receive payment: remove MRH BIP21 amount validation (#448)
* Receive payment: remove MRH BIP21 amount validation

* Fix CI: bump dependency in pubspec.lock
2024-08-15 17:47:19 +00:00
Erdem Yerebasmaz
265724101c Bump flutter_rust_bridge to 2.2.0 (#442) 2024-08-13 11:46:08 +03:00
Erdem Yerebasmaz
852b712277 Address cargo clippy warnings (#439)
Fix indentations on documentations.
2024-08-08 17:23:34 +03:00
ok300
6373ac2be3 Receive payment: remove retry backoff, reduce wait time to 1 sec (#431) 2024-08-06 15:55:55 +00:00
ok300
37d625c2b6 Pause event notifications on first sync (#424)
* Add cache flag for is_first_sync_complete

* Event Manager: add ability to pause and resume event notifications

* Pause event notifications on first sync

* Fix CI: bump pubspec.lock dependencies

* CI: Bump win32 transitive dependency in pubspec.lock

* CI: Set dependency hash in quotes
2024-08-01 08:45:14 +00:00
yse
c113f5ec35 fix: show regular onchain fees when mrh payment is detected (#421) 2024-07-26 18:51:38 +02:00
yse
0f636784a1 feat: split storage based on network (#419) 2024-07-26 11:01:42 +02:00
yse
14da84bd64 fear: add per-wallet directory structure for persister and lwk (#413) 2024-07-25 13:59:14 +02:00
Ross Savage
baa8096852 Update boltz-rust and add receive payment description (#409)
* Update boltz-rust

* Store description and add to Payment struct

* Fix examples
2024-07-25 12:46:40 +02:00
yse
a8613eca49 test: complete chain swap tests (#392)
Co-authored-by: Ross Savage <hello@satimoto.com>
2024-07-23 13:58:10 +02:00
ok300
7c45500f70 Fix payment position fluctuation in list_payments for Send (#404) 2024-07-22 15:34:02 +00:00
ok300
9ee5a04a91 Remove sync() call when handling Boltz update (#401) 2024-07-22 07:47:14 +00:00
Ross Savage
091fc50270 Add rustdocs generation to CI (#402)
* Add rustdocs CI

* Flutter gen

* Add link to README
2024-07-19 17:35:59 +02:00
Ross Savage
bfeb785221 Buy Bitcoin (#398)
* Add fiat on-ramp service

* Use sdk-common MoonpayProvider

* Bump flutter qr dependency

* Bump sdk-common dependency
2024-07-19 14:57:51 +02:00
ok300
970489ccfa Persistence: consolidate state filter (#400)
* Simplify sync_payments_with_chain_data loop

* Extract get_where_clause_state_in() util

* Bump flutter transitive dependency
2024-07-18 07:48:48 +00:00
Ross Savage
a3eb4caaf2 Add validate url success action param (#395) 2024-07-16 10:08:30 +02:00
Ross Savage
0da35259fe Allow custom pay_onchain claim fees (#391)
* Allow optional fee rate for pay onchain BTC claim

* Add recommended_fees method

* Fix example Config

* Address review comments
2024-07-15 17:38:10 +02:00
Ross Savage
ae7f8c74c0 Map Lwk InsufficientFunds error to PaymentError::InsufficientFunds (#386) 2024-07-11 19:28:05 +02:00
Ross Savage
143993fd3a List payments filtering and paging (#369)
* 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>
2024-07-10 17:50:53 +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
Ross Savage
05507063f0 Change Config param to zero_conf_min_fee_rate_msat (#374)
* Change Config param to zero_conf_min_fee_rate_msat

* Fix Flutter example
2024-07-09 14:13:42 +02:00
ok300
cac8c315fa Remove duplicate refund_send, refund_send_non_cooperative (#361) 2024-07-08 16:18:14 +00:00
yse
50be093230 fix: refund InsufficientFunds error when calculating broadcast fee (#360)
Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
2024-07-08 17:30:17 +02:00
ok300
4cd5b96aed Update list-payments: exclude chain swap refunds (#366)
If not excluded, they appear as separate Receive payments.
2024-07-08 11:07:54 +00:00
ok300
1a539d3de0 Include RefundPending state in list_pending (#367)
This is done for swaps that can be refunded, like Chain Swaps and Send Swaps.

Without this, refunded payments never transition away from RefundPending to Failed (refunded), because they're not considered a pending swap when handling the final transition
2024-07-08 07:21:14 +00:00
ok300
08b2e5a6e2 Add fetch_onchain_limits service method (#343)
* Add pay_onchain_limits service method

* Add receive_onchain_limits service method

* Merge pay/receive_onchain_limits

* Update field names

* Split swapper method in get_chain_pair and get_chain_pairs

* Fix test

* Introduce and re-use Limits model

* Add fetch_lightning_limits SDK method

* Fix CI: propagate latest sdk-common changes
2024-07-03 09:22:29 +00:00
yse
709c6dfa4a tests: Add unit tests for primary SDK methods (#346) 2024-07-01 17:24:22 +02:00
Ross Savage
9820b0e38c Change onchain request/response structs for clarity (#340)
* Rename fields for clarity

* Remove ReceiveOnchainRequest
2024-06-28 16:30:35 +02:00
ok300
2680f1494d Fix typo (#342) 2024-06-28 11:06:18 +00:00
ok300
713108adb8 Add prelude (#339) 2024-06-27 17:37:38 +00:00
Ross Savage
62022daa85 Update boltz-client (#338) 2024-06-27 15:49:35 +02:00
Ross Savage
34d068a774 Verify chain swap server lockup transaction (#330)
* Verify server lockup transaction

* Fix retries
2024-06-27 10:07:38 +02:00
Ross Savage
e7844473cd Monitor chain swap addresses (#322)
* 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
2024-06-26 16:53:41 +02:00
ok300
ef5cd28fa5 Add FiatAPI methods to Liquid SDK (#331)
* Add FiatAPI methods to Liquid SDK

* Add mirrored structs of fiat crate on Dart bindings

* Re-generate bindings

* Fix sdk-common imports

* Avoid using hardcoded Breez Server URL, re-use sdk-common constant

* Update Cargo.lock

---------

Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
2024-06-26 13:55:44 +00:00
ok300
34258b54a6 Fix typo (#334) 2024-06-26 09:16:25 +00:00
ok300
7bd9b6ddb2 Use swapper proxy to extract referral ID (#329)
* Use swapper proxy to extract referral ID

* Derive swapper API base URL from proxy URL

* Update RN bindings

* Remove referral_id from Config, move proxy_url parsing to swapper

* Fix tests

* Cache swapper proxy URL

* Move boltz_url from Config to swapper

* Silently fail when fetching proxy swapper URLs

* Update RN bindings

* Fix sdk-common dependency

* Fix dependency issues
2024-06-25 17:19:02 +00:00
Roei Erez
1a0127fcfc Use lowball fees only on lockup and cooperative refund 2024-06-25 19:12:31 +03:00
Ross Savage
9da16fba78 Receive Chain Swaps (#310)
* 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>
2024-06-25 17:33:38 +02:00
Erdem Yerebasmaz
8c85ffcf69 Bump flutter_rust_bridge to 2.0.0 (#327) 2024-06-24 13:39:50 +03:00