Git Product home page Git Product logo

line-blockchain-api-caller's Introduction

line-blockchain-api-caller

Python implementations of LINE blockchain API caller.

See ./caller for source codes.


๐Ÿฐ Fantopia

The concrete example of LINE blockchain API caller.

Run (Server-side)

Fantopia Server

cd example/server
python app.py

or

cd example/server
docker build -t fantopia:latest .
docker run -d -p 5000:5000 fantopia

Curl (Client-side)

๐Ÿ‘ซ User

Add Artist

curl -X POST -H 'Content-Type: application/json' http://localhost:5000/addartist -d '{"address": "tlink1e38npkztaq90vvc3gnjhn0th8w52na005ahqf0", "secret": "QC3PbuSMC101uDBCOTWJeCsjSCuI57XvVnUDH8623iw="}'
  • address: Wallet address
  • secret: PW

Add User

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 address
  • secret: PW

๐Ÿ’พ Image

Get One Image

curl -X POST -H 'Content-Type: application/json' http://localhost:5000/getimage -d '{"pk": "1"}'

Get Multiple Images

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}'

Update Detail: Favorite

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}'

Reset Detail: Sell

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}'

Buy Image

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 buyer
  • toAddress: Wallet address of image seller
  • tokenIndex: (optional) NFT token index
  • price: (optional) Price of the image. It MUST be higher or same as seller-uploaded price.

Buy Goods

curl -X POST -H 'Content-Type: application/json' http://localhost:5000/buygoods -d '{"pk": "1"}'

Changing is_selled to true.

๐Ÿ”ง Utils

Get Service Token Balance

curl -X POST -H 'Content-Type: application/json' http://localhost:5000/getbalance -d '{"address": "tlink18vsd3cautlyt759sw5hq9tydhzrsrgrmprs4f0"}'

Get NFT Info.

curl -X POST -H 'Content-Type: application/json' http://localhost:5000/getinfo -d '{"tokenIndex": "000000c3"}'

Get Transaction Info.

curl -X POST -H 'Content-Type: application/json' http://localhost:5000/gettx -d '{"txHash": "DCD0B2D32E9329D77AA642A55DC10469A876767493D2F60254A70E4DCD099202"}'

line-blockchain-api-caller's People

Contributors

lukepark327 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

qkrwnsgh1288

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.