diff --git a/README.md b/README.md index e285f87..4787367 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,18 @@ Kinda ugly, very alpha. ## Usage ``` -import fat_py -fatd = fat_py.FATd() -fatd.get_sync_status() +>>> import fat_py +>>> fatd = fat_py.FATd() +>>> fatd.get_sync_status() {'syncheight': 62, 'factomheight': 62} -``` \ No newline at end of file +``` + +Get PegNet Balances +``` +>>> import fat_py +>>> from factom_keys.fct import FactoidAddress +>>> fatd = fat_py.FATd() +>>> address = FactoidAddress(address_string="FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q") +>>> fatd.get_pegnet_balances(address) +{'PEG': 0, 'pADA': 0, 'pBNB': 0, 'pBRL': 0, 'pCAD': 0, 'pCHF': 0, 'pCNY': 0, 'pDAS': 0, 'pDCR': 0, 'pETH': 0, 'pEUR': 0, 'pFCT': 0, 'pGBP': 0, 'pHKD': 0, 'pINR': 0, 'pJPY': 0, 'pKRW': 0, 'pLTC': 0, 'pMXN': 0, 'pPHP': 0, 'pRVN': 0, 'pSGD': 0, 'pUSD': 0, 'pXAG': 0, 'pXAU': 0, 'pXBC': 0, 'pXBT': 0, 'pXLM': 0, 'pXMR': 0, 'pZEC': 0} +``` diff --git a/fat_py/client.py b/fat_py/client.py index afb7e9a..d089a73 100644 --- a/fat_py/client.py +++ b/fat_py/client.py @@ -1,6 +1,7 @@ import random import string from urllib.parse import urljoin +from factom_keys.fct import FactoidAddress from .errors import handle_error_response from .session import APISession @@ -72,3 +73,6 @@ def get_sync_status(self): """Retrieve the current sync status of the node.""" return self._request("get-sync-status") + def get_pegnet_balances(self, address: FactoidAddress): + """Retrieve all current pegnet balances for the given address""" + return self._request("get-pegnet-balances", {"address": address.to_string()}) diff --git a/requirements.txt b/requirements.txt index 663bd1f..55a6266 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ +factom-keys requests \ No newline at end of file