diff --git a/mmgen/proto/rune/tx/online.py b/mmgen/proto/rune/tx/online.py index 74b4c929..7c1e69ad 100755 --- a/mmgen/proto/rune/tx/online.py +++ b/mmgen/proto/rune/tx/online.py @@ -12,7 +12,7 @@ proto.rune.tx.online: THORChain online signed transaction class """ -from ....util import pp_msg, die +from ....util import msg, pp_msg, die from ....tx import online as TxBase from .signed import Signed @@ -41,6 +41,13 @@ class OnlineSigned(Signed, TxBase.OnlineSigned): async def post_network_send(self, coin_txid): return True + async def get_receipt(self, txid, *, receipt_only=False): + try: + return self.rpc.get_tx_info(txid) + except Exception as e: + msg(f'{type(e).__name__}: {e}') + return False + class Sent(TxBase.Sent, OnlineSigned): pass diff --git a/mmgen/proto/rune/tx/status.py b/mmgen/proto/rune/tx/status.py new file mode 100755 index 00000000..254b360e --- /dev/null +++ b/mmgen/proto/rune/tx/status.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +# +# MMGen Wallet, a terminal-based cryptocurrency wallet +# Copyright (C)2013-2025 The MMGen Project +# 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.rune.tx.status: THORChain transaction status class +""" + +from ....util import msg, gmsg +from ....tx import status as TxBase + +class Status(TxBase.Status): + + async def display(self, *, idx=''): + + try: + self.tx.rpc.get_tx_info(self.tx.coin_txid) + except Exception as e: + msg(f'{type(e).__name__}: {e}') + return 2 + + gmsg('Transaction is in blockchain') + return 0