types

package module
v3.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2024 License: ISC Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode int64

ErrorCode is an integer which represents a kind of error which may be encountered by vspd.

const (
	ErrBadRequest ErrorCode = iota
	ErrInternalError
	ErrVspClosed
	ErrFeeAlreadyReceived
	ErrInvalidFeeTx
	ErrFeeTooSmall
	ErrUnknownTicket
	ErrTicketCannotVote
	ErrFeeExpired
	ErrInvalidVoteChoices
	ErrBadSignature
	ErrInvalidPrivKey
	ErrFeeNotReceived
	ErrInvalidTicket
	ErrCannotBroadcastTicket
	ErrCannotBroadcastFee
	ErrCannotBroadcastFeeUnknownOutputs
	ErrInvalidTimestamp
)

func (ErrorCode) DefaultMessage

func (e ErrorCode) DefaultMessage() string

DefaultMessage returns a descriptive error string for a given error code.

func (ErrorCode) HTTPStatus

func (e ErrorCode) HTTPStatus() int

HTTPStatus returns a corresponding HTTP status code for a given error code.

type ErrorResponse

type ErrorResponse struct {
	Code    ErrorCode `json:"code"`
	Message string    `json:"message"`
}

func (ErrorResponse) Error

func (e ErrorResponse) Error() string

type FeeAddressRequest

type FeeAddressRequest struct {
	Timestamp  int64  `json:"timestamp" binding:"required"`
	TicketHash string `json:"tickethash" binding:"required"`
	TicketHex  string `json:"tickethex" binding:"required"`
	ParentHex  string `json:"parenthex" binding:"required"`
}

type FeeAddressResponse

type FeeAddressResponse struct {
	Timestamp  int64  `json:"timestamp"`
	FeeAddress string `json:"feeaddress"`
	FeeAmount  int64  `json:"feeamount"`
	Expiration int64  `json:"expiration"`
	Request    []byte `json:"request"`
}

type PayFeeRequest

type PayFeeRequest struct {
	Timestamp      int64             `json:"timestamp" binding:"required"`
	TicketHash     string            `json:"tickethash" binding:"required"`
	FeeTx          string            `json:"feetx" binding:"required"`
	VotingKey      string            `json:"votingkey" binding:"required"`
	VoteChoices    map[string]string `json:"votechoices" binding:"required"`
	TSpendPolicy   map[string]string `json:"tspendpolicy" binding:"max=3"`
	TreasuryPolicy map[string]string `json:"treasurypolicy" binding:"max=3"`
}

type PayFeeResponse

type PayFeeResponse struct {
	Timestamp int64  `json:"timestamp"`
	Request   []byte `json:"request"`
}

type SetAltSignAddrRequest

type SetAltSignAddrRequest struct {
	Timestamp      int64  `json:"timestamp" binding:"required"`
	TicketHash     string `json:"tickethash" binding:"required"`
	TicketHex      string `json:"tickethex" binding:"required"`
	ParentHex      string `json:"parenthex" binding:"required"`
	AltSignAddress string `json:"altsignaddress" binding:"required"`
}

type SetAltSignAddrResponse

type SetAltSignAddrResponse struct {
	Timestamp int64  `json:"timestamp"`
	Request   []byte `json:"request"`
}

type SetVoteChoicesRequest

type SetVoteChoicesRequest struct {
	Timestamp      int64             `json:"timestamp" binding:"required"`
	TicketHash     string            `json:"tickethash" binding:"required"`
	VoteChoices    map[string]string `json:"votechoices" binding:"required"`
	TSpendPolicy   map[string]string `json:"tspendpolicy" binding:"max=3"`
	TreasuryPolicy map[string]string `json:"treasurypolicy" binding:"max=3"`
}

type SetVoteChoicesResponse

type SetVoteChoicesResponse struct {
	Timestamp int64  `json:"timestamp"`
	Request   []byte `json:"request"`
}

type TicketStatusRequest

type TicketStatusRequest struct {
	TicketHash string `json:"tickethash" binding:"required"`
}

type TicketStatusResponse

type TicketStatusResponse struct {
	Timestamp       int64             `json:"timestamp"`
	TicketConfirmed bool              `json:"ticketconfirmed"`
	FeeTxStatus     string            `json:"feetxstatus"`
	FeeTxHash       string            `json:"feetxhash"`
	AltSignAddress  string            `json:"altsignaddress"`
	VoteChoices     map[string]string `json:"votechoices"`
	TSpendPolicy    map[string]string `json:"tspendpolicy"`
	TreasuryPolicy  map[string]string `json:"treasurypolicy"`
	Request         []byte            `json:"request"`
}

type VspInfoResponse

type VspInfoResponse struct {
	APIVersions         []int64 `json:"apiversions"`
	Timestamp           int64   `json:"timestamp"`
	PubKey              []byte  `json:"pubkey"`
	FeePercentage       float64 `json:"feepercentage"`
	VspClosed           bool    `json:"vspclosed"`
	VspClosedMsg        string  `json:"vspclosedmsg"`
	Network             string  `json:"network"`
	VspdVersion         string  `json:"vspdversion"`
	Voting              int64   `json:"voting"`
	Voted               int64   `json:"voted"`
	TotalVotingWallets  int64   `json:"totalvotingwallets"`
	VotingWalletsOnline int64   `json:"votingwalletsonline"`
	Expired             int64   `json:"expired"`
	Missed              int64   `json:"missed"`
	BlockHeight         uint32  `json:"blockheight"`
	NetworkProportion   float32 `json:"estimatednetworkproportion"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL