#!/usr/bin/env python3
#
# MMGen Wallet, a terminal-based cryptocurrency wallet
# Copyright (C)2013-2026 The MMGen Project <mmgen@tuta.io>
# Licensed under the GNU General Public License, Version 3:
#   https://www.gnu.org/licenses
# Public project repositories:
#   https://github.com/mmgen/mmgen-wallet
#   https://gitlab.com/mmgen/mmgen-wallet

"""
proto.eth.tx.new_swap: Ethereum new swap transaction class
"""

from ....tx.new_swap import NewSwap as TxNewSwap

from ...vm.tx.new_swap import VmNewSwap

from .new import New, TokenNew

class NewSwap(VmNewSwap, New, TxNewSwap):
	desc = 'Ethereum swap transaction'

class TokenNewSwap(TokenNew, NewSwap):
	desc = 'Ethereum token swap transaction'

	def update_vault_addr(self, c):
		self.token_vault_addr = self.proto.coin_addr(c.inbound_address)
		return super().update_vault_addr(c, addr='router')
