Commit Graph

103 Commits

Author SHA1 Message Date
Ross Savage
e090c858bf Add payer note to BOLT12 invoice request (#930)
* Add payer note to BOLT12 invoice request

* Fix regtest

* Address review feedback
2025-05-23 14:21:26 +00:00
Daniel Granhão
defa2e4890 Expose bitcoin destination address (#928)
* Expose bitcoin destination address

* Address reviews
2025-05-23 09:54:03 +01:00
Daniel Granhão
cd0b82cf53 Persist wallet cache in db (#912)
* Persist wallet cache in db

* Always persist new updates

* Reload wallet on conflict

* Remove `cache_dir` from `Config`
2025-05-22 12:52:29 +01:00
Ross Savage
48756bdf00 Rework draining to enable BOLT12 drain (#923) 2025-05-20 09:26:23 +00:00
Ross Savage
c872a62f1d Add user lockup_tx_id to Bitcoin payment details (#918) 2025-05-19 05:26:18 +00:00
Ross Savage
5b69c7beb2 BOLT12 receive (#882)
* Add BOLT12 receive payment handling

* Handle BOLT12 invoice requests via WS

* Fix invoice request subscription on stream initialisation

* Store the BOLT12 offer used to receive a payment

* Address review feedback

* Separate into create BOLT12 invoice fn

* Update all BOLT12 offers when webhook URL changes

* Deprecate Lightning for Bolt11Invoice
2025-04-29 11:43:45 +00: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
yse
10e3ab71e0 feat: add Esplora client to chain services (#761)
Co-authored-by: Daniel Granhão <32176319+danielgranhao@users.noreply.github.com>
2025-03-27 10:40:10 +01:00
Daniel Granhão
2952b6133e Expose real time synced event (#800) 2025-03-24 11:46:02 +00:00
Ross Savage
ba256ea51c Fix LNURL drain and payment info (#776)
* Fix LNURL-pay drain not working

* Add LNURL info and BIP353 address to Liquid payment details

* Add bip353_address to LiquidAddress SendDestination
2025-03-17 14:11:00 +01:00
Daniel Granhão
eb3b12021c Remove min 0-conf fee rate (#750) 2025-02-18 12:20:39 +00:00
Ross Savage
6bf203dd80 Add seed to ConnectRequest (#748)
* Add seed option to ConnectRequest

* Explicitly require mnemonic or seed
2025-02-17 17:37:06 +01: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
Daniel Granhão
99d8765681 Support regtest (#707)
* Support regtest

* Fix bindings, print and switch boltz client crate

* Remove stop-grace-period

* Fix docker compose issues

* feat: add rt-sync to regtest setup

* Configure local rtsync instance on default regtest config

* Bump sdk-common rev

* Fix compose restart missing quotation

* Specify platform only in base configurations

* Fix after rebase

---------

Co-authored-by: yse <hydra_yse@proton.me>
2025-02-07 16:00:59 +00:00
Ross Savage
0b4acc6f6a Add seed passphrase to ConnectRequest (#722)
* Add seed passphrase to ConnectRequest

* Fix tests
2025-02-06 11:32:47 +01:00
Daniel Granhão
0c9d2b8cbe Prevent missing notifications due to concurrent SDK instances (#697)
* Prevent missing notifications due to concurrent SDK instances

* Expose swap claim tx id and use it to derive WaitingConfirmation in plugins

* Use id type as get payment request variant
2025-02-03 17:33:07 +00:00
Ross Savage
b24046c5e9 LNURL-pay drain (#674)
* LNURL-pay drain

* Fix min_sendable calculation
2025-01-29 14:44:46 +01:00
Ross Savage
652c23800e Configure asset metadata (#659)
* Configure asset metadata

* Apply suggestions from code review

* Return BIP21 URI also when only non-bitcoin asset_id is defined

* Rename AssetMetadata functions
2025-01-24 16:57:22 +01:00
Ross Savage
e196a91973 Multi-asset send/receive (#645)
* Multi-asset send/receive

* Apply suggestions from code review

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

* Log the prepare asset_id

---------

Co-authored-by: Daniel Granhão <32176319+danielgranhao@users.noreply.github.com>
2025-01-24 16:55:51 +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
53fb22ab41 Chain swap refund tx fee bumping (#688)
* Chain swap refund tx fee bumping

* Add "pending" to refund tx id field names

* Rename pending to last
2025-01-24 09:41:32 +00:00
Daniel Granhão
6760960cb0 Add SdkEvent for refundable swap (#683) 2025-01-21 14:43:23 +00:00
yse
95998013a9 fix: remove mandatory API key checks (#639) 2025-01-21 08:32:05 +01:00
yse
4abcebcde8 feat: add sort_ascending flag to list_payments (#679) 2025-01-21 08:06:18 +01: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
fa70c0b6df Add receiver amount to FetchPaymentProposedFeesResponse 2025-01-03 09:53:12 +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
Ross Savage
9253caa388 Store unblinding data for the tx (#584) 2025-01-02 09:03:01 +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
72a9aa66ff Support default external input parsers 2024-12-16 19:37:35 +00:00
Daniel Granhão
895e64b823 Implement external input parsing 2024-12-12 12:02:53 +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
fe1dc30917 Add support for paying to BOLT12 (#549)
Add support for paying to BOLT12
2024-11-19 13:08:50 +00:00
Ross Savage
802e9eece7 Configurable cache dir (#567)
* Add a configurable cache dir

* Fix UDL field position
2024-11-18 13:36:38 +01:00
Ross Savage
4da57e3fe2 Liquid/Lightning drain (#553)
* Attempt drain using liquid or lightning payment

* Optimize estimation handling, use address in drain estimation

* Add drain option to PrepareSendRequest

* Block draining while there are pending payments

* Apply suggestions from code review

* Rename PayOnchainAmount to PayAmount
2024-11-11 21:50:18 +01:00
Roei Erez
bbac3f5fc2 remove old files 2024-10-18 11:25:10 +02:00
Roei Erez
8cce2afe5d Add react native bindings 2024-10-18 11:25:10 +02:00
ok300
cbe835b565 GetInfoResponse: add fingerprint (#532)
* GetInfoResponse: add fingerprint

* Re-generate dart ffi with `just ffigen`

* Re-generate dart ffi with `just gen`
2024-10-17 14:36:33 +00:00
Ross Savage
0884106159 Add prepare_lnurl_pay (#524)
* Add prepare_lnurl_pay

* Move fields into prepare response
2024-10-14 10:06:14 +02:00
Ross Savage
3867fa91da Get Payment (#476)
* Get payment by destination

* CI fixes

* Remove claim_address from query

* Add PaymentDestination enum

* Add payment hash as a payment query option

* Bump Flutter dependencies

* Move destination/address queries to list_payments

* Apply suggestions from code review

Co-authored-by: yse <70684173+hydra-yse@users.noreply.github.com>

---------

Co-authored-by: yse <70684173+hydra-yse@users.noreply.github.com>
2024-10-10 17:44:32 +02:00
yse
42f4ca0129 feat: require Breez API key globally on mainnet (#520) 2024-10-08 16:17:34 +02:00
Ross Savage
9c0e469ad1 Fix pay onchain claim fee (#499)
* Fix pay onchain claim fee

* Bump flutter example dependencies
2024-09-25 10:44:33 +02:00
yse
783c5ac450 feat: refactor refund logic and support lowball broadcasts (#407) 2024-09-20 15:57:54 +02:00
yse
189e257f89 feat: add lowball broadcast support with API key for all transaction types (#489) 2024-09-20 13:04:49 +02:00
ok300
e8cd66f81f prepare-pay-onchain: add option for drain (#464)
* prepare-pay-onchain: add option for drain in req

* Fix clippy

* ChainSwapStateHandler: gracefully handle building both drain and non-drain lockups

* Send Chain swap: use standard feerate when estimating lockup tx fee

* UDL: move new drain field above the last PreparePayOnchainRequest optional field

* UDL: move new drain field optional

* prepare-pay-onchain: treat normal payment as drain if receiver amount is high enough

If the receiver amount is as high as it would be in case of drain, treat the current prepare-pay-onchain as drain, even if the drain flag is not set.

* build_drain_tx: add optional amount validation

* Add PayOnchainAmount enum to cover amount types (drain, receiver)

* Add ability to find max_receiver_amount_sat for non-drain sends

* Revert "Add ability to find max_receiver_amount_sat for non-drain sends"

This reverts commit 60ee1c768021810f72bc64a8ada69d35b638185e.

* prepare_pay_onchain: treat drain and non-drain cases separately

If the non-drain case is chosen with a receiver_amount equivalent to what drain would have calculated, it results in an error. For drain, the caller has to explicitly choose PayOnchainAmount::Drain.

* CLI: send-onchain-payment accepts optional amount

* CLI: add docs for send-onchain-payment drain arg

* SDK: expand docs for prepare_pay_onchain

* Re-generate RN bindings

* Re-generate flutter bindings
2024-09-11 15:52:56 +00:00
Ross Savage
c141d8e0a4 Change short_channel_id to string (#484)
* Change short_channel_id to string

* Bump sdk-common
2024-09-11 12:54:39 +02:00
yse
2dc3d57309 fix: set PaymentDetails as mandatory, default to LiquidAddress (#474) 2024-09-09 13:00:22 +02:00