btcjson

package module
v0.0.0-...-faa8080 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2014 License: ISC Imports: 11 Imported by: 2

README

btcjson

[Build Status] (https://travis-ci.org/conformal/btcjson)

Package btcjson implements the bitcoin JSON-RPC API. There is a test suite which is aiming to reach 100% code coverage. See test_coverage.txt for the current coverage (using gocov). On a UNIX-like OS, the script cov_report.sh can be used to generate the report. Package btcjson is licensed under the liberal ISC license.

This package is one of the core packages from btcd, an alternative full-node implementation of bitcoin which is under active development by Conformal. Although it was primarily written for btcd, this package has intentionally been designed so it can be used as a standalone package for any projects needing to communicate with a bitcoin client using the json rpc interface. BlockSafari is one such program that uses btcjson to communicate with btcd (or bitcoind to help test btcd).

JSON RPC

Bitcoin provides an extensive API call list to control bitcoind or bitcoin-qt through json-rpc. These can be used to get information from the client or to cause the client 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

	msg, err := btcjson.CreateMessage("getinfo")
	reply, err := btcjson.RpcCommand(user, password, server, msg)

Documentation

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/conformal/btcjson

Installation

$ go get github.com/conformal/btcjson

TODO

  • Add data structures for remaining commands.
  • Increase test coverage to 100%.
  • Add https support.

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 liberal 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 message. 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":"btcd"}

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. The default local address of bitcoind is 127.0.0.1:8332.

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 message.
msg, err := btcjson.CreateMessage("getinfo")
if err != nil {
	// Log and handle error.
}

// Send the message to server using the appropriate username and
// password.
reply, err := btcjson.RpcCommand(user, password, server, msg)
if err != nil {
	// 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 message.
msg, err := btcjson.CreateMessage("getrawmempool")
if err != nil {
	// Log and handle error.
}

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

// Ensure there is a result and type assert it to an interface slice.
if reply.Result != nil {
	if mempool, ok := reply.Result.([]interface{}); 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 (
	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",
	}
	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 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

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

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, helpString string)

RegisterCustomCmd registers a custom RawCmd parsing func for a non-standard Bitcoin command.

func RegisterCustomCmdGenerator

func RegisterCustomCmdGenerator(method string, generator CmdGenerator)

RegisterCustomCmdGenerator registers a custom CmdGenerator func 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) SetId

func (cmd *AddMultisigAddressCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *AddNodeCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *BackupWalletCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 BlockResult

type BlockResult struct {
	Hash          string        `json:"hash"`
	Confirmations uint64        `json:"confirmations"`
	Size          int           `json:"size"`
	Height        int64         `json:"height"`
	Version       uint32        `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{}
	SetId(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 CmdGenerator

type CmdGenerator func() Cmd

CmdGenerator is a function that returns a new concrete Cmd of the appropriate type for a non-standard Bitcoin 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) SetId

func (cmd *CreateMultisigCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *CreateRawTransactionCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *DebugLevelCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *DecodeRawTransactionCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *DecodeScriptCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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   int      `json:"reqSigs,omitempty"`
	Type      string   `json:"type"`
	Addresses []string `json:"addresses,omitempty"`
	P2sh      string   `json:"p2sh"`
}

DecodeScriptResult models the data returned from the decodescript command.

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) SetId

func (cmd *DumpPrivKeyCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *DumpWalletCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *EncryptWalletCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *GetAccountAddressCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetAccountCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetAddedNodeInfoCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetAddressesByAccountCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetBalanceCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetBestBlockHashCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *GetBlockCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetBlockCountCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetBlockHashCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetBlockTemplateCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *GetConnectionCountCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetDifficultyCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetGenerateCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetHashesPerSecCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetInfoCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetMiningInfoCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 {
	CurrentBlockSize float64 `json:"currentblocksize"`
	Difficulty       float64 `json:"difficulty"`
	Errors           string  `json:"errors"`
	Generate         bool    `json:"generate"`
	GenProcLimit     float64 `json:"genproclimit"`
	PooledTx         float64 `json:"pooledtx"`
	Testnet          bool    `json:"testnet"`
	Blocks           float64 `json:"blocks"`
	CurrentBlockTx   float64 `json:"currentblocktx"`
	HashesPerSec     float64 `json:"hashespersec"`
}

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) SetId

func (cmd *GetNetTotalsCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetNetworkHashPSCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *GetNewAddressCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetPeerInfoCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 {
	Addr           string `json:"addr"`
	Services       string `json:"services"`
	LastSend       int64  `json:"lastsend"`
	LastRecv       int64  `json:"lastrecv"`
	BytesSent      uint64 `json:"bytessent"`
	BytesRecv      uint64 `json:"bytesrecv"`
	PingTime       int64  `json:"pingtime"`
	PingWait       int64  `json:"pingwait,omitempty"`
	ConnTime       int64  `json:"conntime"`
	Version        uint32 `json:"version"`
	SubVer         string `json:"subver"`
	Inbound        bool   `json:"inbound"`
	StartingHeight int32  `json:"startingheight"`
	BanScore       int    `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) SetId

func (cmd *GetRawChangeAddressCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetRawMempoolCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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             int      `json:"size"`
	Fee              float64  `json:"fee"`
	Time             int64    `json:"time"`
	Height           int64    `json:"height"`
	StartingPriority int      `json:"startingpriority"`
	CurrentPriority  int      `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) SetId

func (cmd *GetRawTransactionCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetReceivedByAccountCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetReceivedByAddressCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetTransactionCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *GetTxOutCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *GetTxOutSetInfoCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *GetWorkCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *HelpCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *ImportPrivKeyCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *ImportWalletCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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         int     `json:"version,omitempty"`
	ProtocolVersion int     `json:"protocolversion,omitempty"`
	WalletVersion   int     `json:"walletversion,omitempty"`
	Balance         float64 `json:"balance,omitempty"`
	Blocks          int     `json:"blocks,omitempty"`
	Connections     int     `json:"connections,omitempty"`
	Proxy           string  `json:"proxy,omitempty"`
	Difficulty      float64 `json:"difficulty,omitempty"`
	TestNet         bool    `json:"testnet,omitempty"`
	KeypoolOldest   int64   `json:"keypoololdest,omitempty"`
	KeypoolSize     int     `json:"keypoolsize,omitempty"`
	PaytxFee        float64 `json:"paytxfee,omitempty"`
	Errors          string  `json:"errors,omitempty"`
}

InfoResult contains the data returned by the getinfo command.

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) SetId

func (cmd *KeyPoolRefillCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *ListAccountsCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *ListAddressGroupingsCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *ListLockUnspentCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *ListReceivedByAccountCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *ListReceivedByAddressCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *ListSinceBlockCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *ListTransactionsCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 ListUnSpentResult

type ListUnSpentResult struct {
	TxId          string  `json:"txid"`
	Vout          float64 `json:"vout"`
	Address       string  `json:"address"`
	Account       string  `json:"account"`
	ScriptPubKey  string  `json:"scriptPubKey"`
	Amount        float64 `json:"amount"`
	Confirmations float64 `json:"confirmations"`
}

ListUnSpentResult models the data from the ListUnSpentResult 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) SetId

func (cmd *ListUnspentCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *LockUnspentCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *MoveCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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 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) SetId

func (cmd *PingCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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  []interface{} `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.

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         int    `json:"vout"`
	ScriptPubKey string `json:"scriptPubKey"`
	RedeemScript string `json:"redeemScript"`
}

RawTxInput models the data needed for a raw tx input.

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

type ScriptSig

type ScriptSig struct {
	Asm string `json:"asm"`
	Hex string `json:"hex"`
}

ScriptSig models a signature script. It is defined seperately since it only applies to non-coinbase. Therefore the field in the Vin structure needs to be a pointer.

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) SetId

func (cmd *SendFromCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *SendManyCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *SendRawTransactionCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *SendToAddressCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *SetAccountCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *SetGenerateCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *SetTxFeeCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *SignMessageCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *SignRawTransactionCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *StopCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *SubmitBlockCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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"`
}

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 int    `json:"vout"`
}

