github.com/decred/politeia@v1.4.0/politeiawww/cmd/pictl/userproposalcredits.go (about) 1 // Copyright (c) 2020 The Decred developers 2 // Use of this source code is governed by an ISC 3 // license that can be found in the LICENSE file. 4 5 package main 6 7 import "github.com/decred/politeia/politeiawww/cmd/shared" 8 9 // userProposalCreditsCmd gets the proposal credits for the logged in user. 10 type userProposalCreditsCmd struct{} 11 12 // Execute executes the userProposalCreditsCmd command. 13 // 14 // This function satisfies the go-flags Commander interface. 15 func (cmd *userProposalCreditsCmd) Execute(args []string) error { 16 ppdr, err := client.UserProposalCredits() 17 if err != nil { 18 return err 19 } 20 return shared.PrintJSON(ppdr) 21 } 22 23 // userProposalCreditsHelpMsg is the output of the help command when 24 // 'userproposalcredits' is specified. 25 const userProposalCreditsHelpMsg = `userproposalcredits 26 27 Fetch the logged in user's proposal credits. 28 29 Arguments: None`