diff --git a/api_auth_docker/api-sample.properties b/api_auth_docker/api-sample.properties index 3eb5f64..27ddfd6 100644 --- a/api_auth_docker/api-sample.properties +++ b/api_auth_docker/api-sample.properties @@ -30,6 +30,7 @@ action_ln_getconnectionstring=watcher action_ln_decodebolt11=watcher action_ln_listpeers=watcher action_ln_getroute=watcher +action_ln_listpays=watcher # Spender can do what the watcher can do, plus: action_getxnslist=spender diff --git a/proxy_docker/app/script/call_lightningd.sh b/proxy_docker/app/script/call_lightningd.sh index 5f7cede..e292ab6 100644 --- a/proxy_docker/app/script/call_lightningd.sh +++ b/proxy_docker/app/script/call_lightningd.sh @@ -482,6 +482,16 @@ ln_listfunds() { echo "${result}" return ${returncode} } +ln_listpays() { + trace "Entering ln_listpays()..." + local result + result=$(./lightning-cli listpays) + returncode=$? + trace_rc ${returncode} + trace "[ln_listpays] result=${result}" + echo "${result}" + return ${returncode} +} ln_getroute() { trace "Entering ln_getroute()..." # Defaults used from c-lightning documentation diff --git a/proxy_docker/app/script/requesthandler.sh b/proxy_docker/app/script/requesthandler.sh index b7d789e..bc11a2e 100644 --- a/proxy_docker/app/script/requesthandler.sh +++ b/proxy_docker/app/script/requesthandler.sh @@ -423,6 +423,12 @@ main() { response_to_client "${response}" ${?} break ;; + ln_listpays) + # GET http://192.168.111.152:8080/ln_listpays + response=$(ln_listpays) + response_to_client "${response}" ${?} + break + ;; ln_getroute) # GET http://192.168.111.152:8080/ln_getroute/// response=$(ln_getroute $(echo "${line}" | cut -d ' ' -f2 | cut -d '/' -f3) $(echo "${line}" | cut -d ' ' -f2 | cut -d '/' -f4) $(echo "${line}" | cut -d ' ' -f2 | cut -d '/' -f5))