From 7a72ee2cc44be75eb42bb5132547dce81c02fab7 Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Wed, 23 Jun 2021 22:16:50 +0530 Subject: [PATCH] Updated Readme to include Python and Javascript example code --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/README.md b/README.md index 4d229aa..fd5aed1 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,24 @@ Output: } ``` +Python example code +``` +response = requests.get('https://ranchimallflo.duckdns.org/api/v1.0/getTokenList') +if response.status_code == 200: + json_response = response.json() +elif response.status_code == 404: + print('Not Found.') +``` + +Javascript example code +``` +fetch('https://ranchimallflo.duckdns.org/api/v1.0/getTokenList'){ + .then(response => response.json()) + .then(data => console.log(data)); +} +``` + + ### Information about a token Get information about a token on the FLO blockchain ``` @@ -67,6 +85,23 @@ Output: } ``` +Python example code +``` +response = requests.get('https://ranchimallflo.duckdns.org/api/v1.0/getTokenInfo?token=rmt') +if response.status_code == 200: + json_response = response.json() +elif response.status_code == 404: + print('Not Found.') +``` + +Javascript example code +``` +fetch('https://ranchimallflo.duckdns.org/api/v1.0/getTokenInfo?token=rmt'){ + .then(response => response.json()) + .then(data => console.log(data)); +} +``` + ### Information about a token's transactions Get information about a token's related transactions on the blockchain ``` @@ -99,6 +134,22 @@ Output: } ``` +Python example code +``` +response = requests.get('https://ranchimallflo.duckdns.org/api/v1.0/getTokenTransactions?token=rmt') +if response.status_code == 200: + json_response = response.json() +elif response.status_code == 404: + print('Not Found.') +``` + +Javascript example code +``` +fetch('https://ranchimallflo.duckdns.org/api/v1.0/getTokenTransactions?token=rmt'){ + .then(response => response.json()) + .then(data => console.log(data)); +} + ### Information about a token's address balances Get information about a token's address balances ```