def encoded_message(self) -> bytes: return b"".join([ int_to_bytes(self.tx_type(), 1), serialize_account_id(self.account_id), serialize_address(self.account), serialize_address(self.new_pk_hash), serialize_token_id(self.token.id), packed_fee_checked(self.fee), serialize_nonce(self.nonce), serialize_timestamp(self.valid_from), serialize_timestamp(self.valid_until) ])
def encoded_message(self) -> bytes: return b"".join([ int_to_bytes(0xff - self.tx_type(), 1), int_to_bytes(TRANSACTION_VERSION, 1), serialize_account_id(self.creator_id), serialize_address(self.creator_address), serialize_content_hash(self.content_hash), serialize_address(self.recipient), serialize_token_id(self.fee_token.id), packed_fee_checked(self.fee), serialize_nonce(self.nonce), ])
def encoded_message(self) -> bytes: return b"".join([ int_to_bytes(0xff - self.tx_type(), 1), int_to_bytes(TRANSACTION_VERSION, 1), serialize_account_id(self.account_id), serialize_address(self.from_address), serialize_address(self.to_address), serialize_token_id(self.token_id), serialize_token_id(self.fee_token.id), packed_fee_checked(self.fee), serialize_nonce(self.nonce), serialize_timestamp(self.valid_from), serialize_timestamp(self.valid_until) ])
def get_eth_tx_bytes(self) -> bytes: data = b"".join([ serialize_address(self.new_pk_hash), serialize_nonce(self.nonce), serialize_account_id(self.account_id), ]) if self.eth_auth_data is not None: data += self.eth_auth_data.encode_message() return data
def encoded_message(self) -> bytes: return b"".join([ int_to_bytes(self.msg_type(), 1), int_to_bytes(TRANSACTION_VERSION, 1), serialize_account_id(self.account_id), serialize_address(self.recipient), serialize_nonce(self.nonce), serialize_token_id(self.token_sell.id), serialize_token_id(self.token_buy.id), serialize_ratio_part(self.ratio.numerator), serialize_ratio_part(self.ratio.denominator), packed_amount_checked(self.amount), serialize_timestamp(self.valid_from), serialize_timestamp(self.valid_until) ])
def encoded_message(self) -> bytes: order_bytes = b''.join([ self.orders[0].encoded_message(), self.orders[1].encoded_message(), ]) return b"".join([ int_to_bytes(0xff - self.tx_type(), 1), int_to_bytes(TRANSACTION_VERSION, 1), serialize_account_id(self.submitter_id), serialize_address(self.submitter_address), serialize_nonce(self.nonce), ZkSyncLibrary().hash_orders(order_bytes), serialize_token_id(self.fee_token.id), packed_fee_checked(self.fee), packed_amount_checked(self.amounts[0]), packed_amount_checked(self.amounts[1]), ])