types

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: ISC Imports: 2 Imported by: 1

Documentation

Overview

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

When communicating via the JSON-RPC protocol, all of the commands need to be marshalled to and from 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://pkg.go.dev/github.com/decred/dcrd/dcrjson/v4).

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbandonTransactionCmd

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 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 AccountUnlockedCmd

type AccountUnlockedCmd struct {
	Account string
}

AccountUnlockedCmd defines the accountunlocked JSON-RPC command arguments.

type AccountUnlockedResult

type AccountUnlockedResult struct {
	Encrypted bool  `json:"encrypted"`
	Unlocked  *bool `json:"unlocked,omitempty"`
}

AccountUnlockedResult models the data returned by the accountunlocked command. When Encrypted is false, Unlocked should be nil.

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 AddTransactionCmd

type AddTransactionCmd struct {
	BlockHash   string `json:"blockhash"`
	Transaction string `json:"transaction"`
}

AddTransactionCmd manually adds a single mined transaction to the wallet, which may be useful to add a transaction which was mined before a private key was imported. There is currently no validation that the transaction is indeed mined in this block.

type AuditReuseCmd

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 AuthenticateCmd

type AuthenticateCmd dcrdtypes.AuthenticateCmd

newtype definitions of dcrd commands we implement.

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 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 CreateRawTransactionCmd

type CreateRawTransactionCmd dcrdtypes.CreateRawTransactionCmd

newtype definitions of dcrd commands we implement.

type CreateSignatureCmd

type CreateSignatureCmd struct {
	Address               string
	InputIndex            int
	HashType              int
	PreviousPkScript      string
	SerializedTransaction string
}

CreateSignatureCmd defines the createsignature JSON-RPC command.

type CreateSignatureResult

type CreateSignatureResult struct {
	Signature string `json:"signature"`
	PublicKey string `json:"publickey"`
}

CreateSignatureResult models the data returned from the createsignature command.

type CreateUnsignedTicketResult

type CreateUnsignedTicketResult struct {
	UnsignedTickets []string `json:"unsignedtickets"`
	SplitTx         string   `json:"splittx"`
}

CreateUnsignedTicketResult is returned from PurchaseTicketCmd when dontSignTx is true.

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 DisapprovePercentCmd

type DisapprovePercentCmd struct{}

DisapprovePercentCmd defines the parameters for the disapprovepercent JSON-RPC command.

type DiscoverUsageCmd

type DiscoverUsageCmd struct {
	StartBlock       *string `json:"startblock"`
	DiscoverAccounts *bool   `json:"discoveraccounts"`
	GapLimit         *uint32 `json:"gaplimit"`
}

DiscoverUsageCmd defines the discoverusage JSON-RPC command.

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 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 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 GetBestBlockCmd

type GetBestBlockCmd dcrdtypes.GetBestBlockCmd

newtype definitions of dcrd commands we implement.

type GetBestBlockHashCmd

type GetBestBlockHashCmd dcrdtypes.GetBestBlockHashCmd

newtype definitions of dcrd commands we implement.

type GetBlockCmd

type GetBlockCmd dcrdtypes.GetBlockCmd

newtype definitions of dcrd commands we implement.

type GetBlockCountCmd

type GetBlockCountCmd dcrdtypes.GetBlockCountCmd

newtype definitions of dcrd commands we implement.

type GetBlockHashCmd

type GetBlockHashCmd dcrdtypes.GetBlockHashCmd

newtype definitions of dcrd commands we implement.

type GetBlockHeaderCmd

type GetBlockHeaderCmd dcrdtypes.GetBlockHeaderCmd

newtype definitions of dcrd commands we implement.

type GetCFilterV2Cmd

type GetCFilterV2Cmd dcrdtypes.GetCFilterV2Cmd

newtype definitions of dcrd commands we implement.

type GetCFilterV2Result

type GetCFilterV2Result struct {
	BlockHash string `json:"blockhash"`
	Filter    string `json:"filter"`
	Key       string `json:"key"`
}

GetCFilterV2Result models the data returned from the getcfilterv2 command.

type GetCoinjoinsByAcctCmd

type GetCoinjoinsByAcctCmd struct{}

type GetCurrentNetCmd

type GetCurrentNetCmd dcrdtypes.GetCurrentNetCmd

newtype definitions of dcrd commands we implement.

type GetInfoCmd

type GetInfoCmd dcrdtypes.GetInfoCmd

newtype definitions of dcrd commands we implement.

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 GetPeerInfoCmd

type GetPeerInfoCmd dcrdtypes.GetPeerInfoCmd

newtype definitions of dcrd commands we implement.

type GetPeerInfoResult

