loop

post/v1/loop/out

Request body

pair_idstring

Pair of cryptoCode

amountinteger required

< amount in satoshi.

swap_tx_conf_requirementinteger nullable

< The number of confirmation of the swaptx (htlc tx) before we make an off-chain offer. a.k.a. htlc_confirmations on lightning loop. Default number depends on the asset type.

labelstring nullable

< Additional label for this request.

max_swap_routing_feeinteger nullable

< Maximum off-chain fee in sat that may be paied for swap payment to the server. This limit is applied during path finding.

max_prepay_routing_feeinteger nullable

< Maximum off-chain fee in sat that may be paid for the prepay to the server. This limit is applied during path finding.

max_swap_feeinteger nullable

< Maximum we are willing to pay the server for the swap. This value is not disclosed in the swap initiation call, but if the server asks for a higher fee, we abort 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.

max_prepay_amountinteger nullable

< Maximum amount of the (loop-out) swap fee that may be charged as a prepayment

max_miner_feeinteger nullable

< 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.

sweep_conf_targetinteger nullable

< Confimation target for sweeping the HTLC (a.k.a. swaptx, lockuptx)

Example request

{
  "channel_id": [
    "140x10x1"
  ],
  "address": "bc1q2y7lfmmm7xhv2dpf0n0mx6w26zspmvszm3hvkc4yn785xp8dvs5shejlc5"
}

Response

OK

{"stackTrail":"components:schemas:LoopOutResponse:properties:id","oasType":"schema","type":"unknown","description":"Swap identifier to track status.\n"}
{"stackTrail":"components:schemas:LoopOutResponse:properties:claim_tx_id","oasType":"schema","type":"unknown","description":"< An txid by which they have paid to us. It is populated only when its 0-conf.","nullable":true}

Example response

{
  "address": "bc1q2y7lfmmm7xhv2dpf0n0mx6w26zspmvszm3hvkc4yn785xp8dvs5shejlc5"
}

Changes