def __to_binary_v3(self): return (self.TYPE.to_bytes(1, 'big') + b'\3' + crypto.str2bytes(self.chain_id) + struct.pack(">Q", self.timestamp) + crypto.key_type_id(self.sender_key_type) + base58.b58decode(self.sender_public_key) + struct.pack(">Q", self.tx_fee) + base58.b58decode(self.recipient))
def __accounts_data(self): data = b'' for account in self.accounts: data += crypto.key_type_id(account['key_type']) data += base58.b58decode(account['public_key']) return data
def __to_binary_v3(self): data_binary = self.__data_to_binary() return (self.TYPE.to_bytes(1, 'big') + b'\3' + crypto.str2bytes(self.chain_id) + struct.pack(">Q", self.timestamp) + crypto.key_type_id(self.sender_key_type) + base58.b58decode(self.sender_public_key) + struct.pack(">Q", self.tx_fee) + struct.pack(">H", len(self.data)) + data_binary)
def __to_binary_v3(self): return (self.TYPE.to_bytes(1, 'big') + b'\3' + crypto.str2bytes(self.chain_id) + struct.pack(">Q", self.timestamp) + crypto.key_type_id(self.sender_key_type) + base58.b58decode(self.sender_public_key) + struct.pack(">Q", self.tx_fee) + struct.pack(">H", len(self.transfers)) + self.__transfers_to_binary() + struct.pack(">H", len(self.attachment)) + crypto.str2bytes(self.attachment))
def __to_binary_v3(self): decoded_script = base64.b64decode(self.script[7:]) if self.script != "" else b'' return (self.TYPE.to_bytes(1, 'big') + b'\3' + crypto.str2bytes(self.chain_id) + struct.pack(">Q", self.timestamp) + crypto.key_type_id(self.sender_key_type) + base58.b58decode(self.sender_public_key) + struct.pack(">Q", self.tx_fee) + struct.pack(">H", len(decoded_script)) + decoded_script)
def __to_binary_v3(self): return (self.TYPE.to_bytes(1, 'big') + b'\3' + crypto.str2bytes(self.chain_id) + struct.pack(">Q", self.timestamp) + crypto.key_type_id(self.sender_key_type) + base58.b58decode(self.sender_public_key) + struct.pack(">Q", self.tx_fee) + base58.b58decode(self.recipient) + struct.pack(">i", self.association_type) + struct.pack(">Q", self.expires) + struct.pack(">H", len(crypto.str2bytes(self.anchor))) + crypto.str2bytes(self.anchor))