diff --git a/api_auth_docker/api-sample.properties b/api_auth_docker/api-sample.properties index fc4668ce..ee0f92b5 100644 --- a/api_auth_docker/api-sample.properties +++ b/api_auth_docker/api-sample.properties @@ -47,6 +47,7 @@ action_bitcoin_estimatesmartfee=watcher action_bitcoin_gettxoutproof=watcher action_validateaddress=watcher action_elements_validateaddress=watcher +action_elements_getaddressinfo=watcher action_elements_gettxoutproof=watcher action_elements_watch=watcher action_elements_unwatch=watcher diff --git a/api_auth_docker/tests/test-gatekeeper.sh b/api_auth_docker/tests/test-gatekeeper.sh index 4983575a..5e03c361 100755 --- a/api_auth_docker/tests/test-gatekeeper.sh +++ b/api_auth_docker/tests/test-gatekeeper.sh @@ -587,6 +587,9 @@ test_elements_watcher_functions() { # action_elements_validateaddress=watcher test_authorization "elements_validateaddress" "${token}" ${has_access} || return 230 + + # action_elements_getaddressinfo + test_authorization "elements_getaddressinfo" "${token}" ${has_access} || return 235 } test_elements_spender_functions() { diff --git a/cyphernodeconf_docker/templates/gatekeeper/api.properties b/cyphernodeconf_docker/templates/gatekeeper/api.properties index 56759dd8..c3b5c997 100644 --- a/cyphernodeconf_docker/templates/gatekeeper/api.properties +++ b/cyphernodeconf_docker/templates/gatekeeper/api.properties @@ -43,6 +43,7 @@ action_bitcoin_gettxoutproof=watcher action_bitcoin_getfeerate=watcher action_validateaddress=watcher action_elements_validateaddress=watcher +action_elements_getaddressinfo=watcher action_elements_gettxoutproof=watcher action_elements_watch=watcher action_elements_unwatch=watcher diff --git a/proxy_docker/app/script/requesthandler.sh b/proxy_docker/app/script/requesthandler.sh index 0b9586a9..e3cb6f29 100644 --- a/proxy_docker/app/script/requesthandler.sh +++ b/proxy_docker/app/script/requesthandler.sh @@ -1015,6 +1015,16 @@ main() { response=$(elements_validateaddress "$(echo "${line}" | cut -d ' ' -f2 | cut -d '/' -f3)") returncode=$? ;; + elements_getaddressinfo) + # POST http://192.168.111.152:8080/elements_getaddressinfo + # BODY {"address": "ert1q4fk43wm80ndgal03lwaha2s9l3n6ft6fk5h4m0"} + # BODY {"address": "ert1q4fk43wm80ndgal03lwaha2s9l3n6ft6fk5h4m0", "wallet": "02"} + + local address=$(echo "${line}" | jq -r ".address") + local wallet=$(echo "${line}" | jq -er ".wallet // empty") + response=$(elements_getaddressinfo "${address}" true "${wallet}") + returncode=$? + ;; elements_watch) # POST http://192.168.111.152:8080/elements_watch # BODY {"address":"AzpmavTHCTfJhUqoS28kg3aTmCzu9uqCdfkqmpCALetAoa3ERpZnHvhNzjMP3wo4XitKEMm62mjFk7B9","assetId":"bc5ac68d102a16069c68de127773473eee0a6bc760689ce76024a3cfbfec31cf","unconfirmedCallbackURL":"192.168.111.233:1111/callback0conf","confirmedCallbackURL":"192.168.111.233:1111/callback1conf"}