diff --git a/client/core/bond.go b/client/core/bond.go index eab1e09539..8a42e82e1b 100644 --- a/client/core/bond.go +++ b/client/core/bond.go @@ -416,6 +416,7 @@ func (c *Core) bondStateOfDEX(dc *dexConnection, bondCfg *dexBondCfg) *dexAcctBo state.WeakStrength = sumBondStrengths(weakBonds, bondCfg.bondAssets) state.LiveStrength = sumBondStrengths(dc.acct.bonds, bondCfg.bondAssets) // for max bonded check state.PendingBonds = dc.pendingBonds() + state.ExpiredBondsPendingRefund = int64(len(dc.acct.expiredBonds)) // Extract the expired bonds. state.expiredBonds = make([]*db.Bond, len(dc.acct.expiredBonds)) copy(state.expiredBonds, dc.acct.expiredBonds) diff --git a/client/core/types.go b/client/core/types.go index ea21e8bc80..631981d14c 100644 --- a/client/core/types.go +++ b/client/core/types.go @@ -676,6 +676,8 @@ type ExchangeAuth struct { PenaltyComps uint16 `json:"penaltyComps"` // PendingBonds are currently pending bonds and their confirmation count. PendingBonds []*PendingBondState `json:"pendingBonds"` + // expiredBondsPendingRefund is the number of expired but unrefunded bonds. + ExpiredBondsPendingRefund int64 `json:"expiredBondsPendingRefund"` // Compensation is the amount we have locked in bonds greater than what // is needed to maintain our target tier. This could be from penalty // compensation, or it could be due to the user lowering their target tier. diff --git a/client/webserver/locales/en-us.go b/client/webserver/locales/en-us.go index a35e5b03cc..7e8f06878e 100644 --- a/client/webserver/locales/en-us.go +++ b/client/webserver/locales/en-us.go @@ -466,35 +466,36 @@ var EnUS = map[string]string{ "Instructions:": "Instructions:", "URL": "URL", // Staking UI - "Price": "Price", - "Ticket": "Ticket", - "Staking": "Staking", - "Active tickets": "Active tickets", - "Tickets bought": "Tickets bought", - "Total rewards": "Total rewards", - "Votes cast": "Votes cast", - "VSP": "VSP", - "select_vsp_from_list": "Select a Voting Service Provider", - "Or add custom VSP URL:": "Or add custom VSP URL:", - "Custom VSP URL": "Custom VSP URL", - "Set Votes": "Set Votes", - "agendas": "agendas", - "Agendas": "Agendas", - "treasury spends": "treasury spends", - "staking_unavailable_for_rpc": "Staking unavailable for RPC wallets using SPV", - "Purchase Tickets": "Purchase Tickets", - "Tickets": "Tickets", - "Ticket Price": "Ticket Price", - "Vote Reward": "Vote Reward", - "fee_rate_percent": "Fee Rate (%)", - "Live Tickets": "Live Tickets", - "Current Price": "Current Price", - "Available Balance": "Available Balance", - "ticket_qty_label": "How Many?", - "Ticket History": "Ticket History", - "No tickets to show": "No tickets to show", - "Treasury Spends": "Treasury Spends", - "No": "No", - "Yes": "Yes", - "Treasury Keys": "Treasury Keys", + "Price": "Price", + "Ticket": "Ticket", + "Staking": "Staking", + "Active tickets": "Active tickets", + "Tickets bought": "Tickets bought", + "Total rewards": "Total rewards", + "Votes cast": "Votes cast", + "VSP": "VSP", + "select_vsp_from_list": "Select a Voting Service Provider", + "Or add custom VSP URL:": "Or add custom VSP URL:", + "Custom VSP URL": "Custom VSP URL", + "Set Votes": "Set Votes", + "agendas": "agendas", + "Agendas": "Agendas", + "treasury spends": "treasury spends", + "staking_unavailable_for_rpc": "Staking unavailable for RPC wallets using SPV", + "Purchase Tickets": "Purchase Tickets", + "Tickets": "Tickets", + "Ticket Price": "Ticket Price", + "Vote Reward": "Vote Reward", + "fee_rate_percent": "Fee Rate (%)", + "Live Tickets": "Live Tickets", + "Current Price": "Current Price", + "Available Balance": "Available Balance", + "ticket_qty_label": "How Many?", + "Ticket History": "Ticket History", + "No tickets to show": "No tickets to show", + "Treasury Spends": "Treasury Spends", + "No": "No", + "Yes": "Yes", + "Treasury Keys": "Treasury Keys", + "expired_bonds_pending_refund": "Expired Bonds Pending Refund", } diff --git a/client/webserver/site/src/html/dexsettings.tmpl b/client/webserver/site/src/html/dexsettings.tmpl index f02214247f..2a8c25f143 100644 --- a/client/webserver/site/src/html/dexsettings.tmpl +++ b/client/webserver/site/src/html/dexsettings.tmpl @@ -30,6 +30,10 @@ [[[Penalties]]] +
+ [[[expired_bonds_pending_refund]]] + +
diff --git a/client/webserver/site/src/js/dexsettings.ts b/client/webserver/site/src/js/dexsettings.ts index c524028f28..442948286e 100644 --- a/client/webserver/site/src/js/dexsettings.ts +++ b/client/webserver/site/src/js/dexsettings.ts @@ -264,11 +264,12 @@ export default class DexSettingsPage extends BasePage { updateReputation () { const page = this.page const auth = app().exchanges[this.host].auth - const { rep: { penalties }, targetTier } = auth + const { rep: { penalties }, targetTier, expiredBondsPendingRefund } = auth const displayTier = strongTier(auth) page.targetTier.textContent = String(targetTier) page.effectiveTier.textContent = String(displayTier) page.penalties.textContent = String(penalties) + page.expiredBondsPendingRefund.textContent = `${expiredBondsPendingRefund}` this.reputationMeter.update() } diff --git a/client/webserver/site/src/js/registry.ts b/client/webserver/site/src/js/registry.ts index 04280e40ab..573970c89e 100644 --- a/client/webserver/site/src/js/registry.ts +++ b/client/webserver/site/src/js/registry.ts @@ -43,6 +43,7 @@ export interface ExchangeAuth { maxBondedAmt: number penaltyComps: number pendingBonds: PendingBondState[] + expiredBondsPendingRefund: number compensation: number } @@ -648,8 +649,8 @@ export interface OrderFilter { } export interface OrderPlacement { - lots : number - gapFactor : number + lots: number + gapFactor: number } export interface BasicMarketMakingCfg { @@ -768,7 +769,7 @@ export interface Stances { treasuryKeys: TKeyPolicyResult[] } -export interface TicketStats{ +export interface TicketStats { totalRewards: number ticketCount: number votes: number @@ -813,7 +814,7 @@ export interface Application { fiatRatesMap: Record showPopups: boolean commitHash: string - authed(): boolean + authed (): boolean start (): Promise reconnected (): void fetchUser (): Promise