Files
breez-sdk-liquid/cli
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
..
2024-05-25 06:20:14 +02:00
2024-08-01 16:27:08 +03:00
2024-09-03 10:51:28 +02:00

Breez SDK - Liquid CLI

A simple cli tool that sends commands to the sdk. It is intended to demonstrate the usage and investigate issues that are hard to debug on mobile platforms.

Run

Start the CLI with

cargo run

To set a specific network, use one of

cargo run -- --network mainnet
cargo run -- --network testnet

To specify a custom data directory, use

cargo run -- --data-dir temp-dir

Using testnet

You'll need a Testnet LN node to test the sending and receiving operations. A simple solution is using Alby's testnet nodes. Read more about Alby's test setup here.

Commands

To get a full list of commands run -h or <command> -h to get more information about a command.

  • send-payment - Send lbtc and receive btc lightning through a swap
  • fetch-lightning-limits - Fetch the current limits for Send and Receive payments
  • fetch-onchain-limits - Fetch the current limits for Onchain Send and Receive payments
  • send-onchain-payment - Send lbtc and receive btc onchain through a swap
  • receive-payment - Receive lbtc and send btc through a swap
  • buy-bitcoin - Generates an URL to buy bitcoin from a 3rd party provider
  • list-payments - List incoming and outgoing payments
  • list-refundables - List refundable chain swaps
  • prepare-refund - Prepare a refund transaction for an incomplete swap
  • refund - Broadcast a refund transaction for an incomplete swap
  • rescan-onchain-swaps - Rescan onchain swaps
  • get-info - Get the balance and general info of the current instance
  • sign-message - Sign a message using the wallet private key
  • check-message - Verify a message with a public key
  • sync - Sync local data with mempool and onchain data
  • recommended-fees - Get the recommended BTC fees based on the configured mempool.space instance
  • empty-cache - Empties the encrypted transaction cache
  • backup - Backs up the current pending swaps
  • restore - Retrieve a list of backups
  • disconnect - Shuts down all background threads of this SDK instance
  • parse - Parse a generic string to get its type and relevant metadata
  • lnurl-pay - Pay using LNURL
  • lnurl-withdraw - Withdraw using LNURL
  • lnurl-auth - Auth using LNURL
  • register-webhook - Register a webhook URL
  • unregister-webhook - Unregister the webhook URL
  • list-fiat - List fiat currencies
  • fetch-fiat-rates - Fetch available fiat rates