TransactionInput represents the inputs to a transaction. Specifically a transactionsha and output number pair.

func ConvertCreateRawTxParams

func ConvertCreateRawTxParams(inputs, amounts interface{}) ([]TransactionInput, map[string]int64, error)

ConvertCreateRawTxParams validates and converts the passed parameters from raw interfaces into concrete structs. This is a separate function since the createrawtransaction command parameters are caller-crafted JSON as opposed to machine generated JSON as is the case for most commands.

type TxRawDecodeResult

type TxRawDecodeResult struct {
	Txid     string `json:"txid"`
	Version  uint32 `json:"version"`
	Locktime uint32 `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       uint32 `json:"version"`
	LockTime      uint32 `json:"locktime"`
	Vin           []Vin  `json:"vin"`
	Vout          []Vout `json:"vout"`
	BlockHash     string `json:"blockhash,omitempty"`
	Confirmations uint64 `json:"confirmations,omitempty"`
	Time          int64  `json:"time,omitempty"`
	Blocktime     int64  `json:"blocktime,omitempty"`
}

TxRawResult models the data from the getrawtransaction command.

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) SetId

func (cmd *ValidateAddressCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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"`
	IsScript     bool   `json:"isscript,omitempty"`
	PubKey       string `json:"pubkey,omitempty"`
	IsCompressed bool   `json:"iscompressed,omitempty"`
	Account      string `json:"account,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) SetId

func (cmd *VerifyChainCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *VerifyMessageCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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      int        `json:"vout"`
	ScriptSig *ScriptSig `json:"scriptSig"`
	Sequence  uint32     `json:"sequence"`
}

Vin models parts of the tx data. It is defined seperately since both getrawtransaction 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            int     `json:"n"`
	ScriptPubKey struct {
		Asm       string   `json:"asm"`
		Hex       string   `json:"hex"`
		ReqSigs   int      `json:"reqSigs,omitempty"`
		Type      string   `json:"type"`
		Addresses []string `json:"addresses,omitempty"`
	} `json:"scriptPubKey"`
}

Vout models parts of the tx data. It is defined seperately since both getrawtransaction 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) SetId

func (cmd *WalletLockCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *WalletPassphraseChangeCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

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) SetId

func (cmd *WalletPassphraseCmd) SetId(id interface{})

SetId allows one to modify the Id of a Cmd to help in relaying them.

func (*WalletPassphraseCmd) UnmarshalJSON

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

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

Jump to

Keyboard shortcuts

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