Commit Graph

10 Commits

Author SHA1 Message Date
yse
2fcefee45e Add option to specify backup path (#228)
* feat: add backup_path to backup method

* Re-generate bindings with flutter_rust_bridge`@ 2.0.0-dev.35

* Rebased on main

* Update backup path description

---------

Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
2024-05-27 19:01:49 +00:00
Ross Savage
06b848a8f3 SDK events framework (#193)
* Add events framework

* Adapt RN codegen and add synced event

* Only use get_connection internally
2024-05-25 06:20:14 +02:00
ok300
9d5097a55c Send: store preimage on Complete 2024-05-23 13:58:40 +00: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
ok300
8cfba8a247 Update RN bindings 2024-05-15 09:26:01 +02: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
Ross Savage
9b0d1a6203 Fix ordering of default fields 2024-05-03 11:42:56 +02:00
ok300
708a3526c7 Add request, response to API methods (#153)
* Add request, response to get_info()

* Add request, response to prepare_send_payment()

* Add request, response to restore()

* Add request, response to connect()

* Update lib/bindings/src/breez_liquid_sdk.udl

Co-authored-by: Ross Savage <551697+dangeross@users.noreply.github.com>

* Update lib/bindings/src/breez_liquid_sdk.udl

Co-authored-by: Ross Savage <551697+dangeross@users.noreply.github.com>

* Update lib/core/src/bindings.rs

Co-authored-by: Ross Savage <551697+dangeross@users.noreply.github.com>

* Fix bindings.rs call

* Update connect to handle ConnectRequest

---------

Co-authored-by: Ross Savage <551697+dangeross@users.noreply.github.com>
Co-authored-by: Ross Savage <hello@satimoto.com>
2024-05-03 08:48:03 +00:00
ok300
6589a8799b Rename workspace members (subfolders) (#149)
* Rename ls-sdk-bindings workspace member

* Rename ls-sdk-core workspace member

* Rename ls-sdk-react-native
2024-05-02 18:22:32 +00:00