vsp

package
v0.0.0-...-96115ed Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: ISC Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using slog.

Types

type DialFunc

type DialFunc func(ctx context.Context, network, addr string) (net.Conn, error)

type FeeAddressRequest

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

type FeeAddressResponse

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

type PayFeeRequest

type PayFeeRequest struct {
	Timestamp   int64             `json:"timestamp"`
	TicketHash  string            `json:"tickethash"`
	FeeTx       string            `json:"feetx"`
	VotingKey   string            `json:"votingkey" `
	VoteChoices map[string]string `json:"votechoices" `
}

type PendingFee

type PendingFee struct {
	CommitmentAddress dcrutil.Address
	VotingAddress     dcrutil.Address
	FeeAddress        dcrutil.Address
	FeeAmount         dcrutil.Amount
	FeeTx             *wire.MsgTx
}

type QueueEntry

type QueueEntry struct {
	TicketHash *chainhash.Hash
	FeeTx      *wire.MsgTx
}

type TicketStatusRequest

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

type TicketStatusResponse

type TicketStatusResponse struct {
	Timestamp       int64               `json:"timestamp"`
	TicketConfirmed bool                `json:"ticketconfirmed"`
	FeeTxStatus     string              `json:"feetxstatus"`
	FeeTxHash       string              `json:"feetxhash"`
	VoteChoices     map[string]string   `json:"votechoices"`
	Request         TicketStatusRequest `json:"request"`
}

type VSP

type VSP struct {
	// contains filtered or unexported fields
}

func New

func New(hostname, pubKeyStr string, purchaseAccount, changeAccount uint32, dialer DialFunc, w *wallet.Wallet, params *chaincfg.Params) (*VSP, error)

func (*VSP) CreateFeeTx

func (v *VSP) CreateFeeTx(ctx context.Context, ticketHash *chainhash.Hash, credits []wallet.Input) (*wire.MsgTx, error)

func (*VSP) GetFeeAddress

func (v *VSP) GetFeeAddress(ctx context.Context, ticketHash *chainhash.Hash) (dcrutil.Amount, error)

func (*VSP) PayFee

func (v *VSP) PayFee(ctx context.Context, ticketHash *chainhash.Hash, feeTx *wire.MsgTx) (*wire.MsgTx, error)

func (*VSP) PoolFee

func (v *VSP) PoolFee(ctx context.Context) (float64, error)

func (*VSP) Process

func (v *VSP) Process(ctx context.Context, queuedItem *QueueEntry) (*chainhash.Hash, error)

func (*VSP) Queue

func (v *VSP) Queue(ctx context.Context, ticketHash chainhash.Hash, feeTx *wire.MsgTx)

func (*VSP) Sync

func (v *VSP) Sync(ctx context.Context)

func (*VSP) TicketStatus

func (v *VSP) TicketStatus(ctx context.Context, hash *chainhash.Hash) (*TicketStatusResponse, error)

Jump to

Keyboard shortcuts

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