From ad6b6fef08049503e9142f8bc0ec8dcd99e7aed6 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Thu, 16 May 2024 00:52:13 +0200 Subject: [PATCH] Fixed decimals --- personal_data/fetchers/partisia_blockchain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/personal_data/fetchers/partisia_blockchain.py b/personal_data/fetchers/partisia_blockchain.py index 5b6bf77..25a1fd8 100644 --- a/personal_data/fetchers/partisia_blockchain.py +++ b/personal_data/fetchers/partisia_blockchain.py @@ -24,6 +24,7 @@ HOSTNAME = 'reader.partisiablockchain.com' URL_ACCOUNT_PLUGIN = 'https://{hostname}/{shard}blockchain/accountPlugin/local' URL_ACCOUNT_PLUGIN_GLOBAL = 'https://{hostname}/{shard}blockchain/accountPlugin/global' +MPC_DECIMALS = 10000 def shard_id_for_address(address: str) -> str: return 'shards/Shard2/' # TODO @@ -85,7 +86,7 @@ class MpcBalance(Scraper): 'account.update_time': date, } - data_point['balance.MPC'] = Decimal(account_data['mpcTokens']) / 1000 + data_point['balance.MPC'] = Decimal(account_data['mpcTokens']) / MPC_DECIMALS for coin_idx, amount_data in enumerate(account_data['accountCoins']): coin_data = coins[coin_idx]