Coder Social home page Coder Social logo

forgingblock-tezos-api-example's Introduction

ForgingBlock - Tezos API Example

During TQ tezos hackathon our main idea was to implement Tezos support for ForgingBlock Universal API.

And while the main product is proprietary, in this public repository we show example of how exactly we interact with tezos blockchain using conseiljs. So the tezos community could get and idea how easy to use community provided libraries even in such complex project as ForgingBlock Universal API.

Please see the Press Release from ForgingBlock: FORGINGBLOCK IS PARTICIPATING IN TEZOS ONLINE HACKATHON 2019

Endpoints

We have just two endpoints in this repository.

First shows example how to validate tezos address, and second shows wallet account balance ether for mainnet or alphanet.

  • POST /validate-xtz-address

Request example:

curl 'http://127.0.0.1:3000/validate-xtz-address' -H 'Content-Type: application/x-www-form-urlencoded' --data 'address=tz1isXamBXpTUgbByQ6gXgZQg4GWNW7r6rKE'

Response examples:

{"success":"Correct xtz address provided"}
{"error":"Please provide correct xtz address"}
{"error":"Please provide xtz address"}
  • POST /check-balance

Request examples:

curl 'http://127.0.0.1:3000/check-balance' -H 'Content-Type: application/x-www-form-urlencoded' --data 'address=tz1TaLYBeGZD3yKVHQGBM857CcNnFFNceLYh'
curl 'http://127.0.0.1:3000/check-balance' -H 'Content-Type: application/x-www-form-urlencoded' --data 'address=tz1TaLYBeGZD3yKVHQGBM857CcNnFFNceLYh&network=alphanet'

Response examples:

{"balance":"271971.864666"}
{"error":"Please provide valid xtz address"}

Running

Just clone, npm install and node .

Overall:

git clone https://github.com/forgingblock/tezos-api-example
cd tezos-api-example
npm install
node .

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.