btcjson

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2016 License: ISC Imports: 12 Imported by: 0

README

btcjson

[Build Status] (https://travis-ci.org/btcsuite/btcd) ![ISC License] (http://img.shields.io/badge/license-ISC-blue.svg)

Package btcjson implements concrete types for marshalling to and from the bitcoin JSON-RPC API. A comprehensive suite of tests is provided to ensure proper functionality. Package btcjson is licensed under the copyfree ISC license.

Although this package was primarily written for btcd, it has intentionally been designed so it can be used as a standalone package for any projects needing to marshal to and from bitcoin 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 btcrpcclient 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.

JSON RPC

Bitcoin provides an extensive API call list to control the chain and wallet servers through JSON-RPC. These can be used to get information from the server or to cause the server to perform some action.

The general form of the commands are:

	{"jsonrpc": "1.0", "id":"test", "method": "getinfo", "params": []}

btcjson provides code to easily create these commands from go (as some of the commands can be fairly complex), to send the commands to a running bitcoin RPC server, and to handle the replies (putting them in useful Go data structures).

Sample Use

	// Create a new command.
	cmd, err := btcjson.NewGetBlockCountCmd()
	if err != nil {
		// Handle error
	}

	// Marshal the command to a JSON-RPC formatted byte slice.
	marshalled, err := btcjson.MarshalCmd(id, cmd)
	if err != nil {
		// Handle error
	}

	// At this point marshalled contains the raw bytes that are ready to send
	// to the RPC server to issue the command.
	fmt.Printf("%s\n", marshalled)

Documentation

[GoDoc] (http://godoc.org/github.com/btcsuite/btcd/btcjson)

Full go doc style documentation for the project can be viewed online without installing this package by using the GoDoc site here.

You can also view the documentation locally once the package is installed with the godoc tool by running godoc -http=":6060" and pointing your browser to http://localhost:6060/pkg/github.com/btcsuite/btcd/btcjson

Installation

$ go get github.com/btcsuite/btcd/btcjson

GPG Verification Key

All official release tags are signed by Conformal so users can ensure the code has not been tampered with and is coming from Conformal. To verify the signature perform the following:

  • Download the public key from the Conformal website at https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt

  • Import the public key into your GPG keyring:

    gpg --import GIT-GPG-KEY-conformal.txt
    
  • Verify the release tag with the following command where TAG_NAME is a placeholder for the specific tag:

    git tag -v TAG_NAME
    

License

Package btcjson is licensed under the copyfree ISC License.

Documentation

Overview

Package btcjson implements the bitcoin JSON-RPC API.

A complete description of the JSON-RPC protocol as used by bitcoin can be found on the official wiki at https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29 with a list of all the supported calls at https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list.

This package provides data structures and code for marshalling and unmarshalling json for communicating with a running instance of btcd or bitcoind/bitcoin-qt. It also provides code for sending those messages. It does not provide any code for the client to actually deal with the messages. Although it is meant primarily for btcd, it is possible to use this code elsewhere for interacting with a bitcoin client programatically.

Protocol

All messages to bitcoin are of the form:

{"jsonrpc":"1.0","id":"SOMEID","method":"SOMEMETHOD","params":SOMEPARAMS}

The params field can vary in what it contains depending on the different method (or command) being sent.

Replies will vary in form for the different commands. The basic form is:

{"result":SOMETHING,"error":null,"id":"SOMEID"}

The result field can be as simple as an int, or a complex structure containing many nested fields. For cases where we have already worked out the possible types of reply, result is unmarshalled into a structure that matches the command. For others, an interface is returned. An interface is not as convenient as one needs to do a type assertion first before using the value, but it means we can handle arbitrary replies.

The error field is null when there is no error. When there is an error it will return a numeric error code as well as a message describing the error.

id is simply the id of the requester.

RPC Server Authentication

All RPC calls must be authenticated with a username and password. The specifics on how to configure the RPC server varies depending on the specific bitcoin implementation. For bitcoind, this is accomplished by setting rpcuser and rpcpassword in the file ~/.bitcoin/bitcoin.conf. For btcd, this is accomplished by setting rpcuser and rpcpass in the file ~/.btcd/btcd.conf. The default local address of bitcoind is 127.0.0.1:8332 and the default local address of btcd is 127.0.0.1:8334

Usage

The general pattern to use this package consists of generating a message (see the full list on the official bitcoin wiki), sending the message, and handling the result after asserting its type.

For commands where the reply structure is known, such as getinfo, one can directly access the fields in the Reply structure by type asserting the reply to the appropriate concrete type.

// Create a getinfo command.
id := 1
cmd, err := btcjson.NewGetInfoCmd(id)
if err != nil {
	// Log and handle error.
}

// Send the message to server using the appropriate username and
// password.
reply, err := btcjson.RpcSend(user, password, server, cmd)
if err != nil {
	fmt.Println(err)
	// Log and handle error.
}

// Ensure there is a result and type assert it to a btcjson.InfoResult.
if reply.Result != nil {
	if info, ok := reply.Result.(*btcjson.InfoResult); ok {
		fmt.Println("balance =", info.Balance)
	}
}

For other commands where this package does not yet provide a concrete implementation for the reply, such as getrawmempool, the reply uses a generic interface so one can access individual items as follows:

// Create a getrawmempool command.
id := 1
cmd, err := btcjson.NewGetRawMempoolCmd(id)
if err != nil {
	// Log and handle error.
}

// Send the message to server using the appropriate username and
// password.
reply, err := btcjson.RpcSend(user, password, server, cmd)
if err != nil {
	// Log and handle error.
}

// Ensure there is a result and type assert it to a string slice.
if reply.Result != nil {
	if mempool, ok := reply.Result.([]string); ok {
		fmt.Println("num mempool entries =", len(mempool))
	}
}

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRequest = Error{
		Code:    -32600,
		Message: "Invalid request",
	}
	ErrMethodNotFound = Error{
		Code:    -32601,
		Message: "Method not found",
	}
	ErrInvalidParams = Error{
		Code:    -32602,
		Message: "Invalid paramaters",
	}
	ErrInternal = Error{
		Code:    -32603,
		Message: "Internal error",
	}
	ErrParse = Error{
		Code:    -32700,
		Message: "Parse error",
	}
)

Standard JSON-RPC 2.0 errors

View Source
var (
	ErrMisc = Error{
		Code:    -1,
		Message: "Miscellaneous error",
	}
	ErrForbiddenBySafeMode = Error{
		Code:    -2,
		Message: "Server is in safe mode, and command is not allowed in safe mode",
	}
	ErrType = Error{
		Code:    -3,
		Message: "Unexpected type was passed as parameter",
	}
	ErrInvalidAddressOrKey = Error{
		Code:    -5,
		Message: "Invalid address or key",
	}
	ErrOutOfMemory = Error{
		Code:    -7,
		Message: "Ran out of memory during operation",
	}
	ErrInvalidParameter = Error{
		Code:    -8,
		Message: "Invalid, missing or duplicate parameter",
	}
	ErrDatabase = Error{
		Code:    -20,
		Message: "Database error",
	}
	ErrDeserialization = Error{
		Code:    -22,
		Message: "Error parsing or validating structure in raw format",
	}
)

General application defined JSON errors

View Source
var (
	ErrClientNotConnected = Error{
		Code:    -9,
		Message: "Bitcoin is not connected",
	}
	ErrClientInInitialDownload = Error{
		Code:    -10,
		Message: "Bitcoin is downloading blocks...",
	}
)

Peer-to-peer client errors

View Source
var (
	ErrWallet = Error{
		Code:    -4,
		Message: "Unspecified problem with wallet",
	}
	ErrWalletInsufficientFunds = Error{
		Code:    -6,
		Message: "Not enough funds in wallet or account",
	}
	ErrWalletInvalidAccountName = Error{
		Code:    -11,
		Message: "Invalid account name",
	}
	ErrWalletKeypoolRanOut = Error{
		Code:    -12,
		Message: "Keypool ran out, call keypoolrefill first",
	}
	ErrWalletUnlockNeeded = Error{
		Code:    -13,
		Message: "Enter the wallet passphrase with walletpassphrase first",
	}
	ErrWalletPassphraseIncorrect = Error{
		Code:    -14,
		Message: "The wallet passphrase entered was incorrect",
	}
	ErrWalletWrongEncState = Error{
		Code:    -15,
		Message: "Command given in wrong wallet encryption state",
	}
	ErrWalletEncryptionFailed = Error{
		Code:    -16,
		Message: "Failed to encrypt the wallet",
	}
	ErrWalletAlreadyUnlocked = Error{
		Code:    -17,
		Message: "Wallet is already unlocked",
	}
)

Wallet JSON errors

View Source
var (
	ErrBlockNotFound = Error{
		Code:    -5,
		Message: "Block not found",
	}
	ErrBlockCount = Error{
		Code:    -5,
		Message: "Error getting block count",
	}
	ErrBestBlockHash = Error{
		Code:    -5,
		Message: "Error getting best block hash",
	}
	ErrDifficulty = Error{
		Code:    -5,
		Message: "Error getting difficulty",
	}
	ErrOutOfRange = Error{
		Code:    -1,
		Message: "Block number out of range",
	}
	ErrNoTxInfo = Error{
		Code:    -5,
		Message: "No information available about transaction",
	}
	ErrNoNewestBlockInfo = Error{
		Code:    -5,
		Message: "No information about newest block",
	}
	ErrInvalidTxVout = Error{
		Code:    -5,
		Message: "Ouput index number (vout) does not exist for transaction.",
	}
	ErrRawTxString = Error{
		Code:    -32602,
		Message: "Raw tx is not a string",
	}
	ErrDecodeHexString = Error{
		Code:    -22,
		Message: "Unable to decode hex string",
	}
)

Specific Errors related to commands. These are the ones a user of the rpc server are most likely to see. Generally, the codes should match one of the more general errors above.

View Source
var (
	ErrNoWallet = Error{
		Code:    -1,
		Message: "This implementation does not implement wallet commands",
	}
	ErrUnimplemented = Error{
		Code:    -1,
		Message: "Command unimplemented",
	}
)

Errors that are specific to btcd.

View Source
var ErrIncorrectArgTypes = errors.New("incorrect arguement types")

ErrIncorrectArgTypes describes an error where the wrong argument types are present.

View Source
var ErrTooManyOptArgs = errors.New("too many optional arguments")

ErrTooManyOptArgs describes an error where too many optional arguments were passed when creating a new Cmd.

View Source
var ErrWrongNumberOfParams = errors.New("incorrect number of parameters")

ErrWrongNumberOfParams describes an error where an incorrect number of parameters are found in an unmarshalled command.

Functions

func CreateMessage

func CreateMessage(message string, args ...interface{}) ([]byte, error)

CreateMessage takes a string and the optional arguments for it. Then, if it is a recognized bitcoin json message, generates the json message ready to send off to the daemon or server. It is capable of handeling all of the commands from the standard client, described at: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

WARNING: This method is deprecated and may be removed in a future version. Do NOT use this as it does not work for all commands. Instead, use one of the New<command>Cmd functions to create a specific command.

func CreateMessageWithId

func CreateMessageWithId(message string, id interface{}, args ...interface{}) ([]byte, error)

CreateMessageWithId takes a string, an id, and the optional arguments for it. Then, if it is a recognized bitcoin json message, generates the json message ready to send off to the daemon or server. It is capable of handling all of the commands from the standard client, described at: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

WARNING: This method is deprecated and may be removed in a future version. Do NOT use this as it does not work for all commands. Instead, use one of the New<command>Cmd functions to create a specific command.

func GetHelpString

func GetHelpString(cmdName string) (string, error)

GetHelpString returns a string containing help text for "cmdName". If cmdName is unknown to btcjson - either via the default command list or those registered using RegisterCustomCmd - an error will be returned.

func GetRaw

func GetRaw(resp io.ReadCloser) ([]byte, error)

GetRaw should be called after JsonRpcSend. It reads and returns the reply (which you can then call ReadResultCmd() on) and closes the connection.

func IsValidIdType

func IsValidIdType(id interface{}) bool

IsValidIdType checks that the Id field (which can go in any of the json messages) is valid. json rpc 1.0 allows any (json) type, but we still need to prevent values that cannot be marshalled from going in. json rpc 2.0 (which bitcoind follows for some parts) only allows string, number, or null, so we restrict to that list. Ths is only necessary if you manually marshal a message. The normal btcjson functions only use string ids.

func JSONGetMethod

func JSONGetMethod(message []byte) (string, error)

JSONGetMethod takes a message and tries to find the bitcoin command that it is in reply to so it can be processed further.

func JSONToAmount

func JSONToAmount(jsonAmount float64) (int64, error)

JSONToAmount Safely converts a floating point value to an int. Clearly not all floating point numbers can be converted to ints (there is no one-to-one mapping), but bitcoin's json api returns most numbers as floats which are not safe to use when handling money. Since bitcoins can only be divided in a limited way, this methods works for the amounts returned by the json api. It is not for general use. This follows the method described at: https://en.bitcoin.it/wiki/Proper_Money_Handling_%28JSON-RPC%29

func MarshallAndSend

func MarshallAndSend(rawReply Reply, w io.Writer) (string, error)

MarshallAndSend takes the reply structure, marshalls it to json, and sends it back to the io.Writer (most likely an http.ResponseWriter). returning a log message and an error if there is one.

func RegisterCustomCmd

func RegisterCustomCmd(method string, parser RawCmdParser, replyParser ReplyParser, helpString string)

RegisterCustomCmd registers a custom RawCmd parsing func, reply parsing func, and help text for a non-standard Bitcoin command.

func RpcRawCommand

func RpcRawCommand(user string, password string, server string, message []byte) ([]byte, error)

RpcRawCommand takes a message generated from one of the routines above along with the login/server info, sends it, and gets a reply, returning the raw []byte response for use with ReadResultCmd.

func TlsRpcRawCommand

func TlsRpcRawCommand(user string, password string, server string,
	message []byte, certificates []byte, skipverify bool) ([]byte, error)

TlsRpcRawCommand takes a message generated from one of the routines above along with the login,server info and PEM encoded certificate chains for the server sends it, and gets a reply, returning the raw []byte response for use with ReadResultCmd.

Types

type AddMultisigAddressCmd

type AddMultisigAddressCmd struct {
	NRequired int
	Keys      []string
	Account   string
	// contains filtered or unexported fields
}

AddMultisigAddressCmd is a type handling custom marshaling and unmarshaling of addmultisigaddress JSON RPC commands.

func NewAddMultisigAddressCmd

func NewAddMultisigAddressCmd(id interface{}, nRequired int, keys []string,
	optArgs ...string) (*AddMultisigAddressCmd, error)

NewAddMultisigAddressCmd creates a new AddMultisigAddressCmd, parsing the optional arguments optArgs which may be either empty or an optional account name.

func (*AddMultisigAddressCmd) Id

func (cmd *AddMultisigAddressCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*AddMultisigAddressCmd) MarshalJSON

func (cmd *AddMultisigAddressCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*AddMultisigAddressCmd) Method

func (cmd *AddMultisigAddressCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*AddMultisigAddressCmd) UnmarshalJSON

func (cmd *AddMultisigAddressCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type AddNodeCmd

type AddNodeCmd struct {
	Addr   string
	SubCmd string // One of  "add","remove","onetry". TODO(oga) enum?
	// contains filtered or unexported fields
}

AddNodeCmd is a type handling custom marshaling and unmarshaling of addmultisigaddress JSON RPC commands.

func NewAddNodeCmd

func NewAddNodeCmd(id interface{}, addr string, subcmd string) (
	*AddNodeCmd, error)

NewAddNodeCmd creates a new AddNodeCmd for the given address and subcommand.

func (*AddNodeCmd) Id

func (cmd *AddNodeCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*AddNodeCmd) MarshalJSON

func (cmd *AddNodeCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*AddNodeCmd) Method

func (cmd *AddNodeCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*AddNodeCmd) UnmarshalJSON

func (cmd *AddNodeCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type BackupWalletCmd

type BackupWalletCmd struct {
	Destination string
	// contains filtered or unexported fields
}

BackupWalletCmd is a type handling custom marshaling and unmarshaling of backupwallet JSON RPC commands.

func NewBackupWalletCmd

func NewBackupWalletCmd(id interface{}, path string) (*BackupWalletCmd, error)

NewBackupWalletCmd creates a new BackupWalletCmd.

func (*BackupWalletCmd) Id

func (cmd *BackupWalletCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*BackupWalletCmd) MarshalJSON

func (cmd *BackupWalletCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*BackupWalletCmd) Method

func (cmd *BackupWalletCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*BackupWalletCmd) UnmarshalJSON

func (cmd *BackupWalletCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type BadStatusCode

type BadStatusCode int

BadStatusCode describes a HTTP error when a response has non-200 status code

func (BadStatusCode) Error

func (e BadStatusCode) Error() string

type BlockResult

type BlockResult struct {
	Hash          string        `json:"hash"`
	Confirmations uint64        `json:"confirmations"`
	Size          int32         `json:"size"`
	Height        int64         `json:"height"`
	Version       int32         `json:"version"`
	MerkleRoot    string        `json:"merkleroot"`
	Tx            []string      `json:"tx,omitempty"`
	RawTx         []TxRawResult `json:"rawtx,omitempty"`
	Time          int64         `json:"time"`
	Nonce         uint32        `json:"nonce"`
	Bits          string        `json:"bits"`
	Difficulty    float64       `json:"difficulty"`
	PreviousHash  string        `json:"previousblockhash"`
	NextHash      string        `json:"nextblockhash"`
}

BlockResult models the data from the getblock command when the verbose flag is set. When the verbose flag is not set, getblock return a hex-encoded string.

type Cmd

type Cmd interface {
	json.Marshaler
	json.Unmarshaler
	Id() interface{}
	Method() string
}

Cmd is an interface for all Bitcoin JSON API commands to marshal and unmarshal as a JSON object.

func ParseMarshaledCmd

func ParseMarshaledCmd(b []byte) (Cmd, error)

ParseMarshaledCmd parses a raw command and unmarshals as a Cmd. Code that reads and handles commands should switch on the type and type assert as the particular commands supported by the program.

In all cases where b is a valid JSON-RPC message, and unmarshalling succeeds, a non-nil Cmd will always be returned. This even includes error cases where parsing the message into a concrete Cmd type fails. This behavior allows RPC server code to reply back with a detailed error using the Id and Method functions of the Cmd interface.

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
	// contains filtered or unexported fields
}

CreateMultisigCmd is a type handling custom marshaling and unmarshaling of createmultisig JSON RPC commands.

func NewCreateMultisigCmd

func NewCreateMultisigCmd(id interface{}, nRequired int, keys []string) (*CreateMultisigCmd, error)

NewCreateMultisigCmd creates a new CreateMultisigCmd, parsing the optional arguments optArgs.

func (*CreateMultisigCmd) Id

func (cmd *CreateMultisigCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*CreateMultisigCmd) MarshalJSON

func (cmd *CreateMultisigCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*CreateMultisigCmd) Method

func (cmd *CreateMultisigCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*CreateMultisigCmd) UnmarshalJSON

func (cmd *CreateMultisigCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type CreateRawTransactionCmd

type CreateRawTransactionCmd struct {
	Inputs  []TransactionInput
	Amounts map[string]int64
	// contains filtered or unexported fields
}

CreateRawTransactionCmd is a type handling custom marshaling and unmarshaling of createrawtransaction JSON RPC commands.

func NewCreateRawTransactionCmd

func NewCreateRawTransactionCmd(id interface{}, inputs []TransactionInput, amounts map[string]int64) (*CreateRawTransactionCmd, error)

NewCreateRawTransactionCmd creates a new CreateRawTransactionCmd.

func (*CreateRawTransactionCmd) Id

func (cmd *CreateRawTransactionCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*CreateRawTransactionCmd) MarshalJSON

func (cmd *CreateRawTransactionCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*CreateRawTransactionCmd) Method

func (cmd *CreateRawTransactionCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*CreateRawTransactionCmd) UnmarshalJSON

func (cmd *CreateRawTransactionCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type DebugLevelCmd

type DebugLevelCmd struct {
	LevelSpec string
	// contains filtered or unexported fields
}

DebugLevelCmd is a type handling custom marshaling and unmarshaling of debuglevel JSON RPC commands. This command is not a standard Bitcoin command. It is an extension for btcd.

func NewDebugLevelCmd

func NewDebugLevelCmd(id interface{}, levelSpec string) (*DebugLevelCmd, error)

NewDebugLevelCmd creates a new DebugLevelCmd. This command is not a standard Bitcoin command. It is an extension for btcd.

func (*DebugLevelCmd) Id

func (cmd *DebugLevelCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*DebugLevelCmd) MarshalJSON

func (cmd *DebugLevelCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*DebugLevelCmd) Method

func (cmd *DebugLevelCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*DebugLevelCmd) UnmarshalJSON

func (cmd *DebugLevelCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type DecodeRawTransactionCmd

type DecodeRawTransactionCmd struct {
	HexTx string
	// contains filtered or unexported fields
}

DecodeRawTransactionCmd is a type handling custom marshaling and unmarshaling of decoderawtransaction JSON RPC commands.

func NewDecodeRawTransactionCmd

func NewDecodeRawTransactionCmd(id interface{}, hextx string) (*DecodeRawTransactionCmd, error)

NewDecodeRawTransactionCmd creates a new DecodeRawTransactionCmd.

func (*DecodeRawTransactionCmd) Id

func (cmd *DecodeRawTransactionCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*DecodeRawTransactionCmd) MarshalJSON

func (cmd *DecodeRawTransactionCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*DecodeRawTransactionCmd) Method

func (cmd *DecodeRawTransactionCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*DecodeRawTransactionCmd) UnmarshalJSON

func (cmd *DecodeRawTransactionCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type DecodeScriptCmd

type DecodeScriptCmd struct {
	HexScript string
	// contains filtered or unexported fields
}

DecodeScriptCmd is a type handling custom marshaling and unmarshaling of decodescript JSON RPC commands.

func NewDecodeScriptCmd

func NewDecodeScriptCmd(id interface{}, hexscript string) (*DecodeScriptCmd, error)

NewDecodeScriptCmd creates a new DecodeScriptCmd.

func (*DecodeScriptCmd) Id

func (cmd *DecodeScriptCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*DecodeScriptCmd) MarshalJSON

func (cmd *DecodeScriptCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*DecodeScriptCmd) Method

func (cmd *DecodeScriptCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*DecodeScriptCmd) UnmarshalJSON

func (cmd *DecodeScriptCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type DecodeScriptResult

type DecodeScriptResult struct {
	Asm       string   `json:"asm"`
	ReqSigs   int32    `json:"reqSigs,omitempty"`
	Type      string   `json:"type0"`
	Addresses []string `json:"addresses,omitempty"`
	P2sh      string   `json:"p2sh"`
}

DecodeScriptResult models the data returned from the decodescript command.

type DestAddrResult

type DestAddrResult struct {
	Asm       string   `json:"asm"`
	Hex       string   `json:"hex,omitempty"`
	ReqSigs   int32    `json:"reqSigs,omitempty"`
	Addresses []string `json:"addresses,omitempty"`
}

DestAddrResult models the scriptPubKey data of a tx script. It is defined separately since it is used by multiple commands.

type DumpPrivKeyCmd

type DumpPrivKeyCmd struct {
	Address string
	// contains filtered or unexported fields
}

DumpPrivKeyCmd is a type handling custom marshaling and unmarshaling of dumpprivkey JSON RPC commands.

func NewDumpPrivKeyCmd

func NewDumpPrivKeyCmd(id interface{}, address string) (*DumpPrivKeyCmd, error)

NewDumpPrivKeyCmd creates a new DumpPrivkeyCmd.

func (*DumpPrivKeyCmd) Id

func (cmd *DumpPrivKeyCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*DumpPrivKeyCmd) MarshalJSON

func (cmd *DumpPrivKeyCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*DumpPrivKeyCmd) Method

func (cmd *DumpPrivKeyCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*DumpPrivKeyCmd) UnmarshalJSON

func (cmd *DumpPrivKeyCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type DumpWalletCmd

type DumpWalletCmd struct {
	Filename string
	// contains filtered or unexported fields
}

DumpWalletCmd is a type handling custom marshaling and unmarshaling of dumpwallet JSON RPC commands.

func NewDumpWalletCmd

func NewDumpWalletCmd(id interface{}, filename string) (*DumpWalletCmd, error)

NewDumpWalletCmd creates a new DumpPrivkeyCmd.

func (*DumpWalletCmd) Id

func (cmd *DumpWalletCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*DumpWalletCmd) MarshalJSON

func (cmd *DumpWalletCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*DumpWalletCmd) Method

func (cmd *DumpWalletCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*DumpWalletCmd) UnmarshalJSON

func (cmd *DumpWalletCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type ECAddrResult

type ECAddrResult struct {
	Asm       string   `json:"asm"`
	Hex       string   `json:"hex,omitempty"`
	ReqSigs   int32    `json:"reqSigs,omitempty"`
	Addresses []string `json:"addresses,omitempty"`
}

type EncryptWalletCmd

type EncryptWalletCmd struct {
	Passphrase string
	// contains filtered or unexported fields
}

EncryptWalletCmd is a type handling custom marshaling and unmarshaling of encryptwallet JSON RPC commands.

func NewEncryptWalletCmd

func NewEncryptWalletCmd(id interface{}, passphrase string) (*EncryptWalletCmd, error)

NewEncryptWalletCmd creates a new EncryptWalletCmd.

func (*EncryptWalletCmd) Id

func (cmd *EncryptWalletCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*EncryptWalletCmd) MarshalJSON

func (cmd *EncryptWalletCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*EncryptWalletCmd) Method

func (cmd *EncryptWalletCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*EncryptWalletCmd) UnmarshalJSON

func (cmd *EncryptWalletCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type Error

type Error struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

Error models the error field of the json returned by a bitcoin client. When there is no error, this should be a nil pointer to produce the null in the json that bitcoind produces.

func (Error) Error

func (e Error) Error() string

Error returns a string describing the btcjson error. This satisifies the builtin error interface.

type EstimateFeeCmd

type EstimateFeeCmd struct {
	NumBlocks int64
	// contains filtered or unexported fields
}

EstimateFeeCmd is a type handling custom marshaling and unmarshaling of estimatefee JSON RPC commands.

func NewEstimateFeeCmd

func NewEstimateFeeCmd(id interface{}, numblocks int64) (*EstimateFeeCmd, error)

NewEstimateFeeCmd creates a new EstimateFeeCmd.

func (*EstimateFeeCmd) Id

func (cmd *EstimateFeeCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*EstimateFeeCmd) MarshalJSON

func (cmd *EstimateFeeCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*EstimateFeeCmd) Method

func (cmd *EstimateFeeCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*EstimateFeeCmd) UnmarshalJSON

func (cmd *EstimateFeeCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type EstimatePriorityCmd

type EstimatePriorityCmd struct {
	NumBlocks int64
	// contains filtered or unexported fields
}

EstimatePriorityCmd is a type handling custom marshaling and unmarshaling of estimatepriority JSON RPC commands.

func NewEstimatePriorityCmd

func NewEstimatePriorityCmd(id interface{}, numblocks int64) (*EstimatePriorityCmd, error)

NewEstimatePriorityCmd creates a new EstimatePriorityCmd.

func (*EstimatePriorityCmd) Id

func (cmd *EstimatePriorityCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*EstimatePriorityCmd) MarshalJSON

func (cmd *EstimatePriorityCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*EstimatePriorityCmd) Method

func (cmd *EstimatePriorityCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*EstimatePriorityCmd) UnmarshalJSON

func (cmd *EstimatePriorityCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetAccountAddressCmd

type GetAccountAddressCmd struct {
	Account string
	// contains filtered or unexported fields
}

GetAccountAddressCmd is a type handling custom marshaling and unmarshaling of getaccountaddress JSON RPC commands.

func NewGetAccountAddressCmd

func NewGetAccountAddressCmd(id interface{}, account string) (*GetAccountAddressCmd, error)

NewGetAccountAddressCmd creates a new GetAccountAddressCmd.

func (*GetAccountAddressCmd) Id

func (cmd *GetAccountAddressCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetAccountAddressCmd) MarshalJSON

func (cmd *GetAccountAddressCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetAccountAddressCmd) Method

func (cmd *GetAccountAddressCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetAccountAddressCmd) UnmarshalJSON

func (cmd *GetAccountAddressCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetAccountCmd

type GetAccountCmd struct {
	Address string
	// contains filtered or unexported fields
}

GetAccountCmd is a type handling custom marshaling and unmarshaling of getaccount JSON RPC commands.

func NewGetAccountCmd

func NewGetAccountCmd(id interface{}, address string) (*GetAccountCmd, error)

NewGetAccountCmd creates a new GetAccountCmd.

func (*GetAccountCmd) Id

func (cmd *GetAccountCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetAccountCmd) MarshalJSON

func (cmd *GetAccountCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetAccountCmd) Method

func (cmd *GetAccountCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetAccountCmd) UnmarshalJSON

func (cmd *GetAccountCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetAddedNodeInfoCmd

type GetAddedNodeInfoCmd struct {
	Dns  bool
	Node string
	// contains filtered or unexported fields
}

GetAddedNodeInfoCmd is a type handling custom marshaling and unmarshaling of getaddednodeinfo JSON RPC commands.

func NewGetAddedNodeInfoCmd

func NewGetAddedNodeInfoCmd(id interface{}, dns bool, optArgs ...string) (*GetAddedNodeInfoCmd, error)

NewGetAddedNodeInfoCmd creates a new GetAddedNodeInfoCmd. Optionally the node to be queried may be provided. More than one optonal argument is an error.

func (*GetAddedNodeInfoCmd) Id

func (cmd *GetAddedNodeInfoCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetAddedNodeInfoCmd) MarshalJSON

func (cmd *GetAddedNodeInfoCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetAddedNodeInfoCmd) Method

func (cmd *GetAddedNodeInfoCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetAddedNodeInfoCmd) UnmarshalJSON

func (cmd *GetAddedNodeInfoCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetAddedNodeInfoResult

type GetAddedNodeInfoResult struct {
	AddedNode string                        `json:"addednode"`
	Connected *bool                         `json:"connected,omitempty"`
	Addresses *[]GetAddedNodeInfoResultAddr `json:"addresses,omitempty"`
}

GetAddedNodeInfoResult models the data from the getaddednodeinfo command.

type GetAddedNodeInfoResultAddr

type GetAddedNodeInfoResultAddr struct {
	Address   string `json:"address"`
	Connected string `json:"connected"`
}

GetAddedNodeInfoResultAddr models the data of the addresses portion of the getaddednodeinfo command.

type GetAddressesByAccountCmd

type GetAddressesByAccountCmd struct {
	Account string
	// contains filtered or unexported fields
}

GetAddressesByAccountCmd is a type handling custom marshaling and unmarshaling of getaddressesbyaccount JSON RPC commands.

func NewGetAddressesByAccountCmd

func NewGetAddressesByAccountCmd(id interface{}, account string) (*GetAddressesByAccountCmd, error)

NewGetAddressesByAccountCmd creates a new GetAddressesByAccountCmd.

func (*GetAddressesByAccountCmd) Id

func (cmd *GetAddressesByAccountCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetAddressesByAccountCmd) MarshalJSON

func (cmd *GetAddressesByAccountCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetAddressesByAccountCmd) Method

func (cmd *GetAddressesByAccountCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetAddressesByAccountCmd) UnmarshalJSON

func (cmd *GetAddressesByAccountCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetBalanceCmd

type GetBalanceCmd struct {
	Account *string
	MinConf int
	// contains filtered or unexported fields
}

GetBalanceCmd is a type handling custom marshaling and unmarshaling of getbalance JSON RPC commands.

func NewGetBalanceCmd

func NewGetBalanceCmd(id interface{}, optArgs ...interface{}) (*GetBalanceCmd, error)

NewGetBalanceCmd creates a new GetBalanceCmd. Optionally a string for account and an int for minconf may be provided as arguments.

func (*GetBalanceCmd) Id

func (cmd *GetBalanceCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetBalanceCmd) MarshalJSON

func (cmd *GetBalanceCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetBalanceCmd) Method

func (cmd *GetBalanceCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetBalanceCmd) UnmarshalJSON

func (cmd *GetBalanceCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetBestBlockHashCmd

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

GetBestBlockHashCmd is a type handling custom marshaling and unmarshaling of getbestblockhash JSON RPC commands.

func NewGetBestBlockHashCmd

func NewGetBestBlockHashCmd(id interface{}) (*GetBestBlockHashCmd, error)

NewGetBestBlockHashCmd creates a new GetBestBlockHashCmd.

func (*GetBestBlockHashCmd) Id

func (cmd *GetBestBlockHashCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetBestBlockHashCmd) MarshalJSON

func (cmd *GetBestBlockHashCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetBestBlockHashCmd) Method

func (cmd *GetBestBlockHashCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetBestBlockHashCmd) UnmarshalJSON

func (cmd *GetBestBlockHashCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetBlockChainInfoCmd

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

GetBlockChainInfoCmd is a type handling custom marshaling and unmarshaling of getblockchaininfo JSON RPC commands.

func NewGetBlockChainInfoCmd

func NewGetBlockChainInfoCmd(id interface{}) (*GetBlockChainInfoCmd, error)

NewGetBlockChainInfoCmd creates a new GetBlockChainInfoCmd.

func (*GetBlockChainInfoCmd) Id

func (cmd *GetBlockChainInfoCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetBlockChainInfoCmd) MarshalJSON

func (cmd *GetBlockChainInfoCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetBlockChainInfoCmd) Method

func (cmd *GetBlockChainInfoCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetBlockChainInfoCmd) UnmarshalJSON

func (cmd *GetBlockChainInfoCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetBlockChainInfoResult

type GetBlockChainInfoResult struct {
	Chain                string  `json:"chain"`
	Blocks               int32   `json:"blocks"`
	BestBlockHash        string  `json:"bestblockhash"`
	Difficulty           float64 `json:"difficulty"`
	VerificationProgress float64 `json:"verificationprogress"`
	ChainWork            string  `json:"chainwork"`
}

GetBlockChainInfoResult models the data returned from the getblockchaininfo command.

type GetBlockCmd

type GetBlockCmd struct {
	Hash      string
	Verbose   bool
	VerboseTx bool
	// contains filtered or unexported fields
}

GetBlockCmd is a type handling custom marshaling and unmarshaling of getblock JSON RPC commands.

func NewGetBlockCmd

func NewGetBlockCmd(id interface{}, hash string, optArgs ...bool) (*GetBlockCmd, error)

NewGetBlockCmd creates a new GetBlockCmd.

func (*GetBlockCmd) Id

func (cmd *GetBlockCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetBlockCmd) MarshalJSON

func (cmd *GetBlockCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetBlockCmd) Method

func (cmd *GetBlockCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetBlockCmd) UnmarshalJSON

func (cmd *GetBlockCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetBlockCountCmd

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

GetBlockCountCmd is a type handling custom marshaling and unmarshaling of getblockcount JSON RPC commands.

func NewGetBlockCountCmd

func NewGetBlockCountCmd(id interface{}) (*GetBlockCountCmd, error)

NewGetBlockCountCmd creates a new GetBlockCountCmd.

func (*GetBlockCountCmd) Id

func (cmd *GetBlockCountCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetBlockCountCmd) MarshalJSON

func (cmd *GetBlockCountCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetBlockCountCmd) Method

func (cmd *GetBlockCountCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetBlockCountCmd) UnmarshalJSON

func (cmd *GetBlockCountCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetBlockHashCmd

type GetBlockHashCmd struct {
	Index int64
	// contains filtered or unexported fields
}

GetBlockHashCmd is a type handling custom marshaling and unmarshaling of getblockhash JSON RPC commands.

func NewGetBlockHashCmd

func NewGetBlockHashCmd(id interface{}, index int64) (*GetBlockHashCmd, error)

NewGetBlockHashCmd creates a new GetBlockHashCmd.

func (*GetBlockHashCmd) Id

func (cmd *GetBlockHashCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetBlockHashCmd) MarshalJSON

func (cmd *GetBlockHashCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetBlockHashCmd) Method

func (cmd *GetBlockHashCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetBlockHashCmd) UnmarshalJSON

func (cmd *GetBlockHashCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetBlockTemplateCmd

type GetBlockTemplateCmd struct {
	Request *TemplateRequest
	// contains filtered or unexported fields
}

GetBlockTemplateCmd is a type handling custom marshaling and unmarshaling of getblocktemplate JSON RPC commands.

func NewGetBlockTemplateCmd

func NewGetBlockTemplateCmd(id interface{}, optArgs ...*TemplateRequest) (*GetBlockTemplateCmd, error)

NewGetBlockTemplateCmd creates a new GetBlockTemplateCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*GetBlockTemplateCmd) Id

func (cmd *GetBlockTemplateCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetBlockTemplateCmd) MarshalJSON

func (cmd *GetBlockTemplateCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetBlockTemplateCmd) Method

func (cmd *GetBlockTemplateCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetBlockTemplateCmd) UnmarshalJSON

func (cmd *GetBlockTemplateCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetBlockTemplateResult

type GetBlockTemplateResult struct {
	// Base fields from BIP 0022.  CoinbaseAux is optional.  One of
	// CoinbaseTxn or CoinbaseValue must be specified, but not both.
	Bits          string                     `json:"bits"`
	CurTime       int64                      `json:"curtime"`
	Height        int64                      `json:"height"`
	PreviousHash  string                     `json:"previousblockhash"`
	SigOpLimit    int64                      `json:"sigoplimit,omitempty"`
	SizeLimit     int64                      `json:"sizelimit,omitempty"`
	Transactions  []GetBlockTemplateResultTx `json:"transactions"`
	Version       int32                      `json:"version"`
	CoinbaseAux   *GetBlockTemplateResultAux `json:"coinbaseaux,omitempty"`
	CoinbaseTxn   *GetBlockTemplateResultTx  `json:"coinbasetxn,omitempty"`
	CoinbaseValue *int64                     `json:"coinbasevalue,omitempty"`
	WorkID        string                     `json:"workid,omitempty"`

	// Optional long polling from BIP 0022.
	LongPollID  string `json:"longpollid,omitempty"`
	LongPollURI string `json:"longpolluri,omitempty"`
	SubmitOld   *bool  `json:"submitold,omitempty"`

	// Basic pool extension from BIP 0023.
	Target  string `json:"target,omitempty"`
	Expires int64  `json:"expires,omitempty"`

	// Mutations from BIP 0023.
	MaxTime    int64    `json:"maxtime,omitempty"`
	MinTime    int64    `json:"mintime,omitempty"`
	Mutable    []string `json:"mutable,omitempty"`
	NonceRange string   `json:"noncerange,omitempty"`

	// Block proposal from BIP 0023.
	Capabilities  []string `json:"capabilities,omitempty"`
	RejectReasion string   `json:"reject-reason,omitempty"`
}

GetBlockTemplateResult models the data returned from the getblocktemplate command.

type GetBlockTemplateResultAux

type GetBlockTemplateResultAux struct {
	Flags string `json:"flags"`
}

GetBlockTemplateResultAux models the coinbaseaux field of the getblocktemplate command.

type GetBlockTemplateResultTx

type GetBlockTemplateResultTx struct {
	Data    string  `json:"data"`
	Hash    string  `json:"hash"`
	Depends []int64 `json:"depends"`
	Fee     int64   `json:"fee"`
	SigOps  int64   `json:"sigops"`
}

GetBlockTemplateResultTx models the transactions field of the getblocktemplate command.

type GetConnectionCountCmd

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

GetConnectionCountCmd is a type handling custom marshaling and unmarshaling of getconnectioncount JSON RPC commands.

func NewGetConnectionCountCmd

func NewGetConnectionCountCmd(id interface{}) (*GetConnectionCountCmd, error)

NewGetConnectionCountCmd creates a new GetConnectionCountCmd.

func (*GetConnectionCountCmd) Id

func (cmd *GetConnectionCountCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetConnectionCountCmd) MarshalJSON

func (cmd *GetConnectionCountCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetConnectionCountCmd) Method

func (cmd *GetConnectionCountCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetConnectionCountCmd) UnmarshalJSON

func (cmd *GetConnectionCountCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetDifficultyCmd

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

GetDifficultyCmd is a type handling custom marshaling and unmarshaling of getdifficulty JSON RPC commands.

func NewGetDifficultyCmd

func NewGetDifficultyCmd(id interface{}) (*GetDifficultyCmd, error)

NewGetDifficultyCmd creates a new GetDifficultyCmd.

func (*GetDifficultyCmd) Id

func (cmd *GetDifficultyCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetDifficultyCmd) MarshalJSON

func (cmd *GetDifficultyCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetDifficultyCmd) Method

func (cmd *GetDifficultyCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetDifficultyCmd) UnmarshalJSON

func (cmd *GetDifficultyCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetGenerateCmd

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

GetGenerateCmd is a type handling custom marshaling and unmarshaling of getgenerate JSON RPC commands.

func NewGetGenerateCmd

func NewGetGenerateCmd(id interface{}) (*GetGenerateCmd, error)

NewGetGenerateCmd creates a new GetGenerateCmd.

func (*GetGenerateCmd) Id

func (cmd *GetGenerateCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetGenerateCmd) MarshalJSON

func (cmd *GetGenerateCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetGenerateCmd) Method

func (cmd *GetGenerateCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetGenerateCmd) UnmarshalJSON

func (cmd *GetGenerateCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetHashesPerSecCmd

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

GetHashesPerSecCmd is a type handling custom marshaling and unmarshaling of gethashespersec JSON RPC commands.

func NewGetHashesPerSecCmd

func NewGetHashesPerSecCmd(id interface{}) (*GetHashesPerSecCmd, error)

NewGetHashesPerSecCmd creates a new GetHashesPerSecCmd.

func (*GetHashesPerSecCmd) Id

func (cmd *GetHashesPerSecCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetHashesPerSecCmd) MarshalJSON

func (cmd *GetHashesPerSecCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetHashesPerSecCmd) Method

func (cmd *GetHashesPerSecCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetHashesPerSecCmd) UnmarshalJSON

func (cmd *GetHashesPerSecCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetInfoCmd

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

GetInfoCmd is a type handling custom marshaling and unmarshaling of getinfo JSON RPC commands.

func NewGetInfoCmd

func NewGetInfoCmd(id interface{}) (*GetInfoCmd, error)

NewGetInfoCmd creates a new GetInfoCmd.

func (*GetInfoCmd) Id

func (cmd *GetInfoCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetInfoCmd) MarshalJSON

func (cmd *GetInfoCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetInfoCmd) Method

func (cmd *GetInfoCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetInfoCmd) UnmarshalJSON

func (cmd *GetInfoCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetMiningInfoCmd

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

GetMiningInfoCmd is a type handling custom marshaling and unmarshaling of getmininginfo JSON RPC commands.

func NewGetMiningInfoCmd

func NewGetMiningInfoCmd(id interface{}) (*GetMiningInfoCmd, error)

NewGetMiningInfoCmd creates a new GetMiningInfoCmd.

func (*GetMiningInfoCmd) Id

func (cmd *GetMiningInfoCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetMiningInfoCmd) MarshalJSON

func (cmd *GetMiningInfoCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetMiningInfoCmd) Method

func (cmd *GetMiningInfoCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetMiningInfoCmd) UnmarshalJSON

func (cmd *GetMiningInfoCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetMiningInfoResult

type GetMiningInfoResult struct {
	Blocks           int64   `json:"blocks"`
	CurrentBlockSize uint64  `json:"currentblocksize"`
	CurrentBlockTx   uint64  `json:"currentblocktx"`
	Difficulty       float64 `json:"difficulty"`
	Errors           string  `json:"errors"`
	Generate         bool    `json:"generate"`
	GenProcLimit     int32   `json:"genproclimit"`
	HashesPerSec     int64   `json:"hashespersec"`
	NetworkHashPS    int64   `json:"networkhashps"`
	PooledTx         uint64  `json:"pooledtx"`
	TestNet          bool    `json:"testnet"`
}

GetMiningInfoResult models the data from the getmininginfo command.

type GetNetTotalsCmd

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

GetNetTotalsCmd is a type handling custom marshaling and unmarshaling of getnettotals JSON RPC commands.

func NewGetNetTotalsCmd

func NewGetNetTotalsCmd(id interface{}) (*GetNetTotalsCmd, error)

NewGetNetTotalsCmd creates a new GetNetTotalsCmd.

func (*GetNetTotalsCmd) Id

func (cmd *GetNetTotalsCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetNetTotalsCmd) MarshalJSON

func (cmd *GetNetTotalsCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetNetTotalsCmd) Method

func (cmd *GetNetTotalsCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetNetTotalsCmd) UnmarshalJSON

func (cmd *GetNetTotalsCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetNetTotalsResult

type GetNetTotalsResult struct {
	TotalBytesRecv uint64 `json:"totalbytesrecv"`
	TotalBytesSent uint64 `json:"totalbytessent"`
	TimeMillis     int64  `json:"timemillis"`
}

GetNetTotalsResult models the data returned from the getnettotals command.

type GetNetworkHashPSCmd

type GetNetworkHashPSCmd struct {
	Blocks int
	Height int
	// contains filtered or unexported fields
}

GetNetworkHashPSCmd is a type handling custom marshaling and unmarshaling of getnetworkhashps JSON RPC commands.

func NewGetNetworkHashPSCmd

func NewGetNetworkHashPSCmd(id interface{}, optArgs ...int) (*GetNetworkHashPSCmd, error)

NewGetNetworkHashPSCmd creates a new GetNetworkHashPSCmd.

func (*GetNetworkHashPSCmd) Id

func (cmd *GetNetworkHashPSCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetNetworkHashPSCmd) MarshalJSON

func (cmd *GetNetworkHashPSCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetNetworkHashPSCmd) Method

func (cmd *GetNetworkHashPSCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetNetworkHashPSCmd) UnmarshalJSON

func (cmd *GetNetworkHashPSCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetNetworkInfoCmd

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

GetNetworkInfoCmd is a type handling custom marshaling and unmarshaling of getnetworkinfo JSON RPC commands.

func NewGetNetworkInfoCmd

func NewGetNetworkInfoCmd(id interface{}) (*GetNetworkInfoCmd, error)

NewGetNetworkInfoCmd creates a new GetNetworkInfoCmd.

func (*GetNetworkInfoCmd) Id

func (cmd *GetNetworkInfoCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetNetworkInfoCmd) MarshalJSON

func (cmd *GetNetworkInfoCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetNetworkInfoCmd) Method

func (cmd *GetNetworkInfoCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetNetworkInfoCmd) UnmarshalJSON

func (cmd *GetNetworkInfoCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetNetworkInfoResult

type GetNetworkInfoResult struct {
	Version         int32                  `json:"version"`
	ProtocolVersion int32                  `json:"protocolversion"`
	TimeOffset      int64                  `json:"timeoffset"`
	Connections     int32                  `json:"connections"`
	Networks        []NetworksResult       `json:"networks"`
	RelayFee        float64                `json:"relayfee"`
	LocalAddresses  []LocalAddressesResult `json:"localaddresses"`
}

GetNetworkInfoResult models the data returned from the getnetworkinfo command.

type GetNewAddressCmd

type GetNewAddressCmd struct {
	Account string
	// contains filtered or unexported fields
}

GetNewAddressCmd is a type handling custom marshaling and unmarshaling of getnewaddress JSON RPC commands.

func NewGetNewAddressCmd

func NewGetNewAddressCmd(id interface{}, optArgs ...string) (*GetNewAddressCmd, error)

NewGetNewAddressCmd creates a new GetNewAddressCmd.

func (*GetNewAddressCmd) Id

func (cmd *GetNewAddressCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetNewAddressCmd) MarshalJSON

func (cmd *GetNewAddressCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetNewAddressCmd) Method

func (cmd *GetNewAddressCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetNewAddressCmd) UnmarshalJSON

func (cmd *GetNewAddressCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetPeerInfoCmd

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

GetPeerInfoCmd is a type handling custom marshaling and unmarshaling of getpeerinfo JSON RPC commands.

func NewGetPeerInfoCmd

func NewGetPeerInfoCmd(id interface{}) (*GetPeerInfoCmd, error)

NewGetPeerInfoCmd creates a new GetPeerInfoCmd.

func (*GetPeerInfoCmd) Id

func (cmd *GetPeerInfoCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetPeerInfoCmd) MarshalJSON

func (cmd *GetPeerInfoCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetPeerInfoCmd) Method

func (cmd *GetPeerInfoCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetPeerInfoCmd) UnmarshalJSON

func (cmd *GetPeerInfoCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetPeerInfoResult

type GetPeerInfoResult struct {
	ID             string  `json:"id"`
	Addr           string  `json:"addr"`
	AddrLocal      string  `json:"addrlocal,omitempty"`
	Services       string  `json:"services"`
	LastSend       int64   `json:"lastsend"`
	LastRecv       int64   `json:"lastrecv"`
	BytesSent      uint64  `json:"bytessent"`
	BytesRecv      uint64  `json:"bytesrecv"`
	ConnTime       int64   `json:"conntime"`
	TimeOffset     int64   `json:"timeoffset"`
	PingTime       float64 `json:"pingtime"`
	PingWait       float64 `json:"pingwait,omitempty"`
	Version        uint32  `json:"version"`
	SubVer         string  `json:"subver"`
	Inbound        bool    `json:"inbound"`
	StartingHeight int32   `json:"startingheight"`
	CurrentHeight  int32   `json:"currentheight,omitempty"`
	BanScore       int32   `json:"banscore,omitempty"`
	SyncNode       bool    `json:"syncnode"`
}

GetPeerInfoResult models the data returned from the getpeerinfo command.

type GetRawChangeAddressCmd

type GetRawChangeAddressCmd struct {
	Account string
	// contains filtered or unexported fields
}

GetRawChangeAddressCmd is a type handling custom marshaling and unmarshaling of getrawchangeaddress JSON RPC commands.

func NewGetRawChangeAddressCmd

func NewGetRawChangeAddressCmd(id interface{}, optArgs ...string) (*GetRawChangeAddressCmd, error)

NewGetRawChangeAddressCmd creates a new GetRawChangeAddressCmd.

func (*GetRawChangeAddressCmd) Id

func (cmd *GetRawChangeAddressCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetRawChangeAddressCmd) MarshalJSON

func (cmd *GetRawChangeAddressCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetRawChangeAddressCmd) Method

func (cmd *GetRawChangeAddressCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetRawChangeAddressCmd) UnmarshalJSON

func (cmd *GetRawChangeAddressCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetRawMempoolCmd

type GetRawMempoolCmd struct {
	Verbose bool
	// contains filtered or unexported fields
}

GetRawMempoolCmd is a type handling custom marshaling and unmarshaling of getrawmempool JSON RPC commands.

func NewGetRawMempoolCmd

func NewGetRawMempoolCmd(id interface{}, optArgs ...bool) (*GetRawMempoolCmd, error)

NewGetRawMempoolCmd creates a new GetRawMempoolCmd.

func (*GetRawMempoolCmd) Id

func (cmd *GetRawMempoolCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetRawMempoolCmd) MarshalJSON

func (cmd *GetRawMempoolCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetRawMempoolCmd) Method

func (cmd *GetRawMempoolCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetRawMempoolCmd) UnmarshalJSON

func (cmd *GetRawMempoolCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetRawMempoolResult

type GetRawMempoolResult struct {
	Size             int32    `json:"size"`
	Fee              float64  `json:"fee"`
	Time             int64    `json:"time"`
	Height           int64    `json:"height"`
	StartingPriority float64  `json:"startingpriority"`
	CurrentPriority  float64  `json:"currentpriority"`
	Depends          []string `json:"depends"`
}

GetRawMempoolResult models the data returned from the getrawmempool command.

type GetRawTransactionCmd

type GetRawTransactionCmd struct {
	Txid    string
	Verbose int
	// contains filtered or unexported fields
}

GetRawTransactionCmd is a type handling custom marshaling and unmarshaling of getrawtransaction JSON RPC commands.

func NewGetRawTransactionCmd

func NewGetRawTransactionCmd(id interface{}, txid string, optArgs ...int) (*GetRawTransactionCmd, error)

NewGetRawTransactionCmd creates a new GetRawTransactionCmd.

func (*GetRawTransactionCmd) Id

func (cmd *GetRawTransactionCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetRawTransactionCmd) MarshalJSON

func (cmd *GetRawTransactionCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetRawTransactionCmd) Method

func (cmd *GetRawTransactionCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetRawTransactionCmd) UnmarshalJSON

func (cmd *GetRawTransactionCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetReceivedByAccountCmd

type GetReceivedByAccountCmd struct {
	Account string
	MinConf int
	// contains filtered or unexported fields
}

GetReceivedByAccountCmd is a type handling custom marshaling and unmarshaling of getreceivedbyaccount JSON RPC commands.

func NewGetReceivedByAccountCmd

func NewGetReceivedByAccountCmd(id interface{}, account string, optArgs ...int) (*GetReceivedByAccountCmd, error)

NewGetReceivedByAccountCmd creates a new GetReceivedByAccountCmd.

func (*GetReceivedByAccountCmd) Id

func (cmd *GetReceivedByAccountCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetReceivedByAccountCmd) MarshalJSON

func (cmd *GetReceivedByAccountCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetReceivedByAccountCmd) Method

func (cmd *GetReceivedByAccountCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetReceivedByAccountCmd) UnmarshalJSON

func (cmd *GetReceivedByAccountCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetReceivedByAddressCmd

type GetReceivedByAddressCmd struct {
	Address string
	MinConf int
	// contains filtered or unexported fields
}

GetReceivedByAddressCmd is a type handling custom marshaling and unmarshaling of getreceivedbyaddress JSON RPC commands.

func NewGetReceivedByAddressCmd

func NewGetReceivedByAddressCmd(id interface{}, address string, optArgs ...int) (*GetReceivedByAddressCmd, error)

NewGetReceivedByAddressCmd creates a new GetReceivedByAddressCmd.

func (*GetReceivedByAddressCmd) Id

func (cmd *GetReceivedByAddressCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetReceivedByAddressCmd) MarshalJSON

func (cmd *GetReceivedByAddressCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetReceivedByAddressCmd) Method

func (cmd *GetReceivedByAddressCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetReceivedByAddressCmd) UnmarshalJSON

func (cmd *GetReceivedByAddressCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetTransactionCmd

type GetTransactionCmd struct {
	Txid string
	// contains filtered or unexported fields
}

GetTransactionCmd is a type handling custom marshaling and unmarshaling of gettransaction JSON RPC commands.

func NewGetTransactionCmd

func NewGetTransactionCmd(id interface{}, txid string) (*GetTransactionCmd, error)

NewGetTransactionCmd creates a new GetTransactionCmd.

func (*GetTransactionCmd) Id

func (cmd *GetTransactionCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetTransactionCmd) MarshalJSON

func (cmd *GetTransactionCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetTransactionCmd) Method

func (cmd *GetTransactionCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetTransactionCmd) UnmarshalJSON

func (cmd *GetTransactionCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetTransactionDetailsResult

type GetTransactionDetailsResult struct {
	Account  string  `json:"account"`
	Address  string  `json:"address,omitempty"`
	Category string  `json:"category"`
	Amount   float64 `json:"amount"`
	Fee      float64 `json:"fee,omitempty"`
}

GetTransactionDetailsResult models the details data from the gettransaction command.

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:"txid1"`
	WalletConflicts []string                      `json:"walletconflicts"`
	Time            int64                         `json:"time"`
	TimeReceived    int64                         `json:"timereceived"`
	Details         []GetTransactionDetailsResult `json:"details"`
	Hex             string                        `json:"hex"`
}

GetTransactionResult models the data from the gettransaction command.

type GetTxOutCmd

type GetTxOutCmd struct {
	Txid           string
	Output         int
	IncludeMempool bool
	// contains filtered or unexported fields
}

GetTxOutCmd is a type handling custom marshaling and unmarshaling of gettxout JSON RPC commands.

func NewGetTxOutCmd

func NewGetTxOutCmd(id interface{}, txid string, output int, optArgs ...bool) (*GetTxOutCmd, error)

NewGetTxOutCmd creates a new GetTxOutCmd.

func (*GetTxOutCmd) Id

func (cmd *GetTxOutCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetTxOutCmd) MarshalJSON

func (cmd *GetTxOutCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetTxOutCmd) Method

func (cmd *GetTxOutCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetTxOutCmd) UnmarshalJSON

func (cmd *GetTxOutCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetTxOutResult

type GetTxOutResult struct {
	BestBlock     string         `json:"bestblock"`
	Confirmations int64          `json:"confirmations"`
	Value         float64        `json:"value"`
	DestAddr      DestAddrResult `json:"scriptPubKey1"`
	Version       uint8          `json:"version"`
	Coinbase      bool           `json:"coinbase"`
}

GetTxOutResult models the data from the gettxout command.

type GetTxOutSetInfoCmd

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

GetTxOutSetInfoCmd is a type handling custom marshaling and unmarshaling of gettxoutsetinfo JSON RPC commands.

func NewGetTxOutSetInfoCmd

func NewGetTxOutSetInfoCmd(id interface{}) (*GetTxOutSetInfoCmd, error)

NewGetTxOutSetInfoCmd creates a new GetTxOutSetInfoCmd.

func (*GetTxOutSetInfoCmd) Id

func (cmd *GetTxOutSetInfoCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetTxOutSetInfoCmd) MarshalJSON

func (cmd *GetTxOutSetInfoCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetTxOutSetInfoCmd) Method

func (cmd *GetTxOutSetInfoCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetTxOutSetInfoCmd) UnmarshalJSON

func (cmd *GetTxOutSetInfoCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetWorkCmd

type GetWorkCmd struct {
	Data string `json:"data,omitempty"`
	// contains filtered or unexported fields
}

GetWorkCmd is a type handling custom marshaling and unmarshaling of getwork JSON RPC commands.

func NewGetWorkCmd

func NewGetWorkCmd(id interface{}, optArgs ...string) (*GetWorkCmd, error)

NewGetWorkCmd creates a new GetWorkCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*GetWorkCmd) Id

func (cmd *GetWorkCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*GetWorkCmd) MarshalJSON

func (cmd *GetWorkCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*GetWorkCmd) Method

func (cmd *GetWorkCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*GetWorkCmd) UnmarshalJSON

func (cmd *GetWorkCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type GetWorkResult

type GetWorkResult struct {
	Data     string `json:"data"`
	Hash1    string `json:"hash1"`
	Midstate string `json:"midstate"`
	Target   string `json:"target"`
}

GetWorkResult models the data from the getwork command.

type HelpCmd

type HelpCmd struct {
	Command string
	// contains filtered or unexported fields
}

HelpCmd is a type handling custom marshaling and unmarshaling of help JSON RPC commands.

func NewHelpCmd

func NewHelpCmd(id interface{}, optArgs ...string) (*HelpCmd, error)

NewHelpCmd creates a new HelpCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*HelpCmd) Id

func (cmd *HelpCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*HelpCmd) MarshalJSON

func (cmd *HelpCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*HelpCmd) Method

func (cmd *HelpCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*HelpCmd) UnmarshalJSON

func (cmd *HelpCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type ImportAddressCmd

type ImportAddressCmd struct {
	Address string
	Rescan  bool
	// contains filtered or unexported fields
}

ImportAddressCmd is a type handling custom marshaling and unmarshaling of importaddress JSON RPC commands.

func NewImportAddressCmd

func NewImportAddressCmd(id interface{}, address string, optArgs ...interface{}) (*ImportAddressCmd, error)

NewImportAddressCmd creates a new ImportAddressCmd.

func (*ImportAddressCmd) Id

func (cmd *ImportAddressCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ImportAddressCmd) MarshalJSON

func (cmd *ImportAddressCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ImportAddressCmd) Method

func (cmd *ImportAddressCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ImportAddressCmd) UnmarshalJSON

func (cmd *ImportAddressCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type ImportPrivKeyCmd

type ImportPrivKeyCmd struct {
	PrivKey string
	Label   string
	Rescan  bool
	// contains filtered or unexported fields
}

ImportPrivKeyCmd is a type handling custom marshaling and unmarshaling of importprivkey JSON RPC commands.

func NewImportPrivKeyCmd

func NewImportPrivKeyCmd(id interface{}, privkey string, optArgs ...interface{}) (*ImportPrivKeyCmd, error)

NewImportPrivKeyCmd creates a new ImportPrivKeyCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ImportPrivKeyCmd) Id

func (cmd *ImportPrivKeyCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ImportPrivKeyCmd) MarshalJSON

func (cmd *ImportPrivKeyCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ImportPrivKeyCmd) Method

func (cmd *ImportPrivKeyCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ImportPrivKeyCmd) UnmarshalJSON

func (cmd *ImportPrivKeyCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type ImportPubKeyCmd

type ImportPubKeyCmd struct {
	PubKey string
	Rescan bool
	// contains filtered or unexported fields
}

ImportPubKeyCmd is a type handling custom marshaling and unmarshaling of importpubkey JSON RPC commands.

func NewImportPubKeyCmd

func NewImportPubKeyCmd(id interface{}, pubkey string, optArgs ...interface{}) (*ImportPubKeyCmd, error)

NewImportPubKeyCmd creates a new ImportPubKeyCmd.

func (*ImportPubKeyCmd) Id

func (cmd *ImportPubKeyCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ImportPubKeyCmd) MarshalJSON

func (cmd *ImportPubKeyCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ImportPubKeyCmd) Method

func (cmd *ImportPubKeyCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ImportPubKeyCmd) UnmarshalJSON

func (cmd *ImportPubKeyCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type ImportWalletCmd

type ImportWalletCmd struct {
	Filename string
	// contains filtered or unexported fields
}

ImportWalletCmd is a type handling custom marshaling and unmarshaling of importwallet JSON RPC commands.

func NewImportWalletCmd

func NewImportWalletCmd(id interface{}, filename string) (*ImportWalletCmd, error)

NewImportWalletCmd creates a new ImportWalletCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ImportWalletCmd) Id

func (cmd *ImportWalletCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ImportWalletCmd) MarshalJSON

func (cmd *ImportWalletCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ImportWalletCmd) Method

func (cmd *ImportWalletCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ImportWalletCmd) UnmarshalJSON

func (cmd *ImportWalletCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type InfoResult

type InfoResult struct {
	Version         int32   `json:"version"`
	ProtocolVersion int32   `json:"protocolversion"`
	WalletVersion   int32   `json:"walletversion,omitempty"`
	Balance         float64 `json:"balance,omitempty"`
	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,omitempty"`
	KeypoolSize     int32   `json:"keypoolsize,omitempty"`
	UnlockedUntil   int64   `json:"unlocked_until,omitempty"`
	PaytxFee        float64 `json:"paytxfee,omitempty"`
	RelayFee        float64 `json:"relayfee"`
	Errors          string  `json:"errors"`
}

InfoResult contains the data returned by the getinfo command.

type InvalidateBlockCmd

type InvalidateBlockCmd struct {
	BlockHash string
	// contains filtered or unexported fields
}

InvalidateBlockCmd is a type handling custom marshaling and unmarshaling of invalidateblock JSON RPC commands.

func NewInvalidateBlockCmd

func NewInvalidateBlockCmd(id interface{}, blockhash string) (*InvalidateBlockCmd, error)

NewInvalidateBlockCmd creates a new InvalidateBlockCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*InvalidateBlockCmd) Id

func (cmd *InvalidateBlockCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*InvalidateBlockCmd) MarshalJSON

func (cmd *InvalidateBlockCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*InvalidateBlockCmd) Method

func (cmd *InvalidateBlockCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*InvalidateBlockCmd) UnmarshalJSON

func (cmd *InvalidateBlockCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type KeyPoolRefillCmd

type KeyPoolRefillCmd struct {
	NewSize uint
	// contains filtered or unexported fields
}

KeyPoolRefillCmd is a type handling custom marshaling and unmarshaling of keypoolrefill JSON RPC commands.

func NewKeyPoolRefillCmd

func NewKeyPoolRefillCmd(id interface{}, optArgs ...uint) (*KeyPoolRefillCmd, error)

NewKeyPoolRefillCmd creates a new KeyPoolRefillCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*KeyPoolRefillCmd) Id

func (cmd *KeyPoolRefillCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*KeyPoolRefillCmd) MarshalJSON

func (cmd *KeyPoolRefillCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*KeyPoolRefillCmd) Method

func (cmd *KeyPoolRefillCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*KeyPoolRefillCmd) UnmarshalJSON

func (cmd *KeyPoolRefillCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type ListAccountsCmd

type ListAccountsCmd struct {
	MinConf int
	// contains filtered or unexported fields
}

ListAccountsCmd is a type handling custom marshaling and unmarshaling of listaccounts JSON RPC commands.

func NewListAccountsCmd

func NewListAccountsCmd(id interface{}, optArgs ...int) (*ListAccountsCmd, error)

NewListAccountsCmd creates a new ListAccountsCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ListAccountsCmd) Id

func (cmd *ListAccountsCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ListAccountsCmd) MarshalJSON

func (cmd *ListAccountsCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ListAccountsCmd) Method

func (cmd *ListAccountsCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ListAccountsCmd) UnmarshalJSON

func (cmd *ListAccountsCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type ListAddressGroupingsCmd

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

ListAddressGroupingsCmd is a type handling custom marshaling and unmarshaling of listaddressgroupings JSON RPC commands.

func NewListAddressGroupingsCmd

func NewListAddressGroupingsCmd(id interface{}) (*ListAddressGroupingsCmd, error)

NewListAddressGroupingsCmd creates a new ListAddressGroupingsCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ListAddressGroupingsCmd) Id

func (cmd *ListAddressGroupingsCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ListAddressGroupingsCmd) MarshalJSON

func (cmd *ListAddressGroupingsCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ListAddressGroupingsCmd) Method

func (cmd *ListAddressGroupingsCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ListAddressGroupingsCmd) UnmarshalJSON

func (cmd *ListAddressGroupingsCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type ListLockUnspentCmd

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

ListLockUnspentCmd is a type handling custom marshaling and unmarshaling of listlockunspent JSON RPC commands.

func NewListLockUnspentCmd

func NewListLockUnspentCmd(id interface{}) (*ListLockUnspentCmd, error)

NewListLockUnspentCmd creates a new ListLockUnspentCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ListLockUnspentCmd) Id

func (cmd *ListLockUnspentCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ListLockUnspentCmd) MarshalJSON

func (cmd *ListLockUnspentCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ListLockUnspentCmd) Method

func (cmd *ListLockUnspentCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ListLockUnspentCmd) UnmarshalJSON

func (cmd *ListLockUnspentCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type ListReceivedByAccountCmd

type ListReceivedByAccountCmd struct {
	MinConf      int
	IncludeEmpty bool
	// contains filtered or unexported fields
}

ListReceivedByAccountCmd is a type handling custom marshaling and unmarshaling of listreceivedbyaccount JSON RPC commands.

func NewListReceivedByAccountCmd

func NewListReceivedByAccountCmd(id interface{}, optArgs ...interface{}) (*ListReceivedByAccountCmd, error)

NewListReceivedByAccountCmd creates a new ListReceivedByAccountCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ListReceivedByAccountCmd) Id

func (cmd *ListReceivedByAccountCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ListReceivedByAccountCmd) MarshalJSON

func (cmd *ListReceivedByAccountCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ListReceivedByAccountCmd) Method

func (cmd *ListReceivedByAccountCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ListReceivedByAccountCmd) UnmarshalJSON

func (cmd *ListReceivedByAccountCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

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
	IncludeEmpty bool
	// contains filtered or unexported fields
}

ListReceivedByAddressCmd is a type handling custom marshaling and unmarshaling of listreceivedbyaddress JSON RPC commands.

func NewListReceivedByAddressCmd

func NewListReceivedByAddressCmd(id interface{}, optArgs ...interface{}) (*ListReceivedByAddressCmd, error)

NewListReceivedByAddressCmd creates a new ListReceivedByAddressCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ListReceivedByAddressCmd) Id

func (cmd *ListReceivedByAddressCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ListReceivedByAddressCmd) MarshalJSON

func (cmd *ListReceivedByAddressCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ListReceivedByAddressCmd) Method

func (cmd *ListReceivedByAddressCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ListReceivedByAddressCmd) UnmarshalJSON

func (cmd *ListReceivedByAddressCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

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
	// contains filtered or unexported fields
}

ListSinceBlockCmd is a type handling custom marshaling and unmarshaling of listsinceblock JSON RPC commands.

func NewListSinceBlockCmd

func NewListSinceBlockCmd(id interface{}, optArgs ...interface{}) (*ListSinceBlockCmd, error)

NewListSinceBlockCmd creates a new ListSinceBlockCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ListSinceBlockCmd) Id

func (cmd *ListSinceBlockCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ListSinceBlockCmd) MarshalJSON

func (cmd *ListSinceBlockCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ListSinceBlockCmd) Method

func (cmd *ListSinceBlockCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ListSinceBlockCmd) UnmarshalJSON

func (cmd *ListSinceBlockCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

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
	From    int
	// contains filtered or unexported fields
}

ListTransactionsCmd is a type handling custom marshaling and unmarshaling of listtransactions JSON RPC commands.

func NewListTransactionsCmd

func NewListTransactionsCmd(id interface{}, optArgs ...interface{}) (*ListTransactionsCmd, error)

NewListTransactionsCmd creates a new ListTransactionsCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ListTransactionsCmd) Id

func (cmd *ListTransactionsCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ListTransactionsCmd) MarshalJSON

func (cmd *ListTransactionsCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ListTransactionsCmd) Method

func (cmd *ListTransactionsCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ListTransactionsCmd) UnmarshalJSON

func (cmd *ListTransactionsCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type ListTransactionsResult

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

ListTransactionsResult models the data from the listtransactions command.

type ListUnspentCmd

type ListUnspentCmd struct {
	MinConf   int
	MaxConf   int
	Addresses []string
	// contains filtered or unexported fields
}

ListUnspentCmd is a type handling custom marshaling and unmarshaling of listunspent JSON RPC commands.

func NewListUnspentCmd

func NewListUnspentCmd(id interface{}, optArgs ...interface{}) (*ListUnspentCmd, error)

NewListUnspentCmd creates a new ListUnspentCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ListUnspentCmd) Id

func (cmd *ListUnspentCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ListUnspentCmd) MarshalJSON

func (cmd *ListUnspentCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ListUnspentCmd) Method

func (cmd *ListUnspentCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ListUnspentCmd) UnmarshalJSON

func (cmd *ListUnspentCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type ListUnspentResult

type ListUnspentResult struct {
	TxId          string  `json:"txid6"`
	Vout          uint32  `json:"vout"`
	Address       string  `json:"address"`
	Account       string  `json:"account"`
	DestAddr      string  `json:"scriptPubKey3"`
	RedeemScript  string  `json:"redeemScript,omitempty"`
	Amount        float64 `json:"amount"`
	Confirmations int64   `json:"confirmations"`
}

ListUnspentResult models a successful response from the listunspent request.

type LocalAddressesResult

type LocalAddressesResult struct {
	Address string `json:"address"`
	Port    uint16 `json:"port"`
	Score   int32  `json:"score"`
}

LocalAddressesResult models the localaddresses data from the getnetworkinfo command.

type LockUnspentCmd

type LockUnspentCmd struct {
	Unlock       bool
	Transactions []TransactionInput
	// contains filtered or unexported fields
}

LockUnspentCmd is a type handling custom marshaling and unmarshaling of lockunspent JSON RPC commands.

func NewLockUnspentCmd

func NewLockUnspentCmd(id interface{}, unlock bool, optArgs ...[]TransactionInput) (*LockUnspentCmd, error)

NewLockUnspentCmd creates a new LockUnspentCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*LockUnspentCmd) Id

func (cmd *LockUnspentCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*LockUnspentCmd) MarshalJSON

func (cmd *LockUnspentCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*LockUnspentCmd) Method

func (cmd *LockUnspentCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*LockUnspentCmd) UnmarshalJSON

func (cmd *LockUnspentCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type Message

type Message struct {
	Jsonrpc string      `json:"jsonrpc"`
	Id      interface{} `json:"id,omitempty"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
}

Message contains a message to be sent to the bitcoin client.

type MoveCmd

type MoveCmd struct {
	FromAccount string
	ToAccount   string
	Amount      int64
	MinConf     int
	Comment     string
	// contains filtered or unexported fields
}

MoveCmd is a type handling custom marshaling and unmarshaling of move JSON RPC commands.

func NewMoveCmd

func NewMoveCmd(id interface{}, fromaccount string, toaccount string, amount int64, optArgs ...interface{}) (*MoveCmd, error)

NewMoveCmd creates a new MoveCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*MoveCmd) Id

func (cmd *MoveCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*MoveCmd) MarshalJSON

func (cmd *MoveCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*MoveCmd) Method

func (cmd *MoveCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*MoveCmd) UnmarshalJSON

func (cmd *MoveCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type NetworksResult

type NetworksResult struct {
	Name      string `json:"name"`
	Limited   bool   `json:"limited"`
	Reachable bool   `json:"reachable"`
	Proxy     string `json:"proxy"`
}

NetworksResult models the networks data from the getnetworkinfo command.

type PingCmd

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

PingCmd is a type handling custom marshaling and unmarshaling of ping JSON RPC commands.

func NewPingCmd

func NewPingCmd(id interface{}) (*PingCmd, error)

NewPingCmd creates a new PingCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*PingCmd) Id

func (cmd *PingCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*PingCmd) MarshalJSON

func (cmd *PingCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*PingCmd) Method

func (cmd *PingCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*PingCmd) UnmarshalJSON

func (cmd *PingCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type RawCmd

type RawCmd struct {
	Jsonrpc string            `json:"jsonrpc"`
	Id      interface{}       `json:"id"`
	Method  string            `json:"method"`
	Params  []json.RawMessage `json:"params"`
}

RawCmd is a type for unmarshaling raw commands into before the custom command type is set. Other packages may register their own RawCmd to Cmd converters by calling RegisterCustomCmd.

func NewRawCmd

func NewRawCmd(id interface{}, method string, params []interface{}) (*RawCmd, error)

NewRawCmd returns a new raw command given the provided id, method, and parameters. The parameters are marshalled into a json.RawMessage for the Params field of the returned raw command.

type RawCmdParser

type RawCmdParser func(*RawCmd) (Cmd, error)

RawCmdParser is a function to create a custom Cmd from a RawCmd.

type RawTxInput

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

RawTxInput models the data needed for a raw tx input.

type ReconsiderBlockCmd

type ReconsiderBlockCmd struct {
	BlockHash string
	// contains filtered or unexported fields
}

ReconsiderBlockCmd is a type handling custom marshaling and unmarshaling of reconsiderblock JSON RPC commands.

func NewReconsiderBlockCmd

func NewReconsiderBlockCmd(id interface{}, blockhash string) (*ReconsiderBlockCmd, error)

NewReconsiderBlockCmd creates a new ReconsiderBlockCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ReconsiderBlockCmd) Id

func (cmd *ReconsiderBlockCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ReconsiderBlockCmd) MarshalJSON

func (cmd *ReconsiderBlockCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ReconsiderBlockCmd) Method

func (cmd *ReconsiderBlockCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ReconsiderBlockCmd) UnmarshalJSON

func (cmd *ReconsiderBlockCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type Reply

type Reply struct {
	Result interface{} `json:"result"`
	Error  *Error      `json:"error"`
	// This has to be a pointer for go to put a null in it when empty.
	Id *interface{} `json:"id"`
}

Reply is the general form of the reply from the bitcoin client. The form of the Result part varies from one command to the next so it is currently implemented as an interface.

func ReadResultCmd

func ReadResultCmd(cmd string, message []byte) (Reply, error)

ReadResultCmd unmarshalls the json reply with data struct for specific commands or an interface if it is not a command where we already have a struct ready.

func RpcCommand

func RpcCommand(user string, password string, server string, message []byte) (Reply, error)

RpcCommand takes a message generated from one of the routines above along with the login/server info, sends it, and gets a reply, returning a go struct with the result.

func RpcSend

func RpcSend(user string, password string, server string, cmd Cmd) (Reply, error)

RpcSend sends the passed command to the provided server using the provided authentication details, waits for a reply, and returns a Go struct with the result.

func TlsRpcCommand

func TlsRpcCommand(user string, password string, server string, message []byte,
	certificates []byte, skipverify bool) (Reply, error)

TlsRpcCommand takes a message generated from one of the routines above along with the login/server information and any relavent PEM encoded certificates chains. It sends the command via https and returns a go struct with the result.

func TlsRpcSend

func TlsRpcSend(user string, password string, server string, cmd Cmd,
	certificates []byte, skipVerify bool) (Reply, error)

TlsRpcSend sends the passed command to the provided server using the provided authentication details and PEM encoded certificate chain, waits for a reply, and returns a Go struct with the result.

type ReplyParser

type ReplyParser func(json.RawMessage) (interface{}, error)

ReplyParser is a function a custom Cmd can use to unmarshal the results of a reply into a concrete struct.

type SearchRawTransactionsCmd

type SearchRawTransactionsCmd struct {
	Address string
	Verbose int
	Skip    int
	Count   int
	// contains filtered or unexported fields
}

SearchRawTransactionsCmd is a type handling custom marshaling and unmarshaling of sendrawtransactions JSON RPC commands.

func NewSearchRawTransactionsCmd

func NewSearchRawTransactionsCmd(id interface{}, address string,
	optArgs ...interface{}) (*SearchRawTransactionsCmd, error)

NewSearchRawTransactionsCmd creates a new SearchRawTransactionsCmd.

func (*SearchRawTransactionsCmd) Id

func (cmd *SearchRawTransactionsCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*SearchRawTransactionsCmd) MarshalJSON

func (cmd *SearchRawTransactionsCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*SearchRawTransactionsCmd) Method

func (cmd *SearchRawTransactionsCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*SearchRawTransactionsCmd) UnmarshalJSON

func (cmd *SearchRawTransactionsCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SendFromCmd

type SendFromCmd struct {
	FromAccount string
	ToAddress   string
	Amount      int64
	MinConf     int
	Comment     string
	CommentTo   string
	// contains filtered or unexported fields
}

SendFromCmd is a type handling custom marshaling and unmarshaling of sendfrom JSON RPC commands.

func NewSendFromCmd

func NewSendFromCmd(id interface{}, fromaccount string, toaddress string, amount int64, optArgs ...interface{}) (*SendFromCmd, error)

NewSendFromCmd creates a new SendFromCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*SendFromCmd) Id

func (cmd *SendFromCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*SendFromCmd) MarshalJSON

func (cmd *SendFromCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*SendFromCmd) Method

func (cmd *SendFromCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*SendFromCmd) UnmarshalJSON

func (cmd *SendFromCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SendManyCmd

type SendManyCmd struct {
	FromAccount string
	Amounts     map[string]int64
	MinConf     int
	Comment     string
	// contains filtered or unexported fields
}

SendManyCmd is a type handling custom marshaling and unmarshaling of sendmany JSON RPC commands.

func NewSendManyCmd

func NewSendManyCmd(id interface{}, fromaccount string, amounts map[string]int64, optArgs ...interface{}) (*SendManyCmd, error)

NewSendManyCmd creates a new SendManyCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*SendManyCmd) Id

func (cmd *SendManyCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*SendManyCmd) MarshalJSON

func (cmd *SendManyCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*SendManyCmd) Method

func (cmd *SendManyCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*SendManyCmd) UnmarshalJSON

func (cmd *SendManyCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SendRawTransactionCmd

type SendRawTransactionCmd struct {
	HexTx         string
	AllowHighFees bool
	// contains filtered or unexported fields
}

SendRawTransactionCmd is a type handling custom marshaling and unmarshaling of sendrawtransaction JSON RPC commands.

func NewSendRawTransactionCmd

func NewSendRawTransactionCmd(id interface{}, hextx string, optArgs ...bool) (*SendRawTransactionCmd, error)

NewSendRawTransactionCmd creates a new SendRawTransactionCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*SendRawTransactionCmd) Id

func (cmd *SendRawTransactionCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*SendRawTransactionCmd) MarshalJSON

func (cmd *SendRawTransactionCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*SendRawTransactionCmd) Method

func (cmd *SendRawTransactionCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*SendRawTransactionCmd) UnmarshalJSON

func (cmd *SendRawTransactionCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SendToAddressCmd

type SendToAddressCmd struct {
	Address   string
	Amount    int64
	Comment   string
	CommentTo string
	// contains filtered or unexported fields
}

SendToAddressCmd is a type handling custom marshaling and unmarshaling of sendtoaddress JSON RPC commands.

func NewSendToAddressCmd

func NewSendToAddressCmd(id interface{}, address string, amount int64, optArgs ...interface{}) (*SendToAddressCmd, error)

NewSendToAddressCmd creates a new SendToAddressCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*SendToAddressCmd) Id

func (cmd *SendToAddressCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*SendToAddressCmd) MarshalJSON

func (cmd *SendToAddressCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*SendToAddressCmd) Method

func (cmd *SendToAddressCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*SendToAddressCmd) UnmarshalJSON

func (cmd *SendToAddressCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SetAccountCmd

type SetAccountCmd struct {
	Address string
	Account string
	// contains filtered or unexported fields
}

SetAccountCmd is a type handling custom marshaling and unmarshaling of setaccount JSON RPC commands.

func NewSetAccountCmd

func NewSetAccountCmd(id interface{}, address string, account string) (*SetAccountCmd, error)

NewSetAccountCmd creates a new SetAccountCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*SetAccountCmd) Id

func (cmd *SetAccountCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*SetAccountCmd) MarshalJSON

func (cmd *SetAccountCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*SetAccountCmd) Method

func (cmd *SetAccountCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*SetAccountCmd) UnmarshalJSON

func (cmd *SetAccountCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SetGenerateCmd

type SetGenerateCmd struct {
	Generate     bool
	GenProcLimit int
	// contains filtered or unexported fields
}

SetGenerateCmd is a type handling custom marshaling and unmarshaling of setgenerate JSON RPC commands.

func NewSetGenerateCmd

func NewSetGenerateCmd(id interface{}, generate bool, optArgs ...int) (*SetGenerateCmd, error)

NewSetGenerateCmd creates a new SetGenerateCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*SetGenerateCmd) Id

func (cmd *SetGenerateCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*SetGenerateCmd) MarshalJSON

func (cmd *SetGenerateCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*SetGenerateCmd) Method

func (cmd *SetGenerateCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*SetGenerateCmd) UnmarshalJSON

func (cmd *SetGenerateCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SetTxFeeCmd

type SetTxFeeCmd struct {
	Amount int64
	// contains filtered or unexported fields
}

SetTxFeeCmd is a type handling custom marshaling and unmarshaling of settxfee JSON RPC commands.

func NewSetTxFeeCmd

func NewSetTxFeeCmd(id interface{}, amount int64) (*SetTxFeeCmd, error)

NewSetTxFeeCmd creates a new SetTxFeeCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*SetTxFeeCmd) Id

func (cmd *SetTxFeeCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*SetTxFeeCmd) MarshalJSON

func (cmd *SetTxFeeCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*SetTxFeeCmd) Method

func (cmd *SetTxFeeCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*SetTxFeeCmd) UnmarshalJSON

func (cmd *SetTxFeeCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SignMessageCmd

type SignMessageCmd struct {
	Address string
	Message string
	// contains filtered or unexported fields
}

SignMessageCmd is a type handling custom marshaling and unmarshaling of signmessage JSON RPC commands.

func NewSignMessageCmd

func NewSignMessageCmd(id interface{}, address string, message string) (*SignMessageCmd, error)

NewSignMessageCmd creates a new SignMessageCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*SignMessageCmd) Id

func (cmd *SignMessageCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*SignMessageCmd) MarshalJSON

func (cmd *SignMessageCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*SignMessageCmd) Method

func (cmd *SignMessageCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*SignMessageCmd) UnmarshalJSON

func (cmd *SignMessageCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SignRawTransactionCmd

type SignRawTransactionCmd struct {
	RawTx    string
	Inputs   []RawTxInput
	PrivKeys []string
	Flags    string
	// contains filtered or unexported fields
}

SignRawTransactionCmd is a type handling custom marshaling and unmarshaling of signrawtransaction JSON RPC commands.

func NewSignRawTransactionCmd

func NewSignRawTransactionCmd(id interface{}, rawTx string, optArgs ...interface{}) (*SignRawTransactionCmd, error)

NewSignRawTransactionCmd creates a new SignRawTransactionCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*SignRawTransactionCmd) Id

func (cmd *SignRawTransactionCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*SignRawTransactionCmd) MarshalJSON

func (cmd *SignRawTransactionCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*SignRawTransactionCmd) Method

func (cmd *SignRawTransactionCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*SignRawTransactionCmd) UnmarshalJSON

func (cmd *SignRawTransactionCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SignRawTransactionResult

type SignRawTransactionResult struct {
	Hex      string `json:"hex"`
	Complete bool   `json:"complete"`
}

SignRawTransactionResult models the data from the signrawtransaction command.

type StopCmd

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

StopCmd is a type handling custom marshaling and unmarshaling of stop JSON RPC commands.

func NewStopCmd

func NewStopCmd(id interface{}) (*StopCmd, error)

NewStopCmd creates a new StopCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*StopCmd) Id

func (cmd *StopCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*StopCmd) MarshalJSON

func (cmd *StopCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*StopCmd) Method

func (cmd *StopCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*StopCmd) UnmarshalJSON

func (cmd *StopCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SubmitBlockCmd

type SubmitBlockCmd struct {
	HexBlock string
	Options  *SubmitBlockOptions
	// contains filtered or unexported fields
}

SubmitBlockCmd is a type handling custom marshaling and unmarshaling of submitblock JSON RPC commands.

func NewSubmitBlockCmd

func NewSubmitBlockCmd(id interface{}, hexblock string, optArgs ...*SubmitBlockOptions) (*SubmitBlockCmd, error)

NewSubmitBlockCmd creates a new SubmitBlockCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*SubmitBlockCmd) Id

func (cmd *SubmitBlockCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*SubmitBlockCmd) MarshalJSON

func (cmd *SubmitBlockCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*SubmitBlockCmd) Method

func (cmd *SubmitBlockCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*SubmitBlockCmd) UnmarshalJSON

func (cmd *SubmitBlockCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type SubmitBlockOptions

type SubmitBlockOptions struct {
	// must be provided if server provided a workid with template.
	WorkID string `json:"workid,omitempty"`
}

SubmitBlockOptions represents the optional options struct provided with a SubmitBlockCmd command.

type TemplateRequest

type TemplateRequest struct {
	Mode         string   `json:"mode,omitempty"`
	Capabilities []string `json:"capabilities,omitempty"`

	// Optional long polling.
	LongPollID string `json:"longpollid,omitempty"`

	// Optional template tweaking.  SigOpLimit and SizeLimit can be int64
	// or bool.
	SigOpLimit interface{} `json:"sigoplimit,omitempty"`
	SizeLimit  interface{} `json:"sizelimit,omitempty"`
	MaxVersion uint32      `json:"maxversion,omitempty"`

	// Basic pool extension from BIP 0023.
	Target string `json:"target,omitempty"`

	// Block proposal from BIP 0023.  Data is only provided when Mode is
	// "proposal".
	Data   string `json:"data,omitempty"`
	WorkID string `json:"workid,omitempty"`
}

TemplateRequest is a request object as defined in BIP22 (https://en.bitcoin.it/wiki/BIP_0022), it is optionally provided as an pointer argument to GetBlockTemplateCmd.

type TransactionInput

type TransactionInput struct {
	Txid string `json:"txid"`
	Vout uint32 `json:"vout"`
}

TransactionInput represents the inputs to a transaction. Specifically a transactionsha and output number pair.

type TxRawDecodeResult

type TxRawDecodeResult struct {
	Txid     string `json:"txid"`
	Version  uint8  `json:"version"`
	Locktime int64  `json:"locktime"`
	Vin      []Vin  `json:"vin"`
	Vout     []Vout `json:"vout"`
}

TxRawDecodeResult models the data from the decoderawtransaction command.

type TxRawResult

type TxRawResult struct {
	Hex           string   `json:"hex"`
	Txid          string   `json:"txid"`
	Version       uint8    `json:"version"`
	LockTime      int64    `json:"locktime"`
	Vin           []Vin    `json:"vin"`
	Vout          []Vout   `json:"vout"`
	Vecout        []VECout `json:"vecout"`
	BlockHash     string   `json:"blockhash,omitempty"`
	Confirmations uint64   `json:"confirmations"`
	Time          int64    `json:"time,omitempty"`
	Blocktime     int64    `json:"blocktime,omitempty"`
}

TxRawResult models the data from the getrawtransaction and sendrawtransaction commands

type VECout

type VECout struct {
	Value  int64        `json:"value"`
	ECAddr ECAddrResult `json:"ECAddress"`
}

type ValidateAddressCmd

type ValidateAddressCmd struct {
	Address string
	// contains filtered or unexported fields
}

ValidateAddressCmd is a type handling custom marshaling and unmarshaling of validateaddress JSON RPC commands.

func NewValidateAddressCmd

func NewValidateAddressCmd(id interface{}, address string) (*ValidateAddressCmd, error)

NewValidateAddressCmd creates a new ValidateAddressCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*ValidateAddressCmd) Id

func (cmd *ValidateAddressCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*ValidateAddressCmd) MarshalJSON

func (cmd *ValidateAddressCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*ValidateAddressCmd) Method

func (cmd *ValidateAddressCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*ValidateAddressCmd) UnmarshalJSON

func (cmd *ValidateAddressCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

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"`
	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 from the validateaddress command.

type VerifyChainCmd

type VerifyChainCmd struct {
	CheckLevel int32
	CheckDepth int32
	// contains filtered or unexported fields
}

VerifyChainCmd is a type handling custom marshaling and unmarshaling of verifychain JSON RPC commands.

func NewVerifyChainCmd

func NewVerifyChainCmd(id interface{}, optArgs ...int32) (*VerifyChainCmd, error)

NewVerifyChainCmd creates a new VerifyChainCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*VerifyChainCmd) Id

func (cmd *VerifyChainCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*VerifyChainCmd) MarshalJSON

func (cmd *VerifyChainCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*VerifyChainCmd) Method

func (cmd *VerifyChainCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*VerifyChainCmd) UnmarshalJSON

func (cmd *VerifyChainCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type VerifyMessageCmd

type VerifyMessageCmd struct {
	Address   string
	Signature string
	Message   string
	// contains filtered or unexported fields
}

VerifyMessageCmd is a type handling custom marshaling and unmarshaling of verifymessage JSON RPC commands.

func NewVerifyMessageCmd

func NewVerifyMessageCmd(id interface{}, address string, signature string,
	message string) (*VerifyMessageCmd, error)

NewVerifyMessageCmd creates a new VerifyMessageCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*VerifyMessageCmd) Id

func (cmd *VerifyMessageCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*VerifyMessageCmd) MarshalJSON

func (cmd *VerifyMessageCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*VerifyMessageCmd) Method

func (cmd *VerifyMessageCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*VerifyMessageCmd) UnmarshalJSON

func (cmd *VerifyMessageCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type Vin

type Vin struct {
	Coinbase string `json:"coinbase"`
	Txid     string `json:"txid"`
	Vout     uint32 `json:"vout"`
}

Vin models parts of the tx data. It is defined seperately since both getrawtransaction, sendrawtransaction, and decoderawtransaction use the same structure.

func (*Vin) IsCoinBase

func (v *Vin) IsCoinBase() bool

IsCoinBase returns a bool to show if a Vin is a Coinbase one or not.

func (*Vin) MarshalJSON

func (v *Vin) MarshalJSON() ([]byte, error)

MarshalJSON provides a custom Marshal method for Vin.

type Vout

type Vout struct {
	Value    float64        `json:"value"`
	N        uint32         `json:"n"`
	DestAddr DestAddrResult `json:"DestAddress"`
}

Vout models parts of the tx data. It is defined seperately since both getrawtransaction, sendrawtransaction, and decoderawtransaction use the same structure.

type WalletLockCmd

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

WalletLockCmd is a type handling custom marshaling and unmarshaling of walletlock JSON RPC commands.

func NewWalletLockCmd

func NewWalletLockCmd(id interface{}) (*WalletLockCmd, error)

NewWalletLockCmd creates a new WalletLockCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*WalletLockCmd) Id

func (cmd *WalletLockCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*WalletLockCmd) MarshalJSON

func (cmd *WalletLockCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*WalletLockCmd) Method

func (cmd *WalletLockCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*WalletLockCmd) UnmarshalJSON

func (cmd *WalletLockCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type WalletPassphraseChangeCmd

type WalletPassphraseChangeCmd struct {
	OldPassphrase string
	NewPassphrase string
	// contains filtered or unexported fields
}

WalletPassphraseChangeCmd is a type handling custom marshaling and unmarshaling of walletpassphrasechange JSON RPC commands.

func NewWalletPassphraseChangeCmd

func NewWalletPassphraseChangeCmd(id interface{}, oldpassphrase, newpassphrase string) (*WalletPassphraseChangeCmd, error)

NewWalletPassphraseChangeCmd creates a new WalletPassphraseChangeCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*WalletPassphraseChangeCmd) Id

func (cmd *WalletPassphraseChangeCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*WalletPassphraseChangeCmd) MarshalJSON

func (cmd *WalletPassphraseChangeCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*WalletPassphraseChangeCmd) Method

func (cmd *WalletPassphraseChangeCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*WalletPassphraseChangeCmd) UnmarshalJSON

func (cmd *WalletPassphraseChangeCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

type WalletPassphraseCmd

type WalletPassphraseCmd struct {
	Passphrase string
	Timeout    int64
	// contains filtered or unexported fields
}

WalletPassphraseCmd is a type handling custom marshaling and unmarshaling of walletpassphrase JSON RPC commands.

func NewWalletPassphraseCmd

func NewWalletPassphraseCmd(id interface{}, passphrase string, timeout int64) (*WalletPassphraseCmd, error)

NewWalletPassphraseCmd creates a new WalletPassphraseCmd. Optionally a pointer to a TemplateRequest may be provided.

func (*WalletPassphraseCmd) Id

func (cmd *WalletPassphraseCmd) Id() interface{}

Id satisfies the Cmd interface by returning the id of the command.

func (*WalletPassphraseCmd) MarshalJSON

func (cmd *WalletPassphraseCmd) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface.

func (*WalletPassphraseCmd) Method

func (cmd *WalletPassphraseCmd) Method() string

Method satisfies the Cmd interface by returning the json method.

func (*WalletPassphraseCmd) UnmarshalJSON

func (cmd *WalletPassphraseCmd) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of the Cmd interface.

Directories

Path Synopsis
v2

Jump to

Keyboard shortcuts

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