type GetPeerInfoResult struct {
	ID             int32  `json:"id"`
	Addr           string `json:"addr"`
	AddrLocal      string `json:"addrlocal"`
	Services       string `json:"services"`
	Version        uint32 `json:"version"`
	SubVer         string `json:"subver"`
	StartingHeight int64  `json:"startingheight"`
	BanScore       int32  `json:"banscore"`
}

GetPeerInfoResult models the data returned from the getpeerinfo 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 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 GetTxOutCmd

type GetTxOutCmd dcrdtypes.GetTxOutCmd

newtype definitions of dcrd commands we implement.

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 {
	TicketHash *string
}

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

func NewGetVoteChoicesCmd

func NewGetVoteChoicesCmd(tickethash *string) *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 HelpCmd

type HelpCmd dcrdtypes.HelpCmd

newtype definitions of dcrd commands we implement.

type ImportCFiltersV2Cmd

type ImportCFiltersV2Cmd struct {
	StartHeight int32    `json:"startheight"`
	Filters     []string `json:"filters"`
}

ImportCfiltersV2Cmd defines the importcfiltersv2 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 ImportPubKeyCmd

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

ImportPrivKeyCmd defines the importprivkey JSON-RPC command.

func NewImportPubKeyCmd

func NewImportPubKeyCmd(pubKey string, label *string, rescan *bool, scanFrom *int) *ImportPubKeyCmd

NewImportPubKeyCmd returns a new instance which can be used to issue a importpubkey 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

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

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 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 {
	Account *string
}

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 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 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
	Account   *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 LockAccountCmd

type LockAccountCmd struct {
	Account string
}

LockAccountCmd defines the lockaccount JSON-RPC command arguments.

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

type Method string

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

type MixAccountCmd

type MixAccountCmd struct{}

MixAccountCmd defines the mixaccount JSON-RPC command.

type MixOutputCmd

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

MixOutputCmd defines the mixoutput JSON-RPC command.

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 ProcessUnmanagedTicketCmd

type ProcessUnmanagedTicketCmd struct {
	TicketHash *string
}

ProcessUnmanagedTicket defines the processunmanagedticket JSON-RPC command arguments.

type PurchaseTicketCmd

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

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) *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 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 RevokeTicketsCmd

type RevokeTicketsCmd struct {
}

RevokeTicketsCmd describes the revoketickets JSON-RPC request and parameters.

func NewRevokeTicketsCmd

func NewRevokeTicketsCmd() *RevokeTicketsCmd

NewRevokeTicketsCmd creates a new RevokeTicketsCmd.

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 SendFromTreasuryCmd

type SendFromTreasuryCmd struct {
	Key     string
	Amounts map[string]float64
}

SendFromTreasuryCmd defines the sendfromtreasury JSON-RPC command.

func NewSendFromTreasuryCmd

func NewSendFromTreasuryCmd(pubkey string, amounts map[string]float64) *SendFromTreasuryCmd

NewSendFromTreasurymd returns a new instance which can be used to issue a sendfromtreasury JSON-RPC command.

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 SendRawTransactionCmd

type SendRawTransactionCmd dcrdtypes.SendRawTransactionCmd

newtype definitions of dcrd commands we implement.

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 SendToTreasuryCmd

type SendToTreasuryCmd struct {
	Amount float64
}

SendToTreasuryCmd defines the sendtotreasury JSON-RPC command.

func NewSendToTreasuryCmd

func NewSendToTreasuryCmd(amount float64, comment, commentTo *string) *SendToTreasuryCmd

NewSendToTreasurymd returns a new instance which can be used to issue a sendtotreasury JSON-RPC command.

type SetAccountPassphraseCmd

type SetAccountPassphraseCmd struct {
	Account    string
	Passphrase string
}

SetAccountPassphraseCmd defines the setaccountpassphrase JSON-RPC command arguments.

type SetDisapprovePercentCmd

type SetDisapprovePercentCmd struct {
	Percent uint32
}

SetDisapprovePercentCmd defines the parameters for the setdisapprovepercent JSON-RPC command.

type SetTSpendPolicyCmd

type SetTSpendPolicyCmd struct {
	Hash   string
	Policy string
	Ticket *string
}

SetTSpendPolicyCmd defines the parameters for the settspendpolicy JSON-RPC command.

func NewSetTSpendPolicyCmd

func NewSetTSpendPolicyCmd(hash string, policy string, ticket *string) *SetTSpendPolicyCmd

NewSetTSpendPolicyCmd returns a new instance which can be used to issue a settspendpolicy JSON-RPC command.

type SetTreasuryPolicyCmd

type SetTreasuryPolicyCmd struct {
	Key    string
	Policy string
	Ticket *string
}

SetTreasuryPolicyCmd defines the parameters for the settreasurypolicy JSON-RPC command.

func NewSetTreasuryPolicyCmd

func NewSetTreasuryPolicyCmd(key string, policy string, ticket *string) *SetTreasuryPolicyCmd

