diff --git a/API/QRCODE.sh b/API/QRCODE.sh index c11b7689..038ecb6c 100755 --- a/API/QRCODE.sh +++ b/API/QRCODE.sh @@ -70,11 +70,12 @@ if [[ $ASTROPATH != "" ]]; then echo "LINKING $ASTROPATH to .current" #### SELECT PARRAIN "G1PalPé" - #>>>>>>>>>>>> # SEND TO G1BILLETS - sed "s~_TWLINK_~${myG1BILLET}?montant=0\&style=astro~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect - echo "url='"${myG1BILLET}"?montant=0\&style=astro'" >> ~/.zen/tmp/${MOATS}/index.redirect + echo "#>>>>>>>>>>>> # SEND TO G1BILLETS" + sed "s~_TWLINK_~${myG1BILLET}?montant=0\&style=jeu~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect + echo "url='"${myG1BILLET}"?montant=0\&style=jeu'" >> ~/.zen/tmp/${MOATS}/index.redirect ( cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 + rm -Rf ~/.zen/tmp/${MOATS} ) & exit 0 fi diff --git a/API/SALT.sh b/API/SALT.sh index 08417c9a..6abd33f9 100755 --- a/API/SALT.sh +++ b/API/SALT.sh @@ -137,7 +137,7 @@ PEPPER=$THIS ######################## MESSAGING END ######################################## -# G1PUB : REDIRECT TO GCHANGE OR TW + EMAIL = CREATE PLAYER +# G1PUB : REDIRECT TO GCHANGE OR TW + EMAIL => CREATE PLAYER ! ######################################## if [[ "$APPNAME" == "g1pub" ]]; then @@ -352,6 +352,45 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh exit 0 fi +############################################## +# PAY : /?salt=SALT&pepper=PEPPER&pay=1&dest=G1PUB APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9 +############################################## + if [[ $APPNAME == "pay" ]]; then + ( + echo "$HTTPCORS" > ~/.zen/tmp/$PLAYER.pay.$WHAT.http + + if [[ $WHAT =~ ^[0-9]+$ ]]; then + + echo "${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a ${WHAT} -p ${VAL} -c 'Bro' -m" + ~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \ + ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a ${WHAT} -p ${VAL} -c 'Bro' -m 2>&1 >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http + + fi + + if [[ "$WHAT" == "history" ]]; then + sed -i "s~text/html~application/json~g" ~/.zen/tmp/$PLAYER.pay.$WHAT.http + ~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \ + ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey history -j >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http + fi + + if [[ "$WHAT" == "get" ]]; then + sed -i "s~text/html~application/json~g" ~/.zen/tmp/$PLAYER.pay.$WHAT.http + ~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \ + ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey get >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http + fi + + if [[ "$WHAT" == "balance" ]]; then + ~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \ + ${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey balance >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http + fi + + cat ~/.zen/tmp/$PLAYER.pay.$WHAT.http + cat ~/.zen/tmp/$PLAYER.pay.$WHAT.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & + end=`date +%s` + echo "(G_G ) G1BANK Operation time was "`expr $end - $start` seconds. + exit 0 + ) & + fi ############################################## # FRIEND ★ &friend=G1PUB&stars=1 // APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9 diff --git a/README.md b/README.md index fbfdfef8..8cd8006c 100644 --- a/README.md +++ b/README.md @@ -215,7 +215,19 @@ Redirections ```/?salt=${SALT}&pepper=${PEPPER}&g1pub=astro``` -## ➤ PLAYER ZONE (API de la Station qui héberge votre PLAYER) +### Déclencher un Payement de 1 Ğ1 à Fred +```http +GET /?salt=${SALT}&pepper=${PEPPER}&pay=1&g1pub=DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech +``` + +| Parameter | Type | Description | +| :-------- | :------- | :-------------------------------- | +| `salt` | `string` | **Required**. Your passphrase one token | +| `pepper` | `string` | **Required**. Your passphrase two token | +| `pay` | `integer` | **Required** G1 AMOUNT | +| `g1pub` | `G1PUB` | **Required** destination "wallet key" | + +## ➤ PLAYER ZONE (API Station qui héberge ${PLAYER}) ### ```/?player=${PLAYER}&${APPNAME}=${WHAT}&${OBJ}=${VAL}...``` ### Déclencher un Payement de 99 Ğ1 à Fred @@ -226,8 +238,8 @@ GET /?player=${PLAYER}&pay=99&g1pub=DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech | Parameter | Type | Description | | :-------- | :------- | :-------------------------------- | | `player` | `string` | **Required**. Your EMAIL token | -| `pay` | `string` | **Required** pay = ZEN AMOUNT | -| `g1pub` | `${VAL}` | **Required** G1PUB | +| `pay` | `integer` | **Required** G1 AMOUNT | +| `g1pub` | `G1PUB` | **Required** destination "wallet key" | ### Exporter Tiddlers.json depuis son TW selon valeur des "tags" ( ici TAG=G1CopierYoutube) diff --git a/templates/register.html b/templates/register.html index f852d97c..462194fe 100644 --- a/templates/register.html +++ b/templates/register.html @@ -41,7 +41,7 @@ header { - + diff --git a/tools/make_image_ipfs_index_carousel.sh b/tools/make_image_ipfs_index_carousel.sh index b2a61c74..c5b78f29 100755 --- a/tools/make_image_ipfs_index_carousel.sh +++ b/tools/make_image_ipfs_index_carousel.sh @@ -38,7 +38,7 @@ if [[ ! -d $img_dir ]]; then || echo "_REPLACE_" > ~/.zen/tmp/carousel/${pub}.insert ## DEBUG PATCH - echo "_REPLACE_" > ~/.zen/tmp/carousel/${pub}.insert + echo "_REPLACE_" > ~/.zen/tmp/carousel/${pub}.insert done img_dir="$HOME/.zen/tmp/carousel" @@ -58,7 +58,7 @@ echo " " > $html_file echo " - +