@@ -101,6 +101,10 @@ type WalletKitClient interface {
101
101
addressType walletrpc.AddressType ,
102
102
change bool ) (btcutil.Address , error )
103
103
104
+ // GetTransaction returns details for a transaction found in the wallet.
105
+ GetTransaction (ctx context.Context ,
106
+ txid chainhash.Hash ) (Transaction , error )
107
+
104
108
PublishTransaction (ctx context.Context , tx * wire.MsgTx ,
105
109
label string ) error
106
110
@@ -481,6 +485,26 @@ func (m *walletKitClient) NextAddr(ctx context.Context, accountName string,
481
485
return addr , nil
482
486
}
483
487
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
+
484
508
func (m * walletKitClient ) PublishTransaction (ctx context.Context ,
485
509
tx * wire.MsgTx , label string ) error {
486
510
0 commit comments