diff --git a/client/webserver/live_test.go b/client/webserver/live_test.go index 6b3de8b132..5552857a4c 100644 --- a/client/webserver/live_test.go +++ b/client/webserver/live_test.go @@ -1982,7 +1982,19 @@ func (c *TCore) ApproveTokenFee(assetID uint32, version uint32, approval bool) ( } func (c *TCore) StakeStatus(assetID uint32) (*asset.TicketStakingStatus, error) { - return nil, nil + res := asset.TicketStakingStatus{ + TicketPrice: 24000000000, + VotingSubsidy: 1200000, + VSP: "", + IsRPC: false, + Tickets: []*asset.Ticket{}, + Stances: asset.Stances{ + Agendas: []*asset.TBAgenda{}, + TreasurySpends: []*asset.TBTreasurySpend{}, + }, + Stats: asset.TicketStats{}, + } + return &res, nil } func (c *TCore) SetVSP(assetID uint32, addr string) error { @@ -1998,7 +2010,14 @@ func (c *TCore) SetVotingPreferences(assetID uint32, choices, tSpendPolicy, trea } func (c *TCore) ListVSPs(assetID uint32) ([]*asset.VotingServiceProvider, error) { - return nil, nil + vsps := []*asset.VotingServiceProvider{ + { + URL: "https://example.com", + FeePercentage: 0.1, + Voting: 12345, + }, + } + return vsps, nil } func (c *TCore) TicketPage(assetID uint32, scanStart int32, n, skipN int) ([]*asset.Ticket, error) { diff --git a/client/webserver/site/src/html/bodybuilder.tmpl b/client/webserver/site/src/html/bodybuilder.tmpl index ea413e7cc6..c23b7dfc7d 100644 --- a/client/webserver/site/src/html/bodybuilder.tmpl +++ b/client/webserver/site/src/html/bodybuilder.tmpl @@ -103,7 +103,7 @@ {{end}} {{define "bottom"}} - + {{end}} diff --git a/client/webserver/site/src/html/wallets.tmpl b/client/webserver/site/src/html/wallets.tmpl index fba58bb7b3..a5b03064e4 100644 --- a/client/webserver/site/src/html/wallets.tmpl +++ b/client/webserver/site/src/html/wallets.tmpl @@ -697,6 +697,9 @@ {{- /* PICK A VOTING SERVICE PROVIDER */ -}}
+
+ +
Select a Voting Service Provider

@@ -714,7 +717,25 @@ -
{{/* TODO: ADD MANUAL INPUT */}} + +

+ +

+
+ +
+ +
+
{{- /* PURCHASE TICKETS */ -}} diff --git a/client/webserver/site/src/js/wallets.ts b/client/webserver/site/src/js/wallets.ts index 6df9de4512..5cd169f8ad 100644 --- a/client/webserver/site/src/js/wallets.ts +++ b/client/webserver/site/src/js/wallets.ts @@ -219,6 +219,7 @@ export default class WalletsPage extends BasePage { Doc.bind(page.unapproveTokenSubmit, 'click', async () => { this.submitUnapproveTokenAllowance() }) Doc.bind(page.showVSPs, 'click', () => { this.showVSPPicker() }) Doc.bind(page.vspDisplay, 'click', () => { this.showVSPPicker() }) + bindForm(page.vspPicker, page.customVspSubmit, async () => { this.setCustomVSP() }) Doc.bind(page.purchaseTicketsBttn, 'click', () => { this.showPurchaseTicketsDialog() }) bindForm(page.purchaseTicketsForm, page.purchaserSubmit, () => { this.purchaseTickets() }) Doc.bind(page.purchaserInput, 'change', () => { this.purchaserInputChanged() }) @@ -1029,6 +1030,12 @@ export default class WalletsPage extends BasePage { this.setVSPViz(vsp.url) } + async setCustomVSP () { + const assetID = this.selectedAssetID + const vsp = { url: this.page.customVspUrl.value } as VotingServiceProvider + this.setVSP(assetID, vsp) + } + pageOfTickets (pgNum: number) { const { stakeStatus, ticketPage } = this let startOffset = pgNum * ticketPageSize