NLoop Server OpenAPI definition (2.1.1)

Download OpenAPI specification:Download

Lightning Channel Manager. It will maintain the channel balance by performing submarine swap against Boltz server.

general

/v1/version

Responses

Response samples

Content type
application/json
"string"

/v1/info

Responses

Response samples

Content type
application/json
{
  • "version": "string",
  • "supported_coins": {
    }
}

swap

Get the list of ongoing swaps.

Get the list of ongoing swaps.

Responses

Response samples

Content type
application/json
{ }

Get the full history of swaps. This might take lon

Get the full history of swaps. This might take long if you have a lots of entries in a database.

query Parameters
since
string <date>
Example: since=2021-01-30

Responses

Response samples

Content type
application/json
{
  • "property1": {
    },
  • "property2": {
    }
}

Get the list of ongoing swaps.

Get the list of ongoing swaps.

Responses

Response samples

Content type
application/json
[
  • { }
]

cost

Get the summary of the cost we paid for swaps.

Get the summary of the cost we paid for swaps.

query Parameters
since
string <date>
Example: since=2021-01-30

Responses

Response samples

Content type
application/json
[
  • {
    }
]

loop

/v1/loop/out

Authorizations:
Cookie
Request Body schema: application/json
Array of strings or integers or strings or null (ShortChannelId)

ShortChannelId for the one you want to get inbound liquidity for. default is the one it has least.

(pairId (string or null))

currency pair to perform the swap. Default is BTC/BTC. In case of loopout, Base/Quote is OnChain/OffChain So say if you want to use LTC as an on-chain asset, you must specify LTC/BTC

(BitcoinAddressNonMalleable ((P2WSH (string or null)) or (P2WPKH (string or null))))

An external address that to which the counterparty will pay. i.e. final destination of our on-chain funds. default is a wallet of the lnd (in case of BTC), or blockchain daemon's wallet (e.g. in case of LTC, litecoind's wallet-controlled address.)

amount
required
integer <int64>

amount you wish to swap out (in satoshi).

swap_tx_conf_requirement
integer or null

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.

label
string or null

Additional label for this request.

max_swap_routing_fee
integer or null <int64>

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)

max_prepay_routing_fee
integer or null <int64>

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)

max_swap_fee
integer or null <int64>

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)

max_prepay_amount
integer or null <int64>

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)

max_miner_fee
integer or null <int64>

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)

sweep_conf_target
integer or null <int32>

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)

Responses

Request samples

Content type
application/json
{
  • "channel_ids": [
    ],
  • "pair_id": "BTC/LTC",
  • "address": "bc1q2y7lfmmm7xhv2dpf0n0mx6w26zspmvszm3hvkc4yn785xp8dvs5shejlc5",
  • "amount": 0,
  • "swap_tx_conf_requirement": 0,
  • "label": "string",
  • "max_swap_routing_fee": 0,
  • "max_prepay_routing_fee": 0,
  • "max_swap_fee": 0,
  • "max_prepay_amount": 0,
  • "max_miner_fee": 0,
  • "sweep_conf_target": 0
}

Response samples

Content type
application/json
{
  • "id": "tY8iDo",
  • "address": "bc1q2y7lfmmm7xhv2dpf0n0mx6w26zspmvszm3hvkc4yn785xp8dvs5shejlc5",
  • "claim_tx_id": null
}

/v1/loop/in

Request Body schema: application/json
amount
required
integer <int64>

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

(PubKey (string or null))

node_id (pubkey) to perform the swap against. If you specify both last_hop and channel_id, channel_id is be prioritized.

(ShortChannelId ((ShortChannelId (string or null)) or (ShortChannelId (integer or null)) or (ShortChannelId (string or null))))

channel_id (ShortChannelId) to perform the swap for. If you specify both last_hop and channel_id, channel_id is be prioritized.

(pairId (string or null))

currency pair to perform the swap. Default is BTC/BTC. In case of loopin, Base/Quote is OffChain/OnChain So say if you want to use LTC as an on-chain asset, you must specify BTC/LTC

label
string or null

Additional label for this request.

max_miner_fee
integer or null <int64>

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_fee
integer or null <int64>

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_target
integer or null <int32>

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)

Responses

Request samples

Content type
application/json
{
  • "amount": 0,
  • "last_hop": "03afbba930dc74d6412b71c31f72bfb8d4615121174dd4290cbbf83960961ba9ab",
  • "channel_id": "140x10x1",
  • "pair_id": "BTC/LTC",
  • "label": "string",
  • "max_miner_fee": 0,
  • "max_swap_fee": 0,
  • "htlc_conf_target": 0
}

Response samples

Content type
application/json
{
  • "id": "tY8iDo",
  • "address": "bc1q2y7lfmmm7xhv2dpf0n0mx6w26zspmvszm3hvkc4yn785xp8dvs5shejlc5"
}

Get suggestion for the swaps.

Get suggestion for the swaps.

path Parameters
offchainAsset
string (cryptoCode)
Enum: "BTC" "LTC"

off-chain asset which autoloop manager will take care. default is BTC.

Responses

Response samples

Content type
application/json
{
  • "loop_out": [
    ],
  • "loop_in": [
    ],
  • "disqualified": [
    ]
}

autoloop

Get suggestion for the swaps.

Get suggestion for the swaps.

path Parameters
offchainAsset
string (cryptoCode)
Enum: "BTC" "LTC"

off-chain asset which autoloop manager will take care. default is BTC.

Responses

Response samples

Content type
application/json
{
  • "loop_out": [
    ],
  • "loop_in": [
    ],
  • "disqualified": [
    ]
}

Get the parameters that the daemon's liquidity man

Get the parameters that the daemon's liquidity manager is currently configured with. This may be nil if nothing is configured.

path Parameters
offchainAsset
string (cryptoCode)
Enum: "BTC" "LTC"

off-chain asset which autoloop manager will take care. default is BTC.

Responses

Response samples

Content type
application/json
{
  • "rules": [
    ],
  • "fee_ppm": 0,
  • "sweep_fee_rate_sat_per_kvbyte": 0,
  • "max_swap_fee_ppm": 0,
  • "max_routing_fee_ppm": 0,
  • "max_prepay_routing_fee_ppm": 0,
  • "max_prepay_sat": 0,
  • "max_miner_fee_sat": 0,
  • "sweep_conf_target": 0,
  • "failure_backoff_sec": 0,
  • "autoloop": true,
  • "auto_max_in_flight": 0,
  • "min_swap_amount_loopout": 0,
  • "max_swap_amount_loopout": 0,
  • "min_swap_amount_loopin": 0,
  • "max_swap_amount_loopin": 0,
  • "onchain_asset": "BTC",
  • "htlc_conf_target": 0
}

Overwrites the current set of parameters for the d

Overwrites the current set of parameters for the daemon's liquidity manager.

Request Body schema: application/json
object (LiquidityParameters)

Responses

Request samples

Content type
application/json
{
  • "parameters": {
    }
}

Response samples

Content type
application/json
{
  • "errors": [
    ]
}