Estimate LSPS1 fees
curl --request POST \
--url http://localhost:8000/api/v1/lsps1/estimate_fees \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lsp_balance_sat": 150000,
"client_balance_sat": 50000,
"channel_expiry_blocks": 4032,
"asset_id": "rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB",
"client_asset_amount": 2500,
"rfq_id": "8e6635fb-ab37-4aed-89f4-bc9c98fb8b49"
}
'import requests
url = "http://localhost:8000/api/v1/lsps1/estimate_fees"
payload = {
"lsp_balance_sat": 150000,
"client_balance_sat": 50000,
"channel_expiry_blocks": 4032,
"asset_id": "rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB",
"client_asset_amount": 2500,
"rfq_id": "8e6635fb-ab37-4aed-89f4-bc9c98fb8b49"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
lsp_balance_sat: 150000,
client_balance_sat: 50000,
channel_expiry_blocks: 4032,
asset_id: 'rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB',
client_asset_amount: 2500,
rfq_id: '8e6635fb-ab37-4aed-89f4-bc9c98fb8b49'
})
};
fetch('http://localhost:8000/api/v1/lsps1/estimate_fees', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/lsps1/estimate_fees",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lsp_balance_sat' => 150000,
'client_balance_sat' => 50000,
'channel_expiry_blocks' => 4032,
'asset_id' => 'rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB',
'client_asset_amount' => 2500,
'rfq_id' => '8e6635fb-ab37-4aed-89f4-bc9c98fb8b49'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/v1/lsps1/estimate_fees"
payload := strings.NewReader("{\n \"lsp_balance_sat\": 150000,\n \"client_balance_sat\": 50000,\n \"channel_expiry_blocks\": 4032,\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"client_asset_amount\": 2500,\n \"rfq_id\": \"8e6635fb-ab37-4aed-89f4-bc9c98fb8b49\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/api/v1/lsps1/estimate_fees")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lsp_balance_sat\": 150000,\n \"client_balance_sat\": 50000,\n \"channel_expiry_blocks\": 4032,\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"client_asset_amount\": 2500,\n \"rfq_id\": \"8e6635fb-ab37-4aed-89f4-bc9c98fb8b49\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/lsps1/estimate_fees")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lsp_balance_sat\": 150000,\n \"client_balance_sat\": 50000,\n \"channel_expiry_blocks\": 4032,\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"client_asset_amount\": 2500,\n \"rfq_id\": \"8e6635fb-ab37-4aed-89f4-bc9c98fb8b49\"\n}"
response = http.request(request)
puts response.read_body{
"setup_fee": 1,
"capacity_fee": 1,
"duration_fee": 1,
"total_fee": 1,
"applied_discount": 0.5,
"discount_code": "<string>"
}{
"error_code": "LSPS1_INVALID_PARAMS",
"message": "RFQ ID is required when purchasing assets (client_asset_amount > 0). Please request a quote first.",
"details": {
"code": -32602,
"property": "rfq_id",
"message": "RFQ ID is required when purchasing assets (client_asset_amount > 0). Please request a quote first."
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error": "missing_api_key"
}{
"detail": [
{
"loc": [
"body",
"rfq_id"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"error_code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests",
"details": {
"retry_after": 60
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error_code": "INTERNAL_ERROR",
"message": "Internal Server Error",
"details": {},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error_code": "LSPS1_NODE_UNREACHABLE",
"message": "LSP node unreachable",
"details": {
"code": 102,
"message": "LSP node is unreachable"
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}lsps1
Estimate LSPS1 fees
Estimate LSPS1 channel fees without creating an order. When the client is purchasing assets, a fresh rfq_id is required so the asset price can be folded into the total fee calculation.
POST
/
api
/
v1
/
lsps1
/
estimate_fees
Estimate LSPS1 fees
curl --request POST \
--url http://localhost:8000/api/v1/lsps1/estimate_fees \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lsp_balance_sat": 150000,
"client_balance_sat": 50000,
"channel_expiry_blocks": 4032,
"asset_id": "rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB",
"client_asset_amount": 2500,
"rfq_id": "8e6635fb-ab37-4aed-89f4-bc9c98fb8b49"
}
'import requests
url = "http://localhost:8000/api/v1/lsps1/estimate_fees"
payload = {
"lsp_balance_sat": 150000,
"client_balance_sat": 50000,
"channel_expiry_blocks": 4032,
"asset_id": "rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB",
"client_asset_amount": 2500,
"rfq_id": "8e6635fb-ab37-4aed-89f4-bc9c98fb8b49"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
lsp_balance_sat: 150000,
client_balance_sat: 50000,
channel_expiry_blocks: 4032,
asset_id: 'rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB',
client_asset_amount: 2500,
rfq_id: '8e6635fb-ab37-4aed-89f4-bc9c98fb8b49'
})
};
fetch('http://localhost:8000/api/v1/lsps1/estimate_fees', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/lsps1/estimate_fees",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lsp_balance_sat' => 150000,
'client_balance_sat' => 50000,
'channel_expiry_blocks' => 4032,
'asset_id' => 'rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB',
'client_asset_amount' => 2500,
'rfq_id' => '8e6635fb-ab37-4aed-89f4-bc9c98fb8b49'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/v1/lsps1/estimate_fees"
payload := strings.NewReader("{\n \"lsp_balance_sat\": 150000,\n \"client_balance_sat\": 50000,\n \"channel_expiry_blocks\": 4032,\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"client_asset_amount\": 2500,\n \"rfq_id\": \"8e6635fb-ab37-4aed-89f4-bc9c98fb8b49\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/api/v1/lsps1/estimate_fees")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"lsp_balance_sat\": 150000,\n \"client_balance_sat\": 50000,\n \"channel_expiry_blocks\": 4032,\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"client_asset_amount\": 2500,\n \"rfq_id\": \"8e6635fb-ab37-4aed-89f4-bc9c98fb8b49\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/lsps1/estimate_fees")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lsp_balance_sat\": 150000,\n \"client_balance_sat\": 50000,\n \"channel_expiry_blocks\": 4032,\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"client_asset_amount\": 2500,\n \"rfq_id\": \"8e6635fb-ab37-4aed-89f4-bc9c98fb8b49\"\n}"
response = http.request(request)
puts response.read_body{
"setup_fee": 1,
"capacity_fee": 1,
"duration_fee": 1,
"total_fee": 1,
"applied_discount": 0.5,
"discount_code": "<string>"
}{
"error_code": "LSPS1_INVALID_PARAMS",
"message": "RFQ ID is required when purchasing assets (client_asset_amount > 0). Please request a quote first.",
"details": {
"code": -32602,
"property": "rfq_id",
"message": "RFQ ID is required when purchasing assets (client_asset_amount > 0). Please request a quote first."
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error": "missing_api_key"
}{
"detail": [
{
"loc": [
"body",
"rfq_id"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"error_code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests",
"details": {
"retry_after": 60
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error_code": "INTERNAL_ERROR",
"message": "Internal Server Error",
"details": {},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error_code": "LSPS1_NODE_UNREACHABLE",
"message": "LSP node unreachable",
"details": {
"code": 102,
"message": "LSP node is unreachable"
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}Authorizations
Pass a Kaleido API key such as kld_live_c_....
Body
application/json
Request model for estimating channel fees
Response
Successful Response
Response model for LSPS1 fee estimation
Was this page helpful?
⌘I