diff --git a/examples/test.py b/examples/test.py index 2af85f6..885707d 100644 --- a/examples/test.py +++ b/examples/test.py @@ -1,6 +1,6 @@ import fat_py.fat2 as fat2 import fat_py.fat2.consts as consts -from factom_keys.fct import FactoidPrivateKey +from factom_keys.fct import FactoidPrivateKey, FactoidAddress from fat_py import FATd @@ -9,11 +9,17 @@ private_key = FactoidPrivateKey(key_string="Fs3E9gV6DXsYzf7Fqx1fVBQPQXV695eP3k5XbmHEZVRLkMdD9qCK") address = private_key.get_factoid_address() +output_addresses = [ + FactoidAddress(address_string="FA2ybgFNYQiZFgTjkwQwp74uGsEUHJc6hGEh4YA3ai7FcssemapP"), + FactoidAddress(address_string="FA34L6m7rQypr5PVmKGJ1Y4FQ6gDWbVaA49kFTGn1sSVZj6D8pFJ"), +] + print(fatd.get_pegnet_balances(address)) tx = fat2.Transaction() -tx.set_input(address, "pFCT", 10000) -tx.conversion = "pUSD" +tx.set_input(address, "PEG", 1000) +tx.add_transfer(output_addresses[0], 500) +tx.add_transfer(output_addresses[1], 500) tx_batch = fat2.TransactionBatch() tx_batch.add_transaction(tx) diff --git a/fat_py/fat2/models.py b/fat_py/fat2/models.py index 0fe8219..7d281fa 100644 --- a/fat_py/fat2/models.py +++ b/fat_py/fat2/models.py @@ -98,7 +98,7 @@ def is_valid(self) -> bool: @dataclass class TransactionBatch: - timestamp: str = str(datetime.datetime.utcnow().timestamp()) + timestamp: str = str(int(datetime.datetime.utcnow().timestamp())) _txs: List[Transaction] = dataclasses.field(init=False, default_factory=list) _signer_keys: List[FactoidPrivateKey] = dataclasses.field(init=False, default_factory=list)