@@ -1673,6 +1673,53 @@ func (s *swapClientServer) ListStaticAddressDeposits(ctx context.Context,
1673
1673
}, nil
1674
1674
}
1675
1675
1676
+ // ListStaticAddressWithdrawals returns a list of all finalized withdrawal
1677
+ // transactions.
1678
+ func (s * swapClientServer ) ListStaticAddressWithdrawals (ctx context.Context ,
1679
+ _ * looprpc.ListStaticAddressWithdrawalRequest ) (
1680
+ * looprpc.ListStaticAddressWithdrawalResponse , error ) {
1681
+
1682
+ withdrawals , err := s .withdrawalManager .GetAllWithdrawals (ctx )
1683
+ if err != nil {
1684
+ return nil , err
1685
+ }
1686
+
1687
+ if len (withdrawals ) == 0 {
1688
+ return & looprpc.ListStaticAddressWithdrawalResponse {}, nil
1689
+ }
1690
+
1691
+ clientWithdrawals := make (
1692
+ []* looprpc.StaticAddressWithdrawal , 0 , len (withdrawals ),
1693
+ )
1694
+ for _ , w := range withdrawals {
1695
+ deposits := make ([]* looprpc.Deposit , 0 , len (w .Deposits ))
1696
+ for _ , d := range w .Deposits {
1697
+ deposits = append (deposits , & looprpc.Deposit {
1698
+ Id : d .ID [:],
1699
+ Outpoint : d .OutPoint .String (),
1700
+ Value : int64 (d .Value ),
1701
+ ConfirmationHeight : d .ConfirmationHeight ,
1702
+ State : toClientDepositState (
1703
+ d .GetState (),
1704
+ ),
1705
+ })
1706
+ }
1707
+ withdrawal := & looprpc.StaticAddressWithdrawal {
1708
+ TxId : w .TxID .String (),
1709
+ Deposits : deposits ,
1710
+ TotalDepositAmountSatoshis : int64 (w .TotalDepositAmount ),
1711
+ WithdrawnAmountSatoshis : int64 (w .WithdrawnAmount ),
1712
+ ChangeAmountSatoshis : int64 (w .ChangeAmount ),
1713
+ ConfirmationHeight : uint32 (w .ConfirmationHeight ),
1714
+ }
1715
+ clientWithdrawals = append (clientWithdrawals , withdrawal )
1716
+ }
1717
+
1718
+ return & looprpc.ListStaticAddressWithdrawalResponse {
1719
+ Withdrawals : clientWithdrawals ,
1720
+ }, nil
1721
+ }
1722
+
1676
1723
// ListStaticAddressSwaps returns a list of all swaps that are currently pending
1677
1724
// or previously succeeded.
1678
1725
func (s * swapClientServer ) ListStaticAddressSwaps (ctx context.Context ,
0 commit comments