v1

latestOpenAPI 3.0.22026-07-17112726.4 KB
loop

post/v1/loop/in

Request body

amountinteger required

amount you wish to swap in to the channel (in satoshi).

last_hopstring
pair_idstring
labelstring nullable

Additional label for this request.

max_miner_feeinteger nullable

Maximum on-chain fees that we are willing to spend. If we want to publish the on-chain htlc and the fee estimate turns out higher than this value, we cancel the swap. Default value depends on the asset type, (see NLoop.Server/Options/CryptoCodeParams.fs)

max_swap_feeinteger nullable

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 number depends on the asset type, and a channel size. (see NLoop.Server/Options/CryptoCodeParams.fs)

htlc_conf_targetinteger nullable

Confimation target for estimating the fee for HTLC tx (a.k.a. swaptx, lockuptx) If the server is not willing to accept zero-conf swap, Making this value smaller might make a swap fast. Default number depends on the asset type, (see NLoop.Server/Options/CryptoCodeParams.fs)

Example request

{
  "last_hop": "03afbba930dc74d6412b71c31f72bfb8d4615121174dd4290cbbf83960961ba9ab",
  "channel_id": "140x10x1",
  "pair_id": "BTC/LTC"
}

Response

OK

idstring

Swap identifier to track status.

addressstring

Example response

{
  "id": "tY8iDo",
  "address": "bc1q2y7lfmmm7xhv2dpf0n0mx6w26zspmvszm3hvkc4yn785xp8dvs5shejlc5"
}