@@ -101,6 +101,10 @@ type WalletKitClient interface {
101101 addressType walletrpc.AddressType ,
102102 change bool ) (btcutil.Address , error )
103103
104+ // GetTransaction returns details for a transaction found in the wallet.
105+ GetTransaction (ctx context.Context ,
106+ txid chainhash.Hash ) (Transaction , error )
107+
104108 PublishTransaction (ctx context.Context , tx * wire.MsgTx ,
105109 label string ) error
106110
@@ -481,6 +485,26 @@ func (m *walletKitClient) NextAddr(ctx context.Context, accountName string,
481485 return addr , nil
482486}
483487
488+ // GetTransaction returns details for a transaction found in the wallet.
489+ func (m * walletKitClient ) GetTransaction (ctx context.Context ,
490+ txid chainhash.Hash ) (Transaction , error ) {
491+
492+ rpcCtx , cancel := context .WithTimeout (ctx , m .timeout )
493+ defer cancel ()
494+
495+ rpcCtx = m .walletKitMac .WithMacaroonAuth (rpcCtx )
496+
497+ req := & walletrpc.GetTransactionRequest {
498+ Txid : txid .String (),
499+ }
500+ resp , err := m .client .GetTransaction (rpcCtx , req )
501+ if err != nil {
502+ return Transaction {}, err
503+ }
504+
505+ return unmarshallTransaction (resp )
506+ }
507+
484508func (m * walletKitClient ) PublishTransaction (ctx context.Context ,
485509 tx * wire.MsgTx , label string ) error {
486510
0 commit comments