add listpays

This commit is contained in:
g-homebase
2020-03-03 09:24:03 -05:00
committed by kexkey
parent 1e1b2f1eb7
commit f79e6c09d4
3 changed files with 17 additions and 0 deletions

View File

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

View File

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

View File

@@ -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/<node_id>/<msatoshi>/<riskfactor>
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))