Python implementations of LINE blockchain API caller.
See ./caller
for source codes.
The concrete example of LINE blockchain API caller.
cd example/server
python app.py
or
cd example/server
docker build -t fantopia:latest .
docker run -d -p 5000:5000 fantopia
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/addartist -d '{"address": "tlink1e38npkztaq90vvc3gnjhn0th8w52na005ahqf0", "secret": "QC3PbuSMC101uDBCOTWJeCsjSCuI57XvVnUDH8623iw="}'
address
: Wallet addresssecret
: PW
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/adduser -d '{"address": "tlink18vsd3cautlyt759sw5hq9tydhzrsrgrmprs4f0", "secret": "gD6Skn0b66WLt5oq8OYe0ejI4OzjthyWMYm4V7gqamg="}'
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/adduser -d '{"address": "tlink1lnl66me3geg6t2l62w07rx5j2utewvn54908vd", "secret": "UkbP/u5dyLqj2vUELA0WMQtcwaA5IxBEomYmdojX3uY="}'
address
: Wallet addresssecret
: PW
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/getimage -d '{"pk": "1"}'
curl -X POST http://localhost:5000/getallimages
or
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/getallimages -d '{"startNum": 1, "endNum": 3}'
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/updatefavorite -d '{"pk": "2"}'
or
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/updatefavorite -d '{"pk": "2", "favor": true}'
curl -X POST http://localhost:5000/sellreset
or
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/sellreset -d '{"startNum": 1, "endNum": 3}'
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/buyimage -d '{"pk": "1", "fromAddress": "tlink1lnl66me3geg6t2l62w07rx5j2utewvn54908vd", "toAddress": "tlink18vsd3cautlyt759sw5hq9tydhzrsrgrmprs4f0"}'
or
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/buyimage -d '{"pk": "1", "fromAddress": "tlink1lnl66me3geg6t2l62w07rx5j2utewvn54908vd", "toAddress": "tlink18vsd3cautlyt759sw5hq9tydhzrsrgrmprs4f0", "tokenIndex": "000000c3", "price": "100"}'
pk
: Primary Key.fromAddress
: Wallet address of buyertoAddress
: Wallet address of image sellertokenIndex
: (optional) NFT token indexprice
: (optional) Price of the image. It MUST be higher or same as seller-uploaded price.
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/buygoods -d '{"pk": "1"}'
Changing is_selled
to true
.
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/getbalance -d '{"address": "tlink18vsd3cautlyt759sw5hq9tydhzrsrgrmprs4f0"}'
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/getinfo -d '{"tokenIndex": "000000c3"}'
curl -X POST -H 'Content-Type: application/json' http://localhost:5000/gettx -d '{"txHash": "DCD0B2D32E9329D77AA642A55DC10469A876767493D2F60254A70E4DCD099202"}'