types

package module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: ISC Imports: 2 Imported by: 8

README

jsonrpc/types

Build Status ISC License GoDoc

Package types implements concrete types for marshalling to and from the dcrwallet JSON-RPC API. A comprehensive suite of tests is provided to ensure proper functionality.

The provided types are automatically registered with dcrjson when the package is imported. Although this package was primarily written for dcrwallet, it has intentionally been designed so it can be used as a standalone package for any projects needing to marshal to and from dcrwallet JSON-RPC requests and responses.

Note that although it's possible to use this package directly to implement an RPC client, it is not recommended since it is only intended as an infrastructure package. Instead, RPC clients should use the rpcclient package which provides a full blown RPC client with many features such as automatic connection management, websocket support, automatic notification re-registration on reconnect, and conversion from the raw underlying RPC types (strings, floats, ints, etc) to higher-level types with many nice and useful properties.

Installation and Updating

$ go get -u github.com/decred/dcrwallet/rpc/jsonrpc/types

License

Package types is licensed under the copyfree ISC License.

Documentation

Overview

Package types implements concrete types for the dcrwallet JSON-RPC API.

Overview

When communicating via the JSON-RPC protocol, all of the commands need to be marshalled to and from the the wire in the appropriate format. This package provides data structures and primitives that are registered with dcrjson to ease this process. An overview specific to this package is provided here, however it is also instructive to read the documentation for the dcrjson package (https://godoc.org/github.com/decred/dcrd/dcrjson).

Marshalling and Unmarshalling

The types in this package map to the required parts of the protocol as discussed in the dcrjson documention

  • Request Objects (type Request)
  • Commands (type <Foo>Cmd)
  • Notifications (type <Foo>Ntfn)
  • Response Objects (type Response)
  • Result (type <Foo>Result)

To simplify the marshalling of the requests and responses, the dcrjson.MarshalCmd and dcrjson.MarshalResponse functions may be used. They return the raw bytes ready to be sent across the wire.

Unmarshalling a received Request object is a two step process:

  1. Unmarshal the raw bytes into a Request struct instance via json.Unmarshal
  2. Use UnmarshalCmd on the Result field of the unmarshalled Request to create a concrete command or notification instance with all struct fields set accordingly

This approach is used since it provides the caller with access to the additional fields in the request that are not part of the command such as the ID.

Unmarshalling a received Response object is also a two step process:

  1. Unmarshal the raw bytes into a Response struct instance via json.Unmarshal
  2. Depending on the ID, unmarshal the Result field of the unmarshalled Response to create a concrete type instance

As above, this approach is used since it provides the caller with access to the fields in the response such as the ID and Error.

Command Creation

This package provides two approaches for creating a new command. This first, and preferred, method is to use one of the New<Foo>Cmd functions. This allows static compile-time checking to help ensure the parameters stay in sync with the struct definitions.

The second approach is the dcrjson.NewCmd function which takes a method (command) name and variable arguments. Since this package registers all of its types with dcrjson, the function will recognize them and includes full checking to ensure the parameters are accurate according to provided method, however these checks are, obviously, run-time which means any mistakes won't be found until the code is actually executed. However, it is quite useful for user-supplied commands that are intentionally dynamic.

Help Generation

To facilitate providing consistent help to users of the RPC server, the dcrjson package exposes the GenerateHelp and function which uses reflection on commands and notifications registered by this package, as well as the provided expected result types, to generate the final help text.

In addition, the dcrjson.MethodUsageText function may be used to generate consistent one-line usage for registered commands and notifications using reflection.

Index

Constants

View Source
const (
	// AccountBalanceNtfnMethod is the method used for account balance
	// notifications.
	//
	// Deprecated: dcrwallet does not provide JSON-RPC notifications
	AccountBalanceNtfnMethod = "accountbalance"

	// DcrdConnectedNtfnMethod is the method used for notifications when
	// a wallet server is connected to a chain server.
	//
	// Deprecated: dcrwallet does not provide JSON-RPC notifications
	DcrdConnectedNtfnMethod = "dcrdconnected"

	// NewTicketsNtfnMethod is the method of the daemon
	// newtickets notification.
	//
	// Deprecated: dcrwallet does not provide JSON-RPC notifications
	NewTicketsNtfnMethod = "newtickets"

	// NewTxNtfnMethod is the method used to notify that a wallet server has
	// added a new transaction to the transaction store.
	//
	// Deprecated: dcrwallet does not provide JSON-RPC notifications
	NewTxNtfnMethod = "newtx"

	// RevocationCreatedNtfnMethod is the method of the dcrwallet
	// revocationcreated notification.
	//
	// Deprecated: dcrwallet does not provide JSON-RPC notifications
	RevocationCreatedNtfnMethod = "revocationcreated"

	// TicketPurchasedNtfnMethod is the method of the dcrwallet
	// ticketpurchased notification.
	//
	// Deprecated: dcrwallet does not provide JSON-RPC notifications
	TicketPurchasedNtfnMethod = "ticketpurchased"

	// VoteCreatedNtfnMethod is the method of the dcrwallet
	// votecreated notification.
	//
	// Deprecated: dcrwallet does not provide JSON-RPC notifications
	VoteCreatedNtfnMethod = "votecreated"

	// WinningTicketsNtfnMethod is the method of the daemon
	// winningtickets notification.
	//
	// Deprecated: dcrwallet does not provide JSON-RPC notifications
	WinningTicketsNtfnMethod = "winningtickets"

	// WalletLockStateNtfnMethod is the method used to notify the lock state
	// of a wallet has changed.
	//
	// Deprecated: dcrwallet does not provide JSON-RPC notifications
	WalletLockStateNtfnMethod = "walletlockstate"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AbandonTransactionCmd added in v1.3.0

type AbandonTransactionCmd struct {
	Hash string `json:"hash"`
}

AbandonTransactionCmd describes the command and parameters for performing the abandontransaction method.

type AccountAddressIndexCmd

type AccountAddressIndexCmd struct {
	Account string `json:"account"`
	Branch  int    `json:"branch"`
}

AccountAddressIndexCmd is a type handling custom marshaling and unmarshaling of accountaddressindex JSON wallet extension commands.

func NewAccountAddressIndexCmd

func NewAccountAddressIndexCmd(acct string, branch int) *AccountAddressIndexCmd

NewAccountAddressIndexCmd creates a new AccountAddressIndexCmd.

type AccountBalanceNtfn deprecated

type AccountBalanceNtfn struct {
	Account   string
	Balance   float64 // In DCR
	Confirmed bool    // Whether Balance is confirmed or unconfirmed.
}

AccountBalanceNtfn defines the accountbalance JSON-RPC notification.

Deprecated: dcrwallet does not provide JSON-RPC notifications

func NewAccountBalanceNtfn deprecated

func NewAccountBalanceNtfn(account string, balance float64, confirmed bool) *AccountBalanceNtfn

NewAccountBalanceNtfn returns a new instance which can be used to issue an accountbalance JSON-RPC notification.

Deprecated: dcrwallet does not provide JSON-RPC notifications

type AccountSyncAddressIndexCmd

type AccountSyncAddressIndexCmd struct {
	Account string `json:"account"`
	Branch  int    `json:"branch"`
	Index   int    `json:"index"`
}

AccountSyncAddressIndexCmd is a type handling custom marshaling and unmarshaling of accountsyncaddressindex JSON wallet extension commands.

func NewAccountSyncAddressIndexCmd

func NewAccountSyncAddressIndexCmd(acct string, branch int,
	idx int) *AccountSyncAddressIndexCmd

NewAccountSyncAddressIndexCmd creates a new AccountSyncAddressIndexCmd.

type AddMultisigAddressCmd

type AddMultisigAddressCmd struct {
	NRequired int
	Keys      []string
	Account   *string
}

AddMultisigAddressCmd defines the addmutisigaddress JSON-RPC command.

func NewAddMultisigAddressCmd

func NewAddMultisigAddressCmd(nRequired int, keys []string, account *string) *AddMultisigAddressCmd

NewAddMultisigAddressCmd returns a new instance which can be used to issue a addmultisigaddress JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type AddTicketCmd

type AddTicketCmd struct {
	TicketHex string `json:"tickethex"`
}

AddTicketCmd forces a ticket into the wallet stake manager, for example if someone made an invalid ticket for a stake pool and the pool manager wanted to manually add it.

func NewAddTicketCmd

func NewAddTicketCmd(ticketHex string) *AddTicketCmd

NewAddTicketCmd creates a new AddTicketCmd.

type AuditReuseCmd added in v1.4.0

type AuditReuseCmd struct {
	Since *int32 `json:"since"`
}

AuditReuseCmd defines the auditreuse JSON-RPC command.

This method returns an object keying reused addresses to two or more outputs referencing them, optionally filtering results of address reusage since a particular block height.

type ConsolidateCmd

type ConsolidateCmd struct {
	Inputs  int `json:"inputs"`
	Account *string
	Address *string
}

ConsolidateCmd is a type handling custom marshaling and unmarshaling of consolidate JSON wallet extension commands.

func NewConsolidateCmd

func NewConsolidateCmd(inputs int, acct *string, addr *string) *ConsolidateCmd

NewConsolidateCmd creates a new ConsolidateCmd.

type CreateEncryptedWalletCmd deprecated

type CreateEncryptedWalletCmd struct {
	Passphrase string
}

CreateEncryptedWalletCmd defines the createencryptedwallet JSON-RPC command.

Deprecated: This method is not implemented by the RPC server.

func NewCreateEncryptedWalletCmd deprecated

func NewCreateEncryptedWalletCmd(passphrase string) *CreateEncryptedWalletCmd

NewCreateEncryptedWalletCmd returns a new instance which can be used to issue a createencryptedwallet JSON-RPC command.

Deprecated: This method is not implemented by the RPC server.

type CreateMultiSigResult

type CreateMultiSigResult struct {
	Address      string `json:"address"`
	RedeemScript string `json:"redeemScript"`
}

CreateMultiSigResult models the data returned from the createmultisig command.

type CreateMultisigCmd

type CreateMultisigCmd struct {
	NRequired int
	Keys      []string
}

CreateMultisigCmd defines the createmultisig JSON-RPC command.

func NewCreateMultisigCmd

func NewCreateMultisigCmd(nRequired int, keys []string) *CreateMultisigCmd

NewCreateMultisigCmd returns a new instance which can be used to issue a createmultisig JSON-RPC command.

type CreateNewAccountCmd

type CreateNewAccountCmd struct {
	Account string
}

CreateNewAccountCmd defines the createnewaccount JSON-RPC command.

func NewCreateNewAccountCmd

func NewCreateNewAccountCmd(account string) *CreateNewAccountCmd

NewCreateNewAccountCmd returns a new instance which can be used to issue a createnewaccount JSON-RPC command.

type CreateVotingAccountCmd

type CreateVotingAccountCmd struct {
	Name       string
	PubKey     string
	ChildIndex *uint32 `jsonrpcdefault:"0"`
}

CreateVotingAccountCmd is a type for handling custom marshaling and unmarshalling of createvotingaccount JSON-RPC command.

func NewCreateVotingAccountCmd

func NewCreateVotingAccountCmd(name, pubKey string, childIndex *uint32) *CreateVotingAccountCmd

NewCreateVotingAccountCmd creates a new CreateVotingAccountCmd.

type DcrdConnectedNtfn deprecated

type DcrdConnectedNtfn struct {
	Connected bool
}

DcrdConnectedNtfn defines the dcrddconnected JSON-RPC notification.

Deprecated: dcrwallet does not provide JSON-RPC notifications

func NewDcrdConnectedNtfn deprecated

func NewDcrdConnectedNtfn(connected bool) *DcrdConnectedNtfn

NewDcrdConnectedNtfn returns a new instance which can be used to issue a dcrddconnected JSON-RPC notification.

Deprecated: dcrwallet does not provide JSON-RPC notifications

type DropVotingAccountCmd

type DropVotingAccountCmd struct {
}

DropVotingAccountCmd is a type for handling custom marshaling and unmarshalling of dropvotingaccount JSON-RPC command

func NewDropVotingAccountCmd

func NewDropVotingAccountCmd() *DropVotingAccountCmd

NewDropVotingAccountCmd creates a new DropVotingAccountCmd.

type DumpPrivKeyCmd

type DumpPrivKeyCmd struct {
	Address string
}

DumpPrivKeyCmd defines the dumpprivkey JSON-RPC command.

func NewDumpPrivKeyCmd

func NewDumpPrivKeyCmd(address string) *DumpPrivKeyCmd

NewDumpPrivKeyCmd returns a new instance which can be used to issue a dumpprivkey JSON-RPC command.

type EstimatePriorityCmd deprecated

type EstimatePriorityCmd struct {
	NumBlocks int64
}

EstimatePriorityCmd defines the estimatepriority JSON-RPC command.

Deprecated: This method is not implemented by the RPC server.

func NewEstimatePriorityCmd deprecated

func NewEstimatePriorityCmd(numBlocks int64) *EstimatePriorityCmd

NewEstimatePriorityCmd returns a new instance which can be used to issue a estimatepriority JSON-RPC command.

Deprecated: This method is not implemented by the RPC server.

type ExportWatchingWalletCmd deprecated

type ExportWatchingWalletCmd struct {
	Account  *string
	Download *bool `jsonrpcdefault:"false"`
}

ExportWatchingWalletCmd defines the exportwatchingwallet JSON-RPC command.

Deprecated: This method is not implemented by the RPC server.

func NewExportWatchingWalletCmd deprecated

func NewExportWatchingWalletCmd(account *string, download *bool) *ExportWatchingWalletCmd

NewExportWatchingWalletCmd returns a new instance which can be used to issue a exportwatchingwallet JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

Deprecated: This method is not implemented by the RPC server.

type FundRawTransactionCmd

type FundRawTransactionCmd struct {
	HexString   string
	FundAccount string
	Options     *FundRawTransactionOptions
}

FundRawTransactionCmd is a type handling custom marshaling and unmarshaling of fundrawtransaction JSON wallet extension commands.

func NewFundRawTransactionCmd

func NewFundRawTransactionCmd(hexString string, fundAccount string, options *FundRawTransactionOptions) *FundRawTransactionCmd

NewFundRawTransactionCmd returns a new instance which can be used to issue a fundrawtransaction JSON-RPC command.

type FundRawTransactionOptions

type FundRawTransactionOptions struct {
	ChangeAddress *string  `json:"changeaddress"`
	FeeRate       *float64 `json:"feerate"`
	ConfTarget    *int32   `json:"conf_target"`
}

FundRawTransactionOptions represents the optional inputs to fund a raw transaction.

type FundRawTransactionResult

type FundRawTransactionResult struct {
	Hex string  `json:"hex"`
	Fee float64 `json:"fee"`
}

FundRawTransactionResult models the data from the fundrawtransaction command.

type GenerateVoteCmd

type GenerateVoteCmd struct {
	BlockHash   string
	Height      int64
	TicketHash  string
	VoteBits    uint16
	VoteBitsExt string
}

GenerateVoteCmd is a type handling custom marshaling and unmarshaling of generatevote JSON wallet extension commands.

func NewGenerateVoteCmd

func NewGenerateVoteCmd(blockhash string, height int64, tickethash string, votebits uint16, voteBitsExt string) *GenerateVoteCmd

NewGenerateVoteCmd creates a new GenerateVoteCmd.

type GenerateVoteResult

type GenerateVoteResult struct {
	Hex string `json:"hex"`
}

GenerateVoteResult models the data from the generatevote command.

type GetAccountAddressCmd

type GetAccountAddressCmd struct {
	Account string
}

GetAccountAddressCmd defines the getaccountaddress JSON-RPC command.

func NewGetAccountAddressCmd

func NewGetAccountAddressCmd(account string) *GetAccountAddressCmd

NewGetAccountAddressCmd returns a new instance which can be used to issue a getaccountaddress JSON-RPC command.

type GetAccountBalanceResult

type GetAccountBalanceResult struct {
	AccountName             string  `json:"accountname"`
	ImmatureCoinbaseRewards float64 `json:"immaturecoinbaserewards"`
	ImmatureStakeGeneration float64 `json:"immaturestakegeneration"`
	LockedByTickets         float64 `json:"lockedbytickets"`
	Spendable               float64 `json:"spendable"`
	Total                   float64 `json:"total"`
	Unconfirmed             float64 `json:"unconfirmed"`
	VotingAuthority         float64 `json:"votingauthority"`
}

GetAccountBalanceResult models the account data from the getbalance command.

type GetAccountCmd

type GetAccountCmd struct {
	Address string
}

GetAccountCmd defines the getaccount JSON-RPC command.

func NewGetAccountCmd

func NewGetAccountCmd(address string) *GetAccountCmd

NewGetAccountCmd returns a new instance which can be used to issue a getaccount JSON-RPC command.

type GetAddressesByAccountCmd

type GetAddressesByAccountCmd struct {
	Account string
}

GetAddressesByAccountCmd defines the getaddressesbyaccount JSON-RPC command.

func NewGetAddressesByAccountCmd

func NewGetAddressesByAccountCmd(account string) *GetAddressesByAccountCmd

NewGetAddressesByAccountCmd returns a new instance which can be used to issue a getaddressesbyaccount JSON-RPC command.

type GetBalanceCmd

type GetBalanceCmd struct {
	Account *string
	MinConf *int `jsonrpcdefault:"1"`
}

GetBalanceCmd defines the getbalance JSON-RPC command.

func NewGetBalanceCmd

func NewGetBalanceCmd(account *string, minConf *int) *GetBalanceCmd

NewGetBalanceCmd returns a new instance which can be used to issue a getbalance JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type GetBalanceResult

type GetBalanceResult struct {
	Balances                     []GetAccountBalanceResult `json:"balances"`
	BlockHash                    string                    `json:"blockhash"`
	TotalImmatureCoinbaseRewards float64                   `json:"totalimmaturecoinbaserewards,omitempty"`
	TotalImmatureStakeGeneration float64                   `json:"totalimmaturestakegeneration,omitempty"`
	TotalLockedByTickets         float64                   `json:"totallockedbytickets,omitempty"`
	TotalSpendable               float64                   `json:"totalspendable,omitempty"`
	CumulativeTotal              float64                   `json:"cumulativetotal,omitempty"`
	TotalUnconfirmed             float64                   `json:"totalunconfirmed,omitempty"`
	TotalVotingAuthority         float64                   `json:"totalvotingauthority,omitempty"`
}

GetBalanceResult models the data from the getbalance command.

type GetContractHashCmd

type GetContractHashCmd struct {
	FilePath []string
}

GetContractHashCmd defines the getcontracthash JSON-RPC command.

func NewGetContractHashCmd

func NewGetContractHashCmd(filepaths []string) *GetContractHashCmd

NewGetContractHashCmd returns a new instance which can be used to issue a getcontracthash JSON-RPC command.

type GetContractHashResult

type GetContractHashResult struct {
	ContractHash string `json:"contracthash"`
}

GetContractHashResult models the data from the getcontracthash command.

type GetMasterPubkeyCmd

type GetMasterPubkeyCmd struct {
	Account *string
}

GetMasterPubkeyCmd is a type handling custom marshaling and unmarshaling of getmasterpubkey JSON wallet extension commands.

func NewGetMasterPubkeyCmd

func NewGetMasterPubkeyCmd(acct *string) *GetMasterPubkeyCmd

NewGetMasterPubkeyCmd creates a new GetMasterPubkeyCmd.

type GetMultisigOutInfoCmd

type GetMultisigOutInfoCmd struct {
	Hash  string
	Index uint32
}

GetMultisigOutInfoCmd is a type handling custom marshaling and unmarshaling of getmultisigoutinfo JSON websocket extension commands.

func NewGetMultisigOutInfoCmd

func NewGetMultisigOutInfoCmd(hash string, index uint32) *GetMultisigOutInfoCmd

NewGetMultisigOutInfoCmd creates a new GetMultisigOutInfoCmd.

type GetMultisigOutInfoResult

type GetMultisigOutInfoResult struct {
	Address      string   `json:"address"`
	RedeemScript string   `json:"redeemscript"`
	M            uint8    `json:"m"`
	N            uint8    `json:"n"`
	Pubkeys      []string `json:"pubkeys"`
	TxHash       string   `json:"txhash"`
	BlockHeight  uint32   `json:"blockheight"`
	BlockHash    string   `json:"blockhash"`
	Spent        bool     `json:"spent"`
	SpentBy      string   `json:"spentby"`
	SpentByIndex uint32   `json:"spentbyindex"`
	Amount       float64  `json:"amount"`
}

GetMultisigOutInfoResult models the data returned from the getmultisigoutinfo command.

type GetNewAddressCmd

type GetNewAddressCmd struct {
	Account   *string
	GapPolicy *string
}

GetNewAddressCmd defines the getnewaddress JSON-RPC command.

func NewGetNewAddressCmd

func NewGetNewAddressCmd(account *string, gapPolicy *string) *GetNewAddressCmd

NewGetNewAddressCmd returns a new instance which can be used to issue a getnewaddress JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type GetPayToContractAddressCmd

type GetPayToContractAddressCmd struct {
	FilePath []string
}

GetPayToContractAddressCmd defines the getpaytocontracthash JSON-RPC command.

func NewGetPayToContractAddressCmd

func NewGetPayToContractAddressCmd(filepaths []string) *GetPayToContractAddressCmd

NewGetPayToContractAddressCmd returns a new instance which can be used to issue a getpaytocontractaddress JSON-RPC command.

type GetPayToContractHashResult

type GetPayToContractHashResult struct {
	Address string `json:"address"`
}

GetPayToContractHashResult models the data returned from the getpaytocontracthash command.

type GetRawChangeAddressCmd

type GetRawChangeAddressCmd struct {
	Account *string
}

GetRawChangeAddressCmd defines the getrawchangeaddress JSON-RPC command.

func NewGetRawChangeAddressCmd

func NewGetRawChangeAddressCmd(account *string) *GetRawChangeAddressCmd

NewGetRawChangeAddressCmd returns a new instance which can be used to issue a getrawchangeaddress JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type GetReceivedByAccountCmd

type GetReceivedByAccountCmd struct {
	Account string
	MinConf *int `jsonrpcdefault:"1"`
}

GetReceivedByAccountCmd defines the getreceivedbyaccount JSON-RPC command.

func NewGetReceivedByAccountCmd

func NewGetReceivedByAccountCmd(account string, minConf *int) *GetReceivedByAccountCmd

NewGetReceivedByAccountCmd returns a new instance which can be used to issue a getreceivedbyaccount JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type GetReceivedByAddressCmd

type GetReceivedByAddressCmd struct {
	Address string
	MinConf *int `jsonrpcdefault:"1"`
}

GetReceivedByAddressCmd defines the getreceivedbyaddress JSON-RPC command.

func NewGetReceivedByAddressCmd

func NewGetReceivedByAddressCmd(address string, minConf *int) *GetReceivedByAddressCmd

NewGetReceivedByAddressCmd returns a new instance which can be used to issue a getreceivedbyaddress JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type GetStakeInfoCmd

type GetStakeInfoCmd struct {
}

GetStakeInfoCmd is a type handling custom marshaling and unmarshaling of getstakeinfo JSON wallet extension commands.

func NewGetStakeInfoCmd

func NewGetStakeInfoCmd() *GetStakeInfoCmd

NewGetStakeInfoCmd creates a new GetStakeInfoCmd.

type GetStakeInfoResult

type GetStakeInfoResult struct {
	BlockHeight  int64   `json:"blockheight"`
	Difficulty   float64 `json:"difficulty"`
	TotalSubsidy float64 `json:"totalsubsidy"`

	OwnMempoolTix  uint32 `json:"ownmempooltix"`
	Immature       uint32 `json:"immature"`
	Unspent        uint32 `json:"unspent"`
	Voted          uint32 `json:"voted"`
	Revoked        uint32 `json:"revoked"`
	UnspentExpired uint32 `json:"unspentexpired"`

	// Not available to SPV wallets
	PoolSize         uint32  `json:"poolsize,omitempty"`
	AllMempoolTix    uint32  `json:"allmempooltix,omitempty"`
	Live             uint32  `json:"live,omitempty"`
	ProportionLive   float64 `json:"proportionlive,omitempty"`
	Missed           uint32  `json:"missed,omitempty"`
	ProportionMissed float64 `json:"proportionmissed,omitempty"`
	Expired          uint32  `json:"expired,omitempty"`
}

GetStakeInfoResult models the data returned from the getstakeinfo command.

type GetTicketFeeCmd

type GetTicketFeeCmd struct {
}

GetTicketFeeCmd is a type handling custom marshaling and unmarshaling of getticketfee JSON wallet extension commands.

func NewGetTicketFeeCmd

func NewGetTicketFeeCmd() *GetTicketFeeCmd

NewGetTicketFeeCmd creates a new GetTicketFeeCmd.

type GetTicketsCmd

type GetTicketsCmd struct {
	IncludeImmature bool
}

GetTicketsCmd is a type handling custom marshaling and unmarshaling of gettickets JSON wallet extension commands.

func NewGetTicketsCmd

func NewGetTicketsCmd(includeImmature bool) *GetTicketsCmd

NewGetTicketsCmd returns a new instance which can be used to issue a gettickets JSON-RPC command.

type GetTicketsResult

type GetTicketsResult struct {
	Hashes []string `json:"hashes"`
}

GetTicketsResult models the data returned from the gettickets command.

type GetTransactionCmd

type GetTransactionCmd struct {
	Txid             string
	IncludeWatchOnly *bool `jsonrpcdefault:"false"`
}

GetTransactionCmd defines the gettransaction JSON-RPC command.

func NewGetTransactionCmd

func NewGetTransactionCmd(txHash string, includeWatchOnly *bool) *GetTransactionCmd

NewGetTransactionCmd returns a new instance which can be used to issue a gettransaction JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type GetTransactionDetailsResult

type GetTransactionDetailsResult struct {
	Account           string   `json:"account"`
	Address           string   `json:"address,omitempty"`
	Amount            float64  `json:"amount"`
	Category          string   `json:"category"`
	InvolvesWatchOnly bool     `json:"involveswatchonly,omitempty"`
	Fee               *float64 `json:"fee,omitempty"`
	Vout              uint32   `json:"vout"`
}

GetTransactionDetailsResult models the details data from the gettransaction command.

This models the "short" version of the ListTransactionsResult type, which excludes fields common to the transaction. These common fields are instead part of the GetTransactionResult.

type GetTransactionResult

type GetTransactionResult struct {
	Amount          float64                       `json:"amount"`
	Fee             float64                       `json:"fee,omitempty"`
	Confirmations   int64                         `json:"confirmations"`
	BlockHash       string                        `json:"blockhash"`
	BlockIndex      int64                         `json:"blockindex"`
	BlockTime       int64                         `json:"blocktime"`
	TxID            string                        `json:"txid"`
	WalletConflicts []string                      `json:"walletconflicts"`
	Time            int64                         `json:"time"`
	TimeReceived    int64                         `json:"timereceived"`
	Details         []GetTransactionDetailsResult `json:"details"`
	Hex             string                        `json:"hex"`
	Type            string                        `json:"type"`
	TicketStatus    string                        `json:"ticketstatus,omitempty"`
}

GetTransactionResult models the data from the gettransaction command.

type GetUnconfirmedBalanceCmd

type GetUnconfirmedBalanceCmd struct {
	Account *string
}

GetUnconfirmedBalanceCmd defines the getunconfirmedbalance JSON-RPC command.

func NewGetUnconfirmedBalanceCmd

func NewGetUnconfirmedBalanceCmd(account *string) *GetUnconfirmedBalanceCmd

NewGetUnconfirmedBalanceCmd returns a new instance which can be used to issue a getunconfirmedbalance JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type GetVoteChoicesCmd

type GetVoteChoicesCmd struct {
}

GetVoteChoicesCmd returns a new instance which can be used to issue a getvotechoices JSON-RPC command.

func NewGetVoteChoicesCmd

func NewGetVoteChoicesCmd() *GetVoteChoicesCmd

NewGetVoteChoicesCmd returns a new instance which can be used to issue a JSON-RPC getvotechoices command.

type GetVoteChoicesResult

type GetVoteChoicesResult struct {
	Version uint32       `json:"version"`
	Choices []VoteChoice `json:"choices"`
}

GetVoteChoicesResult models the data returned by the getvotechoices command.

type GetWalletFeeCmd

type GetWalletFeeCmd struct{}

GetWalletFeeCmd defines the getwalletfee JSON-RPC command.

func NewGetWalletFeeCmd

func NewGetWalletFeeCmd() *GetWalletFeeCmd

NewGetWalletFeeCmd returns a new instance which can be used to issue a getwalletfee JSON-RPC command.

type ImportPrivKeyCmd

type ImportPrivKeyCmd struct {
	PrivKey  string
	Label    *string
	Rescan   *bool `jsonrpcdefault:"true"`
	ScanFrom *int
}

ImportPrivKeyCmd defines the importprivkey JSON-RPC command.

func NewImportPrivKeyCmd

func NewImportPrivKeyCmd(privKey string, label *string, rescan *bool, scanFrom *int) *ImportPrivKeyCmd

NewImportPrivKeyCmd returns a new instance which can be used to issue a importprivkey JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type ImportScriptCmd

type ImportScriptCmd struct {
	Hex      string
	Rescan   *bool `jsonrpcdefault:"true"`
	ScanFrom *int
}

ImportScriptCmd is a type for handling custom marshaling and unmarshaling of importscript JSON wallet extension commands.

func NewImportScriptCmd

func NewImportScriptCmd(hex string, rescan *bool, scanFrom *int) *ImportScriptCmd

NewImportScriptCmd creates a new GetImportScriptCmd.

type ImportXpubCmd added in v1.3.0

type ImportXpubCmd struct {
	Name string `json:"name"`
	Xpub string `json:"xpub"`
}

ImportXpubCmd is a type for handling custom marshaling and unmarshaling of importxpub JSON-RPC commands.

type InfoResult added in v1.1.0

type InfoResult struct {
	Version         int32   `json:"version"`
	ProtocolVersion int32   `json:"protocolversion"`
	WalletVersion   int32   `json:"walletversion"`
	Balance         float64 `json:"balance"`
	Blocks          int32   `json:"blocks"`
	TimeOffset      int64   `json:"timeoffset"`
	Connections     int32   `json:"connections"`
	Proxy           string  `json:"proxy"`
	Difficulty      float64 `json:"difficulty"`
	TestNet         bool    `json:"testnet"`
	KeypoolOldest   int64   `json:"keypoololdest"`
	KeypoolSize     int32   `json:"keypoolsize"`
	UnlockedUntil   int64   `json:"unlocked_until"`
	PaytxFee        float64 `json:"paytxfee"`
	RelayFee        float64 `json:"relayfee"`
	Errors          string  `json:"errors"`
}

InfoResult models the data returned by the wallet server getinfo command.

type InfoWalletResult

type InfoWalletResult = InfoResult

InfoWalletResult aliases InfoResult.

type KeyPoolRefillCmd deprecated

type KeyPoolRefillCmd struct {
	NewSize *uint `jsonrpcdefault:"100"`
}

KeyPoolRefillCmd defines the keypoolrefill JSON-RPC command.

Deprecated: This method is not implemented by the RPC server.

func NewKeyPoolRefillCmd deprecated

func NewKeyPoolRefillCmd(newSize *uint) *KeyPoolRefillCmd

NewKeyPoolRefillCmd returns a new instance which can be used to issue a keypoolrefill JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

Deprecated: This method is not implemented by the RPC server.

type ListAccountsCmd

type ListAccountsCmd struct {
	MinConf *int `jsonrpcdefault:"1"`
}

ListAccountsCmd defines the listaccounts JSON-RPC command.

func NewListAccountsCmd

func NewListAccountsCmd(minConf *int) *ListAccountsCmd

NewListAccountsCmd returns a new instance which can be used to issue a listaccounts JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type ListAddressTransactionsCmd

type ListAddressTransactionsCmd struct {
	Addresses []string
	Account   *string
}

ListAddressTransactionsCmd defines the listaddresstransactions JSON-RPC command.

func NewListAddressTransactionsCmd

func NewListAddressTransactionsCmd(addresses []string, account *string) *ListAddressTransactionsCmd

NewListAddressTransactionsCmd returns a new instance which can be used to issue a listaddresstransactions JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type ListAllTransactionsCmd

type ListAllTransactionsCmd struct {
	Account *string
}

ListAllTransactionsCmd defines the listalltransactions JSON-RPC command.

func NewListAllTransactionsCmd

func NewListAllTransactionsCmd(account *string) *ListAllTransactionsCmd

NewListAllTransactionsCmd returns a new instance which can be used to issue a listalltransactions JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type ListLockUnspentCmd

type ListLockUnspentCmd struct{}

ListLockUnspentCmd defines the listlockunspent JSON-RPC command.

func NewListLockUnspentCmd

func NewListLockUnspentCmd() *ListLockUnspentCmd

NewListLockUnspentCmd returns a new instance which can be used to issue a listlockunspent JSON-RPC command.

type ListReceivedByAccountCmd

type ListReceivedByAccountCmd struct {
	MinConf          *int  `jsonrpcdefault:"1"`
	IncludeEmpty     *bool `jsonrpcdefault:"false"`
	IncludeWatchOnly *bool `jsonrpcdefault:"false"`
}

ListReceivedByAccountCmd defines the listreceivedbyaccount JSON-RPC command.

func NewListReceivedByAccountCmd

func NewListReceivedByAccountCmd(minConf *int, includeEmpty, includeWatchOnly *bool) *ListReceivedByAccountCmd

NewListReceivedByAccountCmd returns a new instance which can be used to issue a listreceivedbyaccount JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type ListReceivedByAccountResult

type ListReceivedByAccountResult struct {
	Account       string  `json:"account"`
	Amount        float64 `json:"amount"`
	Confirmations uint64  `json:"confirmations"`
}

ListReceivedByAccountResult models the data from the listreceivedbyaccount command.

type ListReceivedByAddressCmd

type ListReceivedByAddressCmd struct {
	MinConf          *int  `jsonrpcdefault:"1"`
	IncludeEmpty     *bool `jsonrpcdefault:"false"`
	IncludeWatchOnly *bool `jsonrpcdefault:"false"`
}

ListReceivedByAddressCmd defines the listreceivedbyaddress JSON-RPC command.

func NewListReceivedByAddressCmd

func NewListReceivedByAddressCmd(minConf *int, includeEmpty, includeWatchOnly *bool) *ListReceivedByAddressCmd

NewListReceivedByAddressCmd returns a new instance which can be used to issue a listreceivedbyaddress JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type ListReceivedByAddressResult

type ListReceivedByAddressResult struct {
	Account           string   `json:"account"`
	Address           string   `json:"address"`
	Amount            float64  `json:"amount"`
	Confirmations     uint64   `json:"confirmations"`
	TxIDs             []string `json:"txids,omitempty"`
	InvolvesWatchonly bool     `json:"involvesWatchonly,omitempty"`
}

ListReceivedByAddressResult models the data from the listreceivedbyaddress command.

type ListScriptsCmd

type ListScriptsCmd struct {
}

ListScriptsCmd is a type for handling custom marshaling and unmarshaling of listscripts JSON wallet extension commands.

func NewListScriptsCmd

func NewListScriptsCmd() *ListScriptsCmd

NewListScriptsCmd returns a new instance which can be used to issue a listscripts JSON-RPC command.

type ListScriptsResult

type ListScriptsResult struct {
	Scripts []ScriptInfo `json:"scripts"`
}

ListScriptsResult models the data returned from the listscripts command.

type ListSinceBlockCmd

type ListSinceBlockCmd struct {
	BlockHash           *string
	TargetConfirmations *int  `jsonrpcdefault:"1"`
	IncludeWatchOnly    *bool `jsonrpcdefault:"false"`
}

ListSinceBlockCmd defines the listsinceblock JSON-RPC command.

func NewListSinceBlockCmd

func NewListSinceBlockCmd(blockHash *string, targetConfirms *int, includeWatchOnly *bool) *ListSinceBlockCmd

NewListSinceBlockCmd returns a new instance which can be used to issue a listsinceblock JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type ListSinceBlockResult

type ListSinceBlockResult struct {
	Transactions []ListTransactionsResult `json:"transactions"`
	LastBlock    string                   `json:"lastblock"`
}

ListSinceBlockResult models the data from the listsinceblock command.

type ListTicketsCmd

type ListTicketsCmd struct {
}

ListTicketsCmd defines the listtickets JSON-RPC command.

func NewListTicketsCmd

func NewListTicketsCmd() *ListTicketsCmd

NewListTicketsCmd returns a new instance which can be used to issue a listtickets JSON-RPC command.

type ListTicketsResult

type ListTicketsResult struct {
	Ticket  *ListTicketsTransactionSummary `json:"ticket"`
	Spender *ListTicketsTransactionSummary `json:"spender"`
	Status  string                         `json:"status"`
}

ListTicketsResult models the data from the listtickets command.

type ListTicketsTransactionSummary

type ListTicketsTransactionSummary struct {
	Hash        string                                `json:"hash"`
	Transaction string                                `json:"transaction"`
	MyInputs    []ListTicketsTransactionSummaryInput  `json:"myinputs"`
	MyOutputs   []ListTicketsTransactionSummaryOutput `json:"myoutputs"`
	Fee         float64                               `json:"fee"`
	Timestamp   int64                                 `json:"timestamp"`
	Type        string                                `json:"type"`
}

ListTicketsTransactionSummary defines the type used in the listtickets JSON-RPC result for the Ticket and Spender command fields.

type ListTicketsTransactionSummaryInput

type ListTicketsTransactionSummaryInput struct {
	Index           uint32  `json:"index"`
	PreviousAccount string  `json:"previousaccount"`
	PreviousAmount  float64 `json:"previousamount"`
}

ListTicketsTransactionSummaryInput defines the type used in the listtickets JSON-RPC result for the MyInputs field of Ticket and Spender command field.

type ListTicketsTransactionSummaryOutput

type ListTicketsTransactionSummaryOutput struct {
	Index        uint32  `json:"index"`
	Account      string  `json:"account"`
	Internal     bool    `json:"internal"`
	Amount       float64 `json:"amount"`
	Address      string  `json:"address"`
	OutputScript string  `json:"outputscript"`
}

ListTicketsTransactionSummaryOutput defines the type used in the listtickets JSON-RPC result for the MyOutputs field of Ticket and Spender command field.

type ListTransactionsCmd

type ListTransactionsCmd struct {
	Account          *string
	Count            *int  `jsonrpcdefault:"10"`
	From             *int  `jsonrpcdefault:"0"`
	IncludeWatchOnly *bool `jsonrpcdefault:"false"`
}

ListTransactionsCmd defines the listtransactions JSON-RPC command.

func NewListTransactionsCmd

func NewListTransactionsCmd(account *string, count, from *int, includeWatchOnly *bool) *ListTransactionsCmd

NewListTransactionsCmd returns a new instance which can be used to issue a listtransactions JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type ListTransactionsResult

type ListTransactionsResult struct {
	Account           string                  `json:"account"`
	Address           string                  `json:"address,omitempty"`
	Amount            float64                 `json:"amount"`
	BlockHash         string                  `json:"blockhash,omitempty"`
	BlockIndex        *int64                  `json:"blockindex,omitempty"`
	BlockTime         int64                   `json:"blocktime,omitempty"`
	Category          string                  `json:"category"`
	Confirmations     int64                   `json:"confirmations"`
	Fee               *float64                `json:"fee,omitempty"`
	Generated         bool                    `json:"generated,omitempty"`
	InvolvesWatchOnly bool                    `json:"involveswatchonly,omitempty"`
	Time              int64                   `json:"time"`
	TimeReceived      int64                   `json:"timereceived"`
	TxID              string                  `json:"txid"`
	TxType            *ListTransactionsTxType `json:"txtype,omitempty"`
	Vout              uint32                  `json:"vout"`
	WalletConflicts   []string                `json:"walletconflicts"`
	Comment           string                  `json:"comment,omitempty"`
	OtherAccount      string                  `json:"otheraccount,omitempty"`
}

ListTransactionsResult models the data from the listtransactions command.

type ListTransactionsTxType

type ListTransactionsTxType string

ListTransactionsTxType defines the type used in the listtransactions JSON-RPC result for the TxType command field.

const (
	// LTTTRegular indicates a regular transaction.
	LTTTRegular ListTransactionsTxType = "regular"

	// LTTTTicket indicates a ticket.
	LTTTTicket ListTransactionsTxType = "ticket"

	// LTTTVote indicates a vote.
	LTTTVote ListTransactionsTxType = "vote"

	// LTTTRevocation indicates a revocation.
	LTTTRevocation ListTransactionsTxType = "revocation"
)

type ListUnspentCmd

type ListUnspentCmd struct {
	MinConf   *int `jsonrpcdefault:"1"`
	MaxConf   *int `jsonrpcdefault:"9999999"`
	Addresses *[]string
}

ListUnspentCmd defines the listunspent JSON-RPC command.

func NewListUnspentCmd

func NewListUnspentCmd(minConf, maxConf *int, addresses *[]string) *ListUnspentCmd

NewListUnspentCmd returns a new instance which can be used to issue a listunspent JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type ListUnspentResult

type ListUnspentResult struct {
	TxID          string  `json:"txid"`
	Vout          uint32  `json:"vout"`
	Tree          int8    `json:"tree"`
	TxType        int     `json:"txtype"`
	Address       string  `json:"address"`
	Account       string  `json:"account"`
	ScriptPubKey  string  `json:"scriptPubKey"`
	RedeemScript  string  `json:"redeemScript,omitempty"`
	Amount        float64 `json:"amount"`
	Confirmations int64   `json:"confirmations"`
	Spendable     bool    `json:"spendable"`
}

ListUnspentResult models a successful response from the listunspent request. Contains Decred additions.

type LockUnspentCmd

type LockUnspentCmd struct {
	Unlock       bool
	Transactions []dcrdtypes.TransactionInput
}

LockUnspentCmd defines the lockunspent JSON-RPC command.

func NewLockUnspentCmd

func NewLockUnspentCmd(unlock bool, transactions []dcrdtypes.TransactionInput) *LockUnspentCmd

NewLockUnspentCmd returns a new instance which can be used to issue a lockunspent JSON-RPC command.

type Method added in v1.1.0

type Method string

Method describes the exact type used when registering methods with dcrjson.

type MixAccountCmd added in v1.3.0

type MixAccountCmd struct{}

MixAccountCmd defines the mixaccount JSON-RPC command.

type MixOutputCmd added in v1.3.0

type MixOutputCmd struct {
	Outpoint string `json:"outpoint"`
}

MixOutputCmd defines the mixoutput JSON-RPC command.

type NewTxNtfn deprecated

type NewTxNtfn struct {
	Account string
	Details ListTransactionsResult
}

NewTxNtfn defines the newtx JSON-RPC notification.

Deprecated: dcrwallet does not provide JSON-RPC notifications

func NewNewTxNtfn deprecated

func NewNewTxNtfn(account string, details ListTransactionsResult) *NewTxNtfn

NewNewTxNtfn returns a new instance which can be used to issue a newtx JSON-RPC notification.

Deprecated: dcrwallet does not provide JSON-RPC notifications

type PoolUserTicket

type PoolUserTicket struct {
	Status        string `json:"status"`
	Ticket        string `json:"ticket"`
	TicketHeight  uint32 `json:"ticketheight"`
	SpentBy       string `json:"spentby"`
	SpentByHeight uint32 `json:"spentbyheight"`
}

PoolUserTicket is the JSON struct corresponding to a stake pool user ticket object.

type PurchaseTicketCmd

type PurchaseTicketCmd struct {
	FromAccount   string
	SpendLimit    float64 // In Coins
	MinConf       *int    `jsonrpcdefault:"1"`
	TicketAddress *string
	NumTickets    *int
	PoolAddress   *string
	PoolFees      *float64
	Expiry        *int
	Comment       *string
	TicketFee     *float64
}

PurchaseTicketCmd is a type handling custom marshaling and unmarshaling of purchaseticket JSON RPC commands.

func NewPurchaseTicketCmd

func NewPurchaseTicketCmd(fromAccount string, spendLimit float64, minConf *int,
	ticketAddress *string, numTickets *int, poolAddress *string, poolFees *float64,
	expiry *int, comment *string, ticketFee *float64) *PurchaseTicketCmd

NewPurchaseTicketCmd creates a new PurchaseTicketCmd.

type RawTxInput

type RawTxInput struct {
	Txid         string `json:"txid"`
	Vout         uint32 `json:"vout"`
	Tree         int8   `json:"tree"`
	ScriptPubKey string `json:"scriptPubKey"`
	RedeemScript string `json:"redeemScript"`
}

RawTxInput models the data needed for raw transaction input that is used in the SignRawTransactionCmd struct. Contains Decred additions.

type RecoverAddressesCmd deprecated

type RecoverAddressesCmd struct {
	Account string
	N       int
}

RecoverAddressesCmd defines the recoveraddresses JSON-RPC command.

Deprecated: This method is not implemented by the RPC server.

func NewRecoverAddressesCmd deprecated

func NewRecoverAddressesCmd(account string, n int) *RecoverAddressesCmd

NewRecoverAddressesCmd returns a new instance which can be used to issue a recoveraddresses JSON-RPC command.

Deprecated: This method is not implemented by the RPC server.

type RedeemMultiSigOutCmd

type RedeemMultiSigOutCmd struct {
	Hash    string
	Index   uint32
	Tree    int8
	Address *string
}

RedeemMultiSigOutCmd is a type handling custom marshaling and unmarshaling of redeemmultisigout JSON RPC commands.

func NewRedeemMultiSigOutCmd

func NewRedeemMultiSigOutCmd(hash string, index uint32, tree int8,
	address *string) *RedeemMultiSigOutCmd

NewRedeemMultiSigOutCmd creates a new RedeemMultiSigOutCmd.

type RedeemMultiSigOutResult

type RedeemMultiSigOutResult struct {
	Hex      string                    `json:"hex"`
	Complete bool                      `json:"complete"`
	Errors   []SignRawTransactionError `json:"errors,omitempty"`
}

RedeemMultiSigOutResult models the data returned from the redeemmultisigout command.

type RedeemMultiSigOutsCmd

type RedeemMultiSigOutsCmd struct {
	FromScrAddress string
	ToAddress      *string
	Number         *int
}

RedeemMultiSigOutsCmd is a type handling custom marshaling and unmarshaling of redeemmultisigout JSON RPC commands.

func NewRedeemMultiSigOutsCmd

func NewRedeemMultiSigOutsCmd(from string, to *string,
	number *int) *RedeemMultiSigOutsCmd

NewRedeemMultiSigOutsCmd creates a new RedeemMultiSigOutsCmd.

type RedeemMultiSigOutsResult

type RedeemMultiSigOutsResult struct {
	Results []RedeemMultiSigOutResult `json:"results"`
}

RedeemMultiSigOutsResult models the data returned from the redeemmultisigouts command.

type RenameAccountCmd

type RenameAccountCmd struct {
	OldAccount string
	NewAccount string
}

RenameAccountCmd defines the renameaccount JSON-RPC command.

func NewRenameAccountCmd

func NewRenameAccountCmd(oldAccount, newAccount string) *RenameAccountCmd

NewRenameAccountCmd returns a new instance which can be used to issue a renameaccount JSON-RPC command.

type RescanWalletCmd

type RescanWalletCmd struct {
	BeginHeight *int `jsonrpcdefault:"0"`
}

RescanWalletCmd describes the rescanwallet JSON-RPC request and parameters.

type RevocationCreatedNtfn deprecated

type RevocationCreatedNtfn struct {
	TxHash string
	SStxIn string
}

RevocationCreatedNtfn is a type handling custom marshaling and unmarshaling of ticketpurchased JSON websocket notifications.

Deprecated: dcrwallet does not provide JSON-RPC notifications

func NewRevocationCreatedNtfn deprecated

func NewRevocationCreatedNtfn(txHash string, sstxIn string) *RevocationCreatedNtfn

NewRevocationCreatedNtfn creates a new RevocationCreatedNtfn.

Deprecated: dcrwallet does not provide JSON-RPC notifications

type RevokeTicketsCmd

type RevokeTicketsCmd struct {
}

RevokeTicketsCmd describes the revoketickets JSON-RPC request and parameters.

func NewRevokeTicketsCmd

func NewRevokeTicketsCmd() *RevokeTicketsCmd

NewRevokeTicketsCmd creates a new RevokeTicketsCmd.

type ScriptInfo

type ScriptInfo struct {
	Hash160      string `json:"hash160"`
	Address      string `json:"address"`
	RedeemScript string `json:"redeemscript"`
}

ScriptInfo is the structure representing a redeem script, its hash, and its address.

type SendFromCmd

type SendFromCmd struct {
	FromAccount string
	ToAddress   string
	Amount      float64 // In DCR
	MinConf     *int    `jsonrpcdefault:"1"`
	Comment     *string
	CommentTo   *string
}

SendFromCmd defines the sendfrom JSON-RPC command.

func NewSendFromCmd

func NewSendFromCmd(fromAccount, toAddress string, amount float64, minConf *int, comment, commentTo *string) *SendFromCmd

NewSendFromCmd returns a new instance which can be used to issue a sendfrom JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type SendManyCmd

type SendManyCmd struct {
	FromAccount string
	Amounts     map[string]float64 `jsonrpcusage:"{\"address\":amount,...}"` // In DCR
	MinConf     *int               `jsonrpcdefault:"1"`
	Comment     *string
}

SendManyCmd defines the sendmany JSON-RPC command.

func NewSendManyCmd

func NewSendManyCmd(fromAccount string, amounts map[string]float64, minConf *int, comment *string) *SendManyCmd

NewSendManyCmd returns a new instance which can be used to issue a sendmany JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type SendToAddressCmd

type SendToAddressCmd struct {
	Address   string
	Amount    float64
	Comment   *string
	CommentTo *string
}

SendToAddressCmd defines the sendtoaddress JSON-RPC command.

func NewSendToAddressCmd

func NewSendToAddressCmd(address string, amount float64, comment, commentTo *string) *SendToAddressCmd

NewSendToAddressCmd returns a new instance which can be used to issue a sendtoaddress JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type SendToMultiSigCmd

type SendToMultiSigCmd struct {
	FromAccount string
	Amount      float64
	Pubkeys     []string
	NRequired   *int `jsonrpcdefault:"1"`
	MinConf     *int `jsonrpcdefault:"1"`
	Comment     *string
}

SendToMultiSigCmd is a type handling custom marshaling and unmarshaling of sendtomultisig JSON RPC commands.

func NewSendToMultiSigCmd

func NewSendToMultiSigCmd(fromaccount string, amount float64, pubkeys []string,
	nrequired *int, minConf *int, comment *string) *SendToMultiSigCmd

NewSendToMultiSigCmd creates a new SendToMultiSigCmd.

type SendToMultiSigResult

type SendToMultiSigResult struct {
	TxHash       string `json:"txhash"`
	Address      string `json:"address"`
	RedeemScript string `json:"redeemscript"`
}

SendToMultiSigResult models the data returned from the sendtomultisig command.

type SetTicketFeeCmd

type SetTicketFeeCmd struct {
	Fee float64
}

SetTicketFeeCmd is a type handling custom marshaling and unmarshaling of setticketfee JSON RPC commands.

func NewSetTicketFeeCmd

func NewSetTicketFeeCmd(fee float64) *SetTicketFeeCmd

NewSetTicketFeeCmd creates a new instance of the setticketfee command.

type SetTxFeeCmd

type SetTxFeeCmd struct {
	Amount float64 // In DCR
}

SetTxFeeCmd defines the settxfee JSON-RPC command.

func NewSetTxFeeCmd

func NewSetTxFeeCmd(amount float64) *SetTxFeeCmd

NewSetTxFeeCmd returns a new instance which can be used to issue a settxfee JSON-RPC command.

type SetVoteChoiceCmd

type SetVoteChoiceCmd struct {
	AgendaID string
	ChoiceID string
}

SetVoteChoiceCmd defines the parameters to the setvotechoice method.

func NewSetVoteChoiceCmd

func NewSetVoteChoiceCmd(agendaID, choiceID string) *SetVoteChoiceCmd

NewSetVoteChoiceCmd returns a new instance which can be used to issue a setvotechoice JSON-RPC command.

type SignMessageCmd

type SignMessageCmd struct {
	Address string
	Message string
}

SignMessageCmd defines the signmessage JSON-RPC command.

func NewSignMessageCmd

func NewSignMessageCmd(address, message string) *SignMessageCmd

NewSignMessageCmd returns a new instance which can be used to issue a signmessage JSON-RPC command.

type SignRawTransactionCmd

type SignRawTransactionCmd struct {
	RawTx    string
	Inputs   *[]RawTxInput
	PrivKeys *[]string
	Flags    *string `jsonrpcdefault:"\"ALL\""`
}

SignRawTransactionCmd defines the signrawtransaction JSON-RPC command.

func NewSignRawTransactionCmd

func NewSignRawTransactionCmd(hexEncodedTx string, inputs *[]RawTxInput, privKeys *[]string, flags *string) *SignRawTransactionCmd

NewSignRawTransactionCmd returns a new instance which can be used to issue a signrawtransaction JSON-RPC command.

The parameters which are pointers indicate they are optional. Passing nil for optional parameters will use the default value.

type SignRawTransactionError

type SignRawTransactionError struct {
	TxID      string `json:"txid"`
	Vout      uint32 `json:"vout"`
	ScriptSig string `json:"scriptSig"`
	Sequence  uint32 `json:"sequence"`
	Error     string `json:"error"`
}

SignRawTransactionError models the data that contains script verification errors from the signrawtransaction request.

type SignRawTransactionResult

type SignRawTransactionResult struct {
	Hex      string                    `json:"hex"`
	Complete bool                      `json:"complete"`
	Errors   []SignRawTransactionError `json:"errors,omitempty"`
}

SignRawTransactionResult models the data from the signrawtransaction command.

type SignRawTransactionsCmd

type SignRawTransactionsCmd struct {
	RawTxs []string
	Send   *bool `jsonrpcdefault:"true"`
}

SignRawTransactionsCmd defines the signrawtransactions JSON-RPC command.

func NewSignRawTransactionsCmd

func NewSignRawTransactionsCmd(hexEncodedTxs []string,
	send *bool) *SignRawTransactionsCmd

NewSignRawTransactionsCmd returns a new instance which can be used to issue a signrawtransactions JSON-RPC command.

type SignRawTransactionsResult

type SignRawTransactionsResult struct {
	Results []SignedTransaction `json:"results"`
}

SignRawTransactionsResult models the data returned from the signrawtransactions command.

type SignedTransaction

type SignedTransaction struct {
	SigningResult SignRawTransactionResult `json:"signingresult"`
	Sent          bool                     `json:"sent"`
	TxHash        *string                  `json:"txhash,omitempty"`
}

SignedTransaction is a signed transaction resulting from a signrawtransactions command.

type StakePoolUserInfoCmd

type StakePoolUserInfoCmd struct {
	User string
}

StakePoolUserInfoCmd defines the stakepooluserinfo JSON-RPC command.

func NewStakePoolUserInfoCmd

func NewStakePoolUserInfoCmd(user string) *StakePoolUserInfoCmd

NewStakePoolUserInfoCmd returns a new instance which can be used to issue a signrawtransactions JSON-RPC command.

type StakePoolUserInfoResult

type StakePoolUserInfoResult struct {
	Tickets        []PoolUserTicket `json:"tickets"`
	InvalidTickets []string         `json:"invalid"`
}

StakePoolUserInfoResult models the data returned from the stakepooluserinfo command.

type StartAutoBuyerCmd deprecated

type StartAutoBuyerCmd struct {
	Account           string
	Passphrase        string
	BalanceToMaintain *int64
	MaxFeePerKb       *int64
	MaxPriceRelative  *float64
	MaxPriceAbsolute  *int64
	VotingAddress     *string
	PoolAddress       *string
	PoolFees          *float64
	MaxPerBlock       *int64
}

StartAutoBuyerCmd is a type handling custom marshaling and unmarshaling of startautobuyer JSON RPC commands.

Deprecated: This method is not implemented by the RPC server.

func NewStartAutoBuyerCmd deprecated

func NewStartAutoBuyerCmd(account string, passphrase string, balanceToMaintain *int64, maxFeePerKb *int64, maxPriceRelative *float64, maxPriceAbsolute *int64, votingAddress *string, poolAddress *string, poolFees *float64,
	maxPerBlock *int64) *StartAutoBuyerCmd

NewStartAutoBuyerCmd creates a new StartAutoBuyerCmd.

Deprecated: This method is not implemented by the RPC server.

type StopAutoBuyerCmd deprecated

type StopAutoBuyerCmd struct {
}

StopAutoBuyerCmd is a type handling custom marshaling and unmarshaling of stopautobuyer JSON RPC commands.

Deprecated: This method is not implemented by the RPC server.

func NewStopAutoBuyerCmd deprecated

func NewStopAutoBuyerCmd() *StopAutoBuyerCmd

NewStopAutoBuyerCmd creates a new StopAutoBuyerCmd.

Deprecated: This method is not implemented by the RPC server.

type SweepAccountCmd

type SweepAccountCmd struct {
	SourceAccount         string
	DestinationAddress    string
	RequiredConfirmations *uint32
	FeePerKb              *float64
}

SweepAccountCmd defines the sweep account JSON-RPC command.

func NewSweepAccountCmd

func NewSweepAccountCmd(sourceAccount string, destinationAddress string, requiredConfs *uint32, feePerKb *float64) *SweepAccountCmd

NewSweepAccountCmd returns a new instance which can be used to issue a JSON-RPC SweepAccountCmd command.

type SweepAccountResult

type SweepAccountResult struct {
	UnsignedTransaction       string  `json:"unsignedtransaction"`
	TotalPreviousOutputAmount float64 `json:"totalpreviousoutputamount"`
	TotalOutputAmount         float64 `json:"totaloutputamount"`
	EstimatedSignedSize       uint32  `json:"estimatedsignedsize"`
}

SweepAccountResult models the data returned from the sweepaccount command.

type TicketPurchasedNtfn deprecated

type TicketPurchasedNtfn struct {
	TxHash string
	Amount int64 // SStx only
}

TicketPurchasedNtfn is a type handling custom marshaling and unmarshaling of ticketpurchased JSON websocket notifications.

Deprecated: dcrwallet does not provide JSON-RPC notifications

func NewTicketPurchasedNtfn deprecated

func NewTicketPurchasedNtfn(txHash string, amount int64) *TicketPurchasedNtfn

NewTicketPurchasedNtfn creates a new TicketPurchasedNtfn.

Deprecated: dcrwallet does not provide JSON-RPC notifications

type ValidateAddressResult added in v1.1.0

type ValidateAddressResult struct {
	IsValid      bool     `json:"isvalid"`
	Address      string   `json:"address,omitempty"`
	IsMine       bool     `json:"ismine,omitempty"`
	IsWatchOnly  bool     `json:"iswatchonly,omitempty"`
	IsScript     bool     `json:"isscript,omitempty"`
	PubKeyAddr   string   `json:"pubkeyaddr,omitempty"`
	PubKey       string   `json:"pubkey,omitempty"`
	IsCompressed bool     `json:"iscompressed,omitempty"`
	Account      string   `json:"account,omitempty"`
	Addresses    []string `json:"addresses,omitempty"`
	Hex          string   `json:"hex,omitempty"`
	Script       string   `json:"script,omitempty"`
	SigsRequired int32    `json:"sigsrequired,omitempty"`
}

ValidateAddressResult models the data returned by the wallet server validateaddress command.

type ValidateAddressWalletResult

type ValidateAddressWalletResult = ValidateAddressResult

ValidateAddressWalletResult aliases ValidateAddressResult.

type VerifySeedCmd

type VerifySeedCmd struct {
	Seed    string
	Account *uint32
}

VerifySeedCmd defines the verifyseed JSON-RPC command.

func NewVerifySeedCmd

func NewVerifySeedCmd(seed string, account *uint32) *VerifySeedCmd

NewVerifySeedCmd returns a new instance which can be used to issue a walletlock JSON-RPC command.

The parameters which are pointers indicate that they are optional. Passing nil for the optional parameters will use the default value.

type VerifySeedResult

type VerifySeedResult struct {
	Result   bool   `json:"keyresult"`
	CoinType uint32 `json:"cointype"`
}

VerifySeedResult models the data returned by the wallet server verify seed command.

type VoteChoice

type VoteChoice struct {
	AgendaID          string `json:"agendaid"`
	AgendaDescription string `json:"agendadescription"`
	ChoiceID          string `json:"choiceid"`
	ChoiceDescription string `json:"choicedescription"`
}

VoteChoice models the data for a vote choice in the getvotechoices result.

type VoteCreatedNtfn deprecated

type VoteCreatedNtfn struct {
	TxHash    string
	BlockHash string
	Height    int32
	SStxIn    string
	VoteBits  uint16
}

VoteCreatedNtfn is a type handling custom marshaling and unmarshaling of ticketpurchased JSON websocket notifications.

Deprecated: dcrwallet does not provide JSON-RPC notifications

func NewVoteCreatedNtfn deprecated

func NewVoteCreatedNtfn(txHash string, blockHash string, height int32, sstxIn string, voteBits uint16) *VoteCreatedNtfn

NewVoteCreatedNtfn creates a new VoteCreatedNtfn.

Deprecated: dcrwallet does not provide JSON-RPC notifications

type WalletInfoCmd

type WalletInfoCmd struct {
}

WalletInfoCmd defines the walletinfo JSON-RPC command.

func NewWalletInfoCmd

func NewWalletInfoCmd() *WalletInfoCmd

NewWalletInfoCmd returns a new instance which can be used to issue a walletinfo JSON-RPC command.

type WalletInfoResult

type WalletInfoResult struct {
	DaemonConnected  bool    `json:"daemonconnected"`
	Unlocked         bool    `json:"unlocked"`
	CoinType         uint32  `json:"cointype,omitempty"`
	TxFee            float64 `json:"txfee"`
	TicketFee        float64 `json:"ticketfee"`
	TicketPurchasing bool    `json:"ticketpurchasing"`
	VoteBits         uint16  `json:"votebits"`
	VoteBitsExtended string  `json:"votebitsextended"`
	VoteVersion      uint32  `json:"voteversion"`
	Voting           bool    `json:"voting"`
}

WalletInfoResult models the data returned from the walletinfo command.

type WalletIsLockedCmd

type WalletIsLockedCmd struct{}

WalletIsLockedCmd defines the walletislocked JSON-RPC command.

func NewWalletIsLockedCmd

func NewWalletIsLockedCmd() *WalletIsLockedCmd

NewWalletIsLockedCmd returns a new instance which can be used to issue a walletislocked JSON-RPC command.

type WalletLockCmd

type WalletLockCmd struct{}

WalletLockCmd defines the walletlock JSON-RPC command.

func NewWalletLockCmd

func NewWalletLockCmd() *WalletLockCmd

NewWalletLockCmd returns a new instance which can be used to issue a walletlock JSON-RPC command.

type WalletLockStateNtfn deprecated

type WalletLockStateNtfn struct {
	Locked bool
}

WalletLockStateNtfn defines the walletlockstate JSON-RPC notification.

Deprecated: dcrwallet does not provide JSON-RPC notifications

func NewWalletLockStateNtfn deprecated

func NewWalletLockStateNtfn(locked bool) *WalletLockStateNtfn

NewWalletLockStateNtfn returns a new instance which can be used to issue a walletlockstate JSON-RPC notification.

Deprecated: dcrwallet does not provide JSON-RPC notifications

type WalletPassphraseChangeCmd

type WalletPassphraseChangeCmd struct {
	OldPassphrase string
	NewPassphrase string
}

WalletPassphraseChangeCmd defines the walletpassphrase JSON-RPC command.

func NewWalletPassphraseChangeCmd

func NewWalletPassphraseChangeCmd(oldPassphrase, newPassphrase string) *WalletPassphraseChangeCmd

NewWalletPassphraseChangeCmd returns a new instance which can be used to issue a walletpassphrasechange JSON-RPC command.

type WalletPassphraseCmd

type WalletPassphraseCmd struct {
	Passphrase string
	Timeout    int64
}

WalletPassphraseCmd defines the walletpassphrase JSON-RPC command.

func NewWalletPassphraseCmd

func NewWalletPassphraseCmd(passphrase string, timeout int64) *WalletPassphraseCmd

NewWalletPassphraseCmd returns a new instance which can be used to issue a walletpassphrase JSON-RPC command.

Jump to

Keyboard shortcuts

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