From 00781a3554de777582607086ddf6ef4bb41bf245 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 12 Oct 2026 10:04:47 +0000 Subject: [PATCH] Thornode -> ThornodeQuote --- mmgen/proto/rune/rpc/remote.py | 4 ++-- mmgen/swap/proto/thorchain/__init__.py | 6 +++--- mmgen/swap/proto/thorchain/{thornode.py => quote.py} | 10 +++++----- mmgen/tx/new_swap.py | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) rename mmgen/swap/proto/thorchain/{thornode.py => quote.py} (95%) diff --git a/mmgen/proto/rune/rpc/remote.py b/mmgen/proto/rune/rpc/remote.py index c3b3d65c..36cdde27 100644 --- a/mmgen/proto/rune/rpc/remote.py +++ b/mmgen/proto/rune/rpc/remote.py @@ -145,9 +145,9 @@ class THORChainRemoteRPCClient(RemoteRPCClient): from_asset = get_swap_asset(self.cfg, send_asset, direction='send') to_asset = get_swap_asset(self.cfg, recv_asset, direction='recv') send_amt = init_swap_proto(self.cfg, from_asset).coin_amt(str(amt)) - return self.get_quote(from_asset, to_asset, send_amt) + return self.do_quote(from_asset, to_asset, send_amt) - def get_quote(self, from_asset, to_asset, amt, *, amt_is_atomic=False): + def do_quote(self, from_asset, to_asset, amt, *, amt_is_atomic=False): from ....swap.util import get_swap_proto_mod swap_cfg = get_swap_proto_mod(self.swap_proto).SwapCfg(self.cfg) qs = make_query_string({ diff --git a/mmgen/swap/proto/thorchain/__init__.py b/mmgen/swap/proto/thorchain/__init__.py index 14b0fea6..c3616567 100644 --- a/mmgen/swap/proto/thorchain/__init__.py +++ b/mmgen/swap/proto/thorchain/__init__.py @@ -21,9 +21,9 @@ class ExpInt4(ExpInt): def __new__(cls, spec): return ExpInt.__new__(cls, spec, prec=exp_prec) -def rpc_client(tx, amt): - from .thornode import Thornode - return Thornode(tx, amt) +def quote_client(tx, amt): + from .quote import ThornodeQuote + return ThornodeQuote(tx, amt) from .cfg import THORChainSwapCfg as SwapCfg diff --git a/mmgen/swap/proto/thorchain/thornode.py b/mmgen/swap/proto/thorchain/quote.py similarity index 95% rename from mmgen/swap/proto/thorchain/thornode.py rename to mmgen/swap/proto/thorchain/quote.py index 065a7cd3..af9bdebb 100644 --- a/mmgen/swap/proto/thorchain/thornode.py +++ b/mmgen/swap/proto/thorchain/quote.py @@ -7,7 +7,7 @@ # https://gitlab.com/mmgen/mmgen-wallet """ -swap.proto.thorchain.thornode: THORChain swap protocol network query ops +swap.proto.thorchain.quote: THORChain swap protocol remote quote class """ import time @@ -23,7 +23,7 @@ gas_unit_data = { 'gwei': _gd('G', 'Gwei'), } -class Thornode: +class ThornodeQuote: def __init__(self, tx, amt): self.tx = tx @@ -36,10 +36,10 @@ class Thornode: and self.tx.send_asset.chain != 'THOR'): # token swap from ....swap.util import get_swap_asset rune_asset = get_swap_asset(self.tx.cfg, 'RUNE') - in_data = self.rpc.get_quote(self.tx.send_asset, rune_asset, self.in_amt) + in_data = self.rpc.do_quote(self.tx.send_asset, rune_asset, self.in_amt) if self.tx.proto.network != 'regtest': time.sleep(1.1) # ninerealms max request rate 1/sec - out_data = self.rpc.get_quote( + out_data = self.rpc.do_quote( rune_asset, self.tx.recv_asset, in_data['expected_amount_out'], @@ -49,7 +49,7 @@ class Thornode: 'fees': out_data['fees'], 'expiry': min(in_data['expiry'], out_data['expiry'])} else: - self.data = self.rpc.get_quote(self.tx.send_asset, self.tx.recv_asset, self.in_amt) + self.data = self.rpc.do_quote(self.tx.send_asset, self.tx.recv_asset, self.in_amt) async def format_quote(self, *, deduct_est_fee=False, skip_est_fee=False): from ....util import make_timestr, ymsg diff --git a/mmgen/tx/new_swap.py b/mmgen/tx/new_swap.py index 117a482d..d6a6ceba 100644 --- a/mmgen/tx/new_swap.py +++ b/mmgen/tx/new_swap.py @@ -130,7 +130,7 @@ class NewSwap(New): if not args.send_amt: die(1, 'With --quote, you must supply a send amount') await self.display_quote( - self.swap_proto_mod.rpc_client(self, args.send_amt), + self.swap_proto_mod.quote_client(self, args.send_amt), skip_est_fee = True) sys.exit(0) @@ -204,7 +204,7 @@ class NewSwap(New): async def update_vault_output(self, amt, *, deduct_est_fee=False): from ..term import get_char - qd = self.swap_proto_mod.rpc_client(self, amt) + qd = self.swap_proto_mod.quote_client(self, amt) while True: await self.display_quote(qd, deduct_est_fee=deduct_est_fee) ch = get_char('Press ‘r’ to refresh quote, any other key to continue: ')