diff --git a/kin/account.py b/kin/account.py index d89357b..351b249 100644 --- a/kin/account.py +++ b/kin/account.py @@ -13,7 +13,7 @@ from . import errors as KinErrors from .transactions import build_memo from .blockchain.errors import TransactionResultCode, HorizonErrorType, HorizonError -from .config import SDK_USER_AGENT, APP_ID_REGEX +from .config import SDK_USER_AGENT, APP_ID_REGEX, KIN_DECIMAL_PRECISION from .blockchain.utils import is_valid_address, is_valid_secret_key import logging @@ -337,7 +337,7 @@ def _top_up(self, address): # TODO: let user config the amount of kin to top up min_fee = self._client.get_minimum_fee() builder = self.get_transaction_builder(min_fee) - builder.append_payment_op(address, str(min_fee * 1000)) + builder.append_payment_op(address, str((min_fee / KIN_DECIMAL_PRECISION) * 1000)) # Enough for 1K txs builder.update_sequence() builder.sign() builder.submit() diff --git a/kin/config.py b/kin/config.py index 4eca81d..910e16a 100644 --- a/kin/config.py +++ b/kin/config.py @@ -1,4 +1,5 @@ """Contains the config for the Kin SDK""" +from kin_base.operation import ONE as KIN_DECIMAL_PRECISION from .blockchain.environment import Environment