Commit Graph

62 Commits

Author SHA1 Message Date
Erdem Yerebasmaz
a9cc69743d Expose sync through Dart bindings (#221)
Reformat build_other.dart
2024-05-23 17:59:01 +03:00
ok300
9d5097a55c Send: store preimage on Complete 2024-05-23 13:58:40 +00:00
Erdem Yerebasmaz
c6e7c537fe Only build core package for Linux/Windows targets (#210)
This PR continues #164
2024-05-23 10:21:59 +03:00
Erdem Yerebasmaz
a861011952 Generate Bindings
- Fix list_payments API on bindings
2024-05-23 10:12:53 +03: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
f18f3cb9a6 Uniffi: Add list-payments to UDL (#204)
* Uniffi: Add list-payments to UDL

* Update Payment on uniffi bindings

* Update RN bindings

* Update flutter bindings

---------

Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
2024-05-23 06:19:26 +00: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
Ross Savage
337b52d40e Change script paths to langs directory 2024-05-21 15:38:13 +02:00
Ross Savage
c6c5755973 Move bindings to langs directory 2024-05-21 15:21:28 +02:00
Ross Savage
cc7a6efd27 Rename bindings directories 2024-05-21 14:42:32 +02:00
Erdem Yerebasmaz
7fc5bd6dcb Merge pull request #203 from breez/pub-upgrade
[Flutter] Update dependencies to latest compatible
2024-05-21 15:31:35 +03:00
Erdem Yerebasmaz
f0f282a584 Update dependencies to latest compatible
Changes on 'justfile' also effects CI step
2024-05-21 14:25:52 +03:00
Ross Savage
7787267275 Build android fixes
Signed-off-by: Ross Savage <hello@satimoto.com>
2024-05-21 12:31:59 +02:00
Erdem Yerebasmaz
e94e866dea Make building libraries optional on bootstrap step 2024-05-16 13:51:14 +03:00
Erdem Yerebasmaz
9b2d281293 Add bash script counterpart of linux/windows targets build script
! This script is not being used by Melos and is added for local testing !
2024-05-16 13:51:14 +03:00
Erdem Yerebasmaz
c2b110f047 Add requirements to build binaries locally on README.md 2024-05-16 13:50:50 +03:00
Ross Savage
f5d4321d2d Use glob to pattern match the linux x86_64 clang directory 2024-05-15 15:22:29 +02:00
ok300
177127d376 Update flutter bindings 2024-05-15 09:41:06 +02:00
ok300
6b88461341 Add PaymentError::Refunded to UDL 2024-05-15 09:22:47 +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
3616a1c7b4 Add option to use local profile on Apple & Linux/Windows build scripts 2024-05-08 15:37:29 +03:00
Erdem Yerebasmaz
ad00b32bb5 Build libraries for Android, Apple & Linux platforms on bootstrap recipe
Fix filepath used on Linux & Windows script
2024-05-08 13:04:53 +03:00
Erdem Yerebasmaz
4dc16e565a Run dart format -l 110 2024-05-08 01:19:46 +03:00
Erdem Yerebasmaz
552865d508 Set line length back to 110 on Dart/Flutter projects 2024-05-08 01:19:31 +03:00
Ross Savage
612e2dd1f1 Merge pull request #162 from breez/savage-ci-fixes
Various CI fixes
2024-05-06 22:25:40 +02:00
Ross Savage
0f556a02ad Fix conversion of enum's in Kotlin 2024-05-06 17:46:51 +02:00
Ross Savage
8585217495 Fix RN example app 2024-05-06 16:21:38 +02:00
Ross Savage
360562744f Fix kotlin bindings sources 2024-05-06 16:19:50 +02:00
Erdem Yerebasmaz
cc85881a39 Merge pull request #161 from breez/flutter_ci
CI: Check Dart/Flutter bindings & run static code analysis for Dart/Flutter packages
2024-05-06 15:30:20 +03:00
Erdem Yerebasmaz
05689299f0 Update flutter_rust_bridge to 2.0.0-dev.33
Update dependencies to latest & increase the supported range
2024-05-06 14:58:31 +03:00
Erdem Yerebasmaz
74986f4d87 Add Troubleshooting section to README.md 2024-05-06 14:58:31 +03:00
Erdem Yerebasmaz
b3d9cf675a Install Melos as global package as part of just init
Update README accordingly
 - Remove Melos from prerequisites
2024-05-06 14:58:05 +03:00
Ross Savage
9edd68d08a Fix BindingWallet naming 2024-05-06 13:56:40 +02:00
Erdem Yerebasmaz
2246d9ca30 Add descriptions to just recipes
- Rename 'all' to 'bootstrap'
- Add 'frb' parameter to install 'frb' dependencies
- Disable test-flutter recipe
- Do not build library again child recipes of 'test'
2024-05-06 14:50:20 +03:00
Erdem Yerebasmaz
3071c36486 Generate Dart/Flutter bindings 2024-05-06 14:50:20 +03:00
Erdem Yerebasmaz
d2b054a39a Fix the path for generated docs 2024-05-06 11:10:17 +03:00
Erdem Yerebasmaz
52db699af0 Do not skip dependencies check when generating bindings 2024-05-06 11:10:17 +03:00
Erdem Yerebasmaz
fa1426ed07 Bundle the whole process under 'just all' command 2024-05-06 11:10:17 +03:00
Erdem Yerebasmaz
88f4958f11 List all just commands by default 2024-05-06 11:10:17 +03:00
Erdem Yerebasmaz
0c0287b465 Ignore symlink files for C headers
Remove symlink files from version control
2024-05-06 11:10:17 +03:00
Erdem Yerebasmaz
c782fbf058 Check Flutter bindings with CI
- Add static analysis step for Dart & Flutter packages
- Ignore warning for unused element on build scrips for Windows targets
- Continue if there are any errors with generating bindings
2024-05-06 11:10:17 +03:00
ok300
8a1508ab07 Rename wallet to SDK or LiquidSdk (#157)
* Rename global instance in bindings.rs

* Rename wallet to SDK or LiquidSdk

* Rename BindingWallet to BindingLiquidSdk

* Rename wallet to lwk_wollet, signer to lwk_signer

* Rename LsSdkError to LiquidSdkError

* Cargo fmt

* Rename LsSdkError in RN generator

---------

Co-authored-by: Ross Savage <hello@satimoto.com>
2024-05-03 13:53:37 +00:00
Erdem Yerebasmaz
71c42b0b34 Update README and remove TODO 2024-05-03 16:05:40 +03:00
Erdem Yerebasmaz
9e8e647157 Use topmost .gitignore for flutter project 2024-05-03 16:05:40 +03:00
Erdem Yerebasmaz
2b56a76551 Add .flutter-version to .gitignore 2024-05-03 16:05:39 +03:00
Erdem Yerebasmaz
3d1d3b5435 Remove obsolete files 2024-05-03 16:05:39 +03:00
Erdem Yerebasmaz
5d966fc856 Move dart & flutter packages to packages folder on root 2024-05-03 16:05:39 +03:00
Erdem Yerebasmaz
cfc4a078c5 Change library wording to SDK 2024-05-03 16:05:39 +03:00