v1
latestOpenAPI 3.0.22026-07-17112726.4 KBRequest body
amount you wish to swap out (in satoshi).
The number of confirmation of the swaptx (htlc tx) before we make an off-chain offer. a.k.a. htlc_confirmations on the lightning loop. Default number depends on the asset type, (see NLoop.Server/Options/CryptoCodeParams.fs) Set this to 0 for zero-conf swap.
Additional label for this request.
Maximum off-chain fee in sats that may be paied for swap payment to the server. This limit is applied during path finding. Default value depends on the asset type, (see NLoop.Server/Options/CryptoCodeParams.fs)
Maximum off-chain fee in sat that may be paid for the prepay to the server. This limit is applied during path finding. Default value depends on the asset type, (see NLoop.Server/Options/CryptoCodeParams.fs)
Maximum we are willing to pay the server for the swap (by diff of on/off-chain payment). If the server asks for a higher fee, we do not perform the swap. For multi-asset swap, the unit of this value is off-chain currency. We use a rate information from external exchanges to calculate the value. Default value depends on the asset type, and a channel size. (see NLoop.Server/Options/CryptoCodeParams.fs)
The server might request a pre-payment for the sake of DoS-prevention, this is a maximum amount (in sats) of the off-chain prepayment. Default value depends on the asset type, (see NLoop.Server/Options/CryptoCodeParams.fs)
Maximum on-chain fees that we are willing to spend. If we want to sweep the on-chain htlc and the fee estimate turns out higher than this value, we cancel the swap. If the fee estimate is lower, we publish the sweep tx. If the sweep tx is not confirmed, we are forced to ratchet up fees until it is swept. Possibly even exceeding max_miner_fee if we get close to the HTLC timeout. Because the initial publication revealed the preimage, we have no other choice. The server may already have pulled the off-chain HTLC. Only when the fee becomes higher than the swap amount, we can wait for fees to come down and hope -- if we are past the timeout -- that the server is not publishing the revocation. So think this value as a "soft-limit" for preventing to start the swap when the fee market is too expensive, rather than the hard-limit. Default value depends on the asset type, (see NLoop.Server/Options/CryptoCodeParams.fs)
Confimation target (block num) for estimating the fee for the sweeping tx (a.k.a. sweep tx, claim tx.) from the HTLC tx (a.k.a. swaptx, lockuptx) Default depends on the asset type, but usually it is not that short. If you want to finish swap asap and get your on-chain funds quickly, You probably want to set a short time. Default value depends on the asset type, (see NLoop.Server/Options/CryptoCodeParams.fs)
Example request
{
"channel_ids": [
"140x10x1"
],
"pair_id": "BTC/LTC",
"address": "bc1q2y7lfmmm7xhv2dpf0n0mx6w26zspmvszm3hvkc4yn785xp8dvs5shejlc5"
}Response
OK
Swap identifier to track status.
Example response
{
"id": "tY8iDo",
"address": "bc1q2y7lfmmm7xhv2dpf0n0mx6w26zspmvszm3hvkc4yn785xp8dvs5shejlc5"
}