Skip to content

Commit

Permalink
Add missing routes to api.properties and 'all' prop to ln_withdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
gabidi authored and Kexkey committed Apr 23, 2020
1 parent 426707e commit d677595
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cyphernodeconf_docker/templates/gatekeeper/api.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ action_ln_create_invoice=watcher
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_get_txns_spending=spender
Expand All @@ -55,6 +57,8 @@ action_ots_getfile=spender
action_ln_getinvoice=spender
action_ln_decodebolt11=spender
action_ln_connectfund=spender
action_ln_listfunds=spender
action_ln_withdraw=spender

# Admin can do what the spender can do, plus:

Expand Down
4 changes: 4 additions & 0 deletions proxy_docker/app/script/call_lightningd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,10 @@ ln_withdraw() {
local destination=$(echo "${request}" | jq -r ".destination")
local satoshi=$(echo "${request}" | jq -r ".satoshi")
local feerate=$(echo "${request}" | jq -r ".feerate")
local all=$(echo "${request}" | jq -r ".all")
if [ "${all}" == true ] || [ "${all}" == "true" ] ; then
satoshi="all"
fi
result=$(./lightning-cli withdraw ${destination} ${satoshi} ${feerate})
returncode=$?
trace_rc ${returncode}
Expand Down
2 changes: 1 addition & 1 deletion proxy_docker/app/script/requesthandler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ main() {
;;
ln_withdraw)
# POST http://192.168.111.152:8080/ln_withdraw
# BODY {"destination":"segwitAddress","satoshi":"100000","feerate":0}
# BODY {"destination":"segwitAddress","satoshi":"100000","feerate":0,all: false}
response=$(ln_withdraw "${line}")
response_to_client "${response}" ${?}
break
Expand Down

0 comments on commit d677595

Please sign in to comment.