NewSetTreasuryPolicyCmd returns a new instance which can be used to issue a settreasurypolicy JSON-RPC 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
	TicketHash *string
}

SetVoteChoiceCmd defines the parameters to the setvotechoice method.

func NewSetVoteChoiceCmd

func NewSetVoteChoiceCmd(agendaID, choiceID string, tickethash *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 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 SyncStatusCmd

type SyncStatusCmd struct{}

SyncStatusCmd defines the syncstatus JSON-RPC command.

type SyncStatusResult

type SyncStatusResult struct {
	Synced               bool    `json:"synced"`
	InitialBlockDownload bool    `json:"initialblockdownload"`
	HeadersFetchProgress float32 `json:"headersfetchprogress"`
}

SyncStatusResult models the data returned by the syncstatus command.

type TSpendPolicyCmd

type TSpendPolicyCmd struct {
	Hash   *string
	Ticket *string
}

TSpendPolicyCmd defines the parameters for the tspendpolicy JSON-RPC command.

type TSpendPolicyResult

type TSpendPolicyResult struct {
	Hash   string `json:"hash"`
	Policy string `json:"policy"`
	Ticket string `json:"ticket,omitempty"`
}

TSpendPolicyResult models objects returned by the tspendpolicy command.

type TicketInfoCmd

type TicketInfoCmd struct {
	StartHeight *int32 `json:"startheight" jsonrpcdefault:"0"`
}

TicketInfoCmd defines the ticketinfo JSON-RPC command.

type TicketInfoResult

type TicketInfoResult struct {
	Hash          string       `json:"hash"`
	Cost          float64      `json:"cost"`
	VotingAddress string       `json:"votingaddress"`
	Status        string       `json:"status"`
	BlockHash     string       `json:"blockhash,omitempty"`
	BlockHeight   int32        `json:"blockheight"`
	Vote          string       `json:"vote,omitempty"`
	Revocation    string       `json:"revocation,omitempty"`
	Choices       []VoteChoice `json:"choices,omitempty"`
	VSPHost       string       `json:"vsphost,omitempty"`
}

TicketInfoResult models the data returned from the ticketinfo command.

type TicketsForAddressCmd

type TicketsForAddressCmd dcrdtypes.TicketsForAddressCmd

newtype definitions of dcrd commands we implement.

type TreasuryPolicyCmd

type TreasuryPolicyCmd struct {
	Key    *string
	Ticket *string
}

TreasuryPolicyCmd defines the parameters for the treasurypolicy JSON-RPC command.

type TreasuryPolicyResult

type TreasuryPolicyResult struct {
	Key    string `json:"key"`
	Policy string `json:"policy"`
	Ticket string `json:"ticket,omitempty"`
}

TreasuryPolicyResult models objects returned by the treasurypolicy command.

type UnlockAccountCmd

type UnlockAccountCmd struct {
	Account    string
	Passphrase string
}

UnlockAccountCmd defines the unlockaccount JSON-RPC command arguments.

type ValidateAddressCmd

type ValidateAddressCmd dcrdtypes.ValidateAddressCmd

newtype definitions of dcrd commands we implement.

type ValidateAddressResult

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"`
	AccountN     *uint32  `json:"accountn,omitempty"`
	Branch       *uint32  `json:"branch,omitempty"`
	Index        *uint32  `json:"index,omitempty"`
}

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

type ValidateAddressWalletResult

type ValidateAddressWalletResult = ValidateAddressResult

ValidateAddressWalletResult aliases ValidateAddressResult.

type ValidatePreDCP0005CFCmd

type ValidatePreDCP0005CFCmd struct{}

ValidatePreDCP0005CFCmd defines the validatepredcp0005cf JSON-RPC command.

type VerifyMessageCmd

type VerifyMessageCmd dcrdtypes.VerifyMessageCmd

newtype definitions of dcrd commands we implement.

type VersionCmd

type VersionCmd dcrdtypes.VersionCmd

newtype definitions of dcrd commands we implement.

type VoteChoice

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

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

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"`
	SPV              bool    `json:"spv"`
	Unlocked         bool    `json:"unlocked"`
	CoinType         uint32  `json:"cointype,omitempty"`
	TxFee            float64 `json:"txfee"`
	VoteBits         uint16  `json:"votebits"`
	VoteBitsExtended string  `json:"votebitsextended"`
	VoteVersion      uint32  `json:"voteversion"`
	Voting           bool    `json:"voting"`
	ManualTickets    bool    `json:"manualtickets"`
}

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 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.

type WalletPubPassphraseChangeCmd

type WalletPubPassphraseChangeCmd struct {
	OldPassphrase string
	NewPassphrase string
}

WalletPubPassphraseChangeCmd defines the walletpubpassphrasechange JSON-RPC command.

Jump to

Keyboard shortcuts

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