def _send_kyc_data_and_receipient_signature( command: offchain.PaymentCommand, ) -> offchain.PaymentCommand: sig_msg = command.travel_rule_metadata_signature_message(_hrp()) user_id = get_account_id_from_subaddr( command.receiver_subaddress(_hrp()).hex()) return command.new_command( recipient_signature=_compliance_private_key().sign(sig_msg).hex(), kyc_data=_user_kyc_data(user_id), status=offchain.Status.ready_for_settlement, )
def _send_kyc_data_and_receipient_signature( self, command: offchain.PaymentCommand, ) -> offchain.PaymentCommand: sig_msg = command.travel_rule_metadata_signature_message(self.hrp) subaddress = command.receiver_subaddress(self.hrp) user = self._find_user_by_subaddress(subaddress) return command.new_command( recipient_signature=self.compliance_key.sign(sig_msg).hex(), kyc_data=user.kyc_data(), status=offchain.Status.ready_for_settlement, )