mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-01-19 12:34:19 +01:00
Added ln_getinvoice and ln_decodebolt11
This commit is contained in:
@@ -59,6 +59,38 @@ ln_getinfo()
|
||||
return ${returncode}
|
||||
}
|
||||
|
||||
ln_getinvoice() {
|
||||
trace "Entering ln_getinvoice()..."
|
||||
|
||||
local label=${1}
|
||||
local result
|
||||
|
||||
result=$(./lightning-cli listinvoices ${label})
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
trace "[ln_getinvoice] result=${result}"
|
||||
|
||||
echo "${result}"
|
||||
|
||||
return ${returncode}
|
||||
}
|
||||
|
||||
ln_decodebolt11() {
|
||||
trace "Entering ln_decodebolt11()..."
|
||||
|
||||
local bolt11=${1}
|
||||
local result
|
||||
|
||||
result=$(./lightning-cli decodepay ${bolt11})
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
trace "[ln_decodebolt11] result=${result}"
|
||||
|
||||
echo "${result}"
|
||||
|
||||
return ${returncode}
|
||||
}
|
||||
|
||||
ln_pay() {
|
||||
trace "Entering ln_pay()..."
|
||||
|
||||
@@ -103,7 +135,6 @@ ln_newaddr()
|
||||
|
||||
local result
|
||||
|
||||
call_lightningd newaddr
|
||||
result=$(./lightning-cli newaddr)
|
||||
returncode=$?
|
||||
trace_rc ${returncode}
|
||||
@@ -114,4 +145,4 @@ ln_newaddr()
|
||||
return ${returncode}
|
||||
}
|
||||
|
||||
case "${0}" in *call_lightningd.sh) call_lightningd $@;; esac
|
||||
case "${0}" in *call_lightningd.sh) ./lightning-cli $@;; esac
|
||||
|
||||
@@ -281,6 +281,22 @@ main()
|
||||
response_to_client "${response}" ${?}
|
||||
break
|
||||
;;
|
||||
ln_getinvoice)
|
||||
# GET http://192.168.111.152:8080/ln_getinvoice/label
|
||||
# GET http://192.168.111.152:8080/ln_getinvoice/koNCcrSvhX3dmyFhW
|
||||
|
||||
response=$(ln_getinvoice $(echo "${line}" | cut -d ' ' -f2 | cut -d '/' -f3))
|
||||
response_to_client "${response}" ${?}
|
||||
break
|
||||
;;
|
||||
ln_decodebolt11)
|
||||
# GET http://192.168.111.152:8080/ln_decodebolt11/bolt11
|
||||
# GET http://192.168.111.152:8080/ln_decodebolt11/lntb1pdca82tpp5gv8mn5jqlj6xztpnt4r472zcyrwf3y2c3cvm4uzg2gqcnj90f83qdp2gf5hgcm0d9hzqnm4w3kx2apqdaexgetjyq3nwvpcxgcqp2g3d86wwdfvyxcz7kce7d3n26d2rw3wf5tzpm2m5fl2z3mm8msa3xk8nv2y32gmzlhwjved980mcmkgq83u9wafq9n4w28amnmwzujgqpmapcr3
|
||||
|
||||
response=$(ln_decodebolt11 $(echo "${line}" | cut -d ' ' -f2 | cut -d '/' -f3))
|
||||
response_to_client "${response}" ${?}
|
||||
break
|
||||
;;
|
||||
ots_stamp)
|
||||
# POST http://192.168.111.152:8080/ots_stamp
|
||||
# BODY {"hash":"1ddfb769eb0b8876bc570e25580e6a53afcf973362ee1ee4b54a807da2e5eed7","callbackUrl":"192.168.111.233:1111/callbackUrl"}
|
||||
|
||||
Reference in New Issue
Block a user