@@ -161,6 +161,13 @@ service SwapClient {
161161 */
162162 rpc WithdrawDeposits (WithdrawDepositsRequest )
163163 returns (WithdrawDepositsResponse );
164+
165+ /* loop:`static summary`
166+ GetStaticAddressSummary returns a summary of static address related
167+ statistics.
168+ */
169+ rpc GetStaticAddressSummary (StaticAddressSummaryRequest )
170+ returns (StaticAddressSummaryResponse );
164171}
165172
166173message LoopOutRequest {
@@ -1557,3 +1564,127 @@ message OutPoint {
15571564 */
15581565 uint32 output_index = 3 ;
15591566}
1567+
1568+ message StaticAddressSummaryRequest {
1569+ /*
1570+ Filters the list of all stored deposits by deposit state.
1571+ */
1572+ DepositState state_filter = 1 ;
1573+
1574+ /*
1575+ Filters the list of all stored deposits by the outpoint.
1576+ */
1577+ repeated string outpoints = 2 ;
1578+ }
1579+
1580+ message StaticAddressSummaryResponse {
1581+ /*
1582+ The static address of the client.
1583+ */
1584+ string static_address = 1 ;
1585+
1586+ /*
1587+ The total number of deposits.
1588+ */
1589+ uint32 total_num_deposits = 2 ;
1590+
1591+ /*
1592+ The total value of unconfirmed deposits.
1593+ */
1594+ int64 value_unconfirmed = 3 ;
1595+
1596+ /*
1597+ The total value of confirmed deposits.
1598+ */
1599+ int64 value_deposited = 4 ;
1600+
1601+ /*
1602+ The total value of all expired deposits.
1603+ */
1604+ int64 value_expired = 5 ;
1605+
1606+ /*
1607+ The total value of all deposits that have been withdrawn.
1608+ */
1609+ int64 value_withdrawn = 6 ;
1610+
1611+ /*
1612+ A list of all deposits that match the filtered state.
1613+ */
1614+ repeated Deposit filtered_deposits = 7 ;
1615+ }
1616+
1617+ enum DepositState {
1618+ /*
1619+ UNKNOWN_STATE is the default state of a deposit.
1620+ */
1621+ UNKNOWN_STATE = 0 ;
1622+
1623+ /*
1624+ DEPOSITED indicates that the deposit has been sufficiently confirmed on
1625+ chain.
1626+ */
1627+ DEPOSITED = 1 ;
1628+
1629+ /*
1630+ WITHDRAWING indicates that the deposit is currently being withdrawn. It
1631+ flips to WITHDRAWN once the withdrawal transaction has been sufficiently
1632+ confirmed.
1633+ */
1634+ WITHDRAWING = 2 ;
1635+
1636+ /*
1637+ WITHDRAWN indicates that the deposit has been withdrawn.
1638+ */
1639+ WITHDRAWN = 3 ;
1640+
1641+ /*
1642+ PUBLISH_EXPIRED indicates that the deposit has expired and the sweep
1643+ transaction has been published.
1644+ */
1645+ PUBLISH_EXPIRED = 4 ;
1646+
1647+ /*
1648+ WAIT_FOR_EXPIRY_SWEEP indicates that the deposit has expired and the sweep
1649+ transaction has not yet been sufficiently confirmed.
1650+ */
1651+ WAIT_FOR_EXPIRY_SWEEP = 5 ;
1652+
1653+ /*
1654+ EXPIRED indicates that the deposit has expired and the sweep transaction
1655+ has been sufficiently confirmed.
1656+ */
1657+ EXPIRED = 6 ;
1658+
1659+ /*
1660+ FAILED_STATE indicates that the deposit has failed.
1661+ */
1662+ FAILED_STATE = 7 ;
1663+ }
1664+
1665+ message Deposit {
1666+ /*
1667+ The identifier of the deposit.
1668+ */
1669+ bytes id = 1 ;
1670+
1671+ /*
1672+ The state of the deposit.
1673+ */
1674+ DepositState state = 2 ;
1675+
1676+ /*
1677+ The outpoint of the deposit in format txid:index.
1678+ */
1679+ string outpoint = 3 ;
1680+
1681+ /*
1682+ The value of the deposit in satoshis.
1683+ */
1684+ int64 value = 4 ;
1685+
1686+ /*
1687+ The block height at which the deposit was confirmed.
1688+ */
1689+ int64 confirmation_height = 5 ;
1690+ }
0 commit comments