hcjson

package
Version: v0.0.0-...-27c7ab1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: ISC Imports: 13 Imported by: 16

README

hcjson

ISC License GoDoc

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

Although this package was primarily written for the HC, it has intentionally been designed so it can be used as a standalone package for any projects needing to marshal to and from HC JSON-RPC requests and responses.

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

Installation and Updating

$ go get -u github.com/HcashOrg/hcd/hcjson

Examples

  • Marshal Command
    Demonstrates how to create and marshal a command into a JSON-RPC request.

  • Unmarshal Command
    Demonstrates how to unmarshal a JSON-RPC request and then unmarshal the concrete request into a concrete command.

  • Marshal Response
    Demonstrates how to marshal a JSON-RPC response.

  • Unmarshal Response
    Demonstrates how to unmarshal a JSON-RPC response and then unmarshal the result field in the response to a concrete type.

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 the HC developers. 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 hcjson is licensed under the copyfree ISC License.

Documentation

Overview

Package hcjson provides primitives for working with the HC JSON-RPC API.

Overview

When communicating via the JSON-RPC protocol, all of the commands need to be marshalled to and from the the wire in the appropriate format. This package provides data structures and primitives to ease this process.

In addition, it also provides some additional features such as custom command registration, command categorization, and reflection-based help generation.

JSON-RPC Protocol Overview

This information is not necessary in order to use this package, but it does provide some intuition into what the marshalling and unmarshalling that is discussed below is doing under the hood.

As defined by the JSON-RPC spec, there are effectively two forms of messages on the wire:

  • Request Objects {"jsonrpc":"1.0","id":"SOMEID","method":"SOMEMETHOD","params":[SOMEPARAMS]} NOTE: Notifications are the same format except the id field is null.

  • Response Objects {"result":SOMETHING,"error":null,"id":"SOMEID"} {"result":null,"error":{"code":SOMEINT,"message":SOMESTRING},"id":"SOMEID"}

For requests, the params field can vary in what it contains depending on the method (a.k.a. command) being sent. Each parameter can be as simple as an int or a complex structure containing many nested fields. The id field is used to identify a request and will be included in the associated response.

When working with asynchronous transports, such as websockets, spontaneous notifications are also possible. As indicated, they are the same as a request object, except they have the id field set to null. Therefore, servers will ignore requests with the id field set to null, while clients can choose to consume or ignore them.

Unfortunately, the original Bitcoin JSON-RPC API (and hence anything compatible with it) doesn't always follow the spec and will sometimes return an error string in the result field with a null error for certain commands. However, for the most part, the error field will be set as described on failure.

Marshalling and Unmarshalling

Based upon the discussion above, it should be easy to see how the types of this package map into the required parts of the protocol

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

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

Unmarshalling a received Request object is a two step process:

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

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

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

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

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

Command Creation

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

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

Custom Command Registration

The command handling of this package is built around the concept of registered commands. This is true for the wide variety of commands already provided by the package, but it also means caller can easily provide custom commands with all of the same functionality as the built-in commands. Use the RegisterCmd function for this purpose.

A list of all registered methods can be obtained with the RegisteredCmdMethods function.

Command Inspection

All registered commands are registered with flags that identify information such as whether the command applies to a chain server, wallet server, or is a notification along with the method name to use. These flags can be obtained with the MethodUsageFlags flags, and the method can be obtained with the CmdMethod function.

Help Generation

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

In addition, the MethodUsageText function is provided to generate consistent one-line usage for registered commands and notifications using reflection.

Errors

There are 2 distinct type of errors supported by this package:

  • General errors related to marshalling or unmarshalling or improper use of the package (type Error)
  • RPC errors which are intended to be returned across the wire as a part of the JSON-RPC response (type RPCError)

The first category of errors (type Error) typically indicates a programmer error and can be avoided by properly using the API. Errors of this type will be returned from the various functions available in this package. They identify issues such as unsupported field types, attempts to register malformed commands, and attempting to create a new command with an improper number of parameters. The specific reason for the error can be detected by type asserting it to a *hcjson.Error and accessing the ErrorCode field.

The second category of errors (type RPCError), on the other hand, are useful for returning errors to RPC clients. Consequently, they are used in the previously described Response type.

Example (UnmarshalResponse)

This example demonstrates how to unmarshal a JSON-RPC response and then unmarshal the result field in the response to a concrete type.

package main

import (
	"encoding/json"
	"fmt"

	"github.com/HcashOrg/hcd/hcjson"
)

func main() {
	// Ordinarily this would be read from the wire, but for this example,
	// it is hard coded here for clarity.  This is an example response to a
	// getblockheight request.
	data := []byte(`{"result":350001,"error":null,"id":1}`)

	// Unmarshal the raw bytes from the wire into a JSON-RPC response.
	var response hcjson.Response
	if err := json.Unmarshal(data, &response); err != nil {
		fmt.Println("Malformed JSON-RPC response:", err)
		return
	}

	// Check the response for an error from the server.  For example, the
	// server might return an error if an invalid/unknown block hash is
	// requested.
	if response.Error != nil {
		fmt.Println(response.Error)
		return
	}

	// Unmarshal the result into the expected type for the response.
	var blockHeight int32
	if err := json.Unmarshal(response.Result, &blockHeight); err != nil {
		fmt.Printf("Unexpected result type: %T\n", response.Result)
		return
	}
	fmt.Println("Block height:", blockHeight)

}
Output:

Block height: 350001

Index

Examples

Constants

View Source
const (
	// BlockConnectedNtfnMethod is the method used for notifications from
	// the chain server that a block has been connected.
	BlockConnectedNtfnMethod = "blockconnected"

	// BlockDisconnectedNtfnMethod is the method used for notifications from
	// the chain server that a block has been disconnected.
	BlockDisconnectedNtfnMethod = "blockdisconnected"

	// ReorganizationNtfnMethod is the method used for notifications that the
	// block chain is in the process of a reorganization.
	ReorganizationNtfnMethod = "reorganization"

	// TxAcceptedNtfnMethod is the method used for notifications from the
	// chain server that a transaction has been accepted into the mempool.
	TxAcceptedNtfnMethod = "txaccepted"

	// TxAcceptedVerboseNtfnMethod is the method used for notifications from
	// the chain server that a transaction has been accepted into the
	// mempool.  This differs from TxAcceptedNtfnMethod in that it provides
	// more details in the notification.
	TxAcceptedVerboseNtfnMethod = "txacceptedverbose"

	// RelevantTxAcceptedNtfnMethod is the method used for notifications
	// from the chain server that inform a client that a relevant
	// transaction was accepted by the mempool.
	RelevantTxAcceptedNtfnMethod = "relevanttxaccepted"
)
View Source
const (
	// TicketPurchasedNtfnMethod is the method of the hcwallet
	// ticketpurchased notification.
	TicketPurchasedNtfnMethod = "ticketpurchased"

	// VoteCreatedNtfnMethod is the method of the hcwallet
	// votecreated notification.
	VoteCreatedNtfnMethod = "votecreated"

	// RevocationCreatedNtfnMethod is the method of the hcwallet
	// revocationcreated notification.
	RevocationCreatedNtfnMethod = "revocationcreated"

	// WinningTicketsNtfnMethod is the method of the daemon
	// winningtickets notification.
	WinningTicketsNtfnMethod = "winningtickets"

	// SpentAndMissedTicketsNtfnMethod is the method of the daemon
	// spentandmissedtickets notification.
	SpentAndMissedTicketsNtfnMethod = "spentandmissedtickets"

	// NewTicketsNtfnMethod is the method of the daemon
	// newtickets notification.
	NewTicketsNtfnMethod = "newtickets"

	// StakeDifficultyNtfnMethod is the method of the daemon
	// stakedifficulty notification.
	StakeDifficultyNtfnMethod = "stakedifficulty"
)
View Source
const (
	// AccountBalanceNtfnMethod is the method used for account balance
	// notifications.
	AccountBalanceNtfnMethod = "accountbalance"

	// BtcdConnectedNtfnMethod is the method used for notifications when
	// a wallet server is connected to a chain server.
	BtcdConnectedNtfnMethod = "hcdconnected"

	// WalletLockStateNtfnMethod is the method used to notify the lock state
	// of a wallet has changed.
	WalletLockStateNtfnMethod = "walletlockstate"

	// NewTxNtfnMethod is the method used to notify that a wallet server has
	// added a new transaction to the transaciton store.
	NewTxNtfnMethod = "newtx"
)

Variables

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

Standard JSON-RPC 2.0 errors

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

General application defined JSON errors

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

Peer-to-peer client errors

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

Wallet JSON errors

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

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

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

Errors that are specific to hcd.

View Source
var (
	ErrRPCInvalidRequest = &RPCError{
		Code:    -32600,
		Message: "Invalid request",
	}
	ErrRPCMethodNotFound = &RPCError{
		Code:    -32601,
		Message: "Method not found",
	}
	ErrRPCInvalidParams = &RPCError{
		Code:    -32602,
		Message: "Invalid parameters",
	}
	ErrRPCInternal = &RPCError{
		Code:    -32603,
		Message: "Internal error",
	}
	ErrRPCParse = &RPCError{
		Code:    -32700,
		Message: "Parse error",
	}
)

Standard JSON-RPC 2.0 errors.

Functions

func Bool

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it. This is useful when assigning optional parameters.

func CmdMethod

func CmdMethod(cmd interface{}) (string, error)

CmdMethod returns the method for the passed command. The provided command type must be a registered type. All commands provided by this package are registered by default.

func DecodeConcatenatedHashes

func DecodeConcatenatedHashes(hashes string) ([]chainhash.Hash, error)

DecodeConcatenatedHashes return a slice of contiguous chainhash.Hash objects created by decoding a single string of concatenated hex-encoded hashes.

These hashes must NOT be the byte reversed string encoding that is typically used for block and transaction hashes, or each resulting hash will also be reversed.

The length of the string must be evenly divisible by twice the hash size in order for the parameter to be valid. This function assumes the input is from a JSON-RPC request and any errors will be of type *RPCError with an ErrRPCInvalidParameter or ErrRPCDecodedHexString error code.

func DecodeConcatenatedVoteBits

func DecodeConcatenatedVoteBits(voteBitsString string) ([]stake.VoteBits, error)

DecodeConcatenatedVoteBits decodes a string encoded as a slice of concatenated voteBits and extended voteBits, and returns the slice of DecodedVoteBits to the caller.

func EncodeConcatenatedHashes

func EncodeConcatenatedHashes(hashSlice []chainhash.Hash) string

EncodeConcatenatedHashes serializes a slice of chainhash.Hash values into a string of hex-encoded bytes.

func EncodeConcatenatedVoteBits

func EncodeConcatenatedVoteBits(voteBitsSlice []stake.VoteBits) (string, error)

EncodeConcatenatedVoteBits encodes a slice of VoteBits into a serialized byte slice. The entirety of the voteBits are encoded individually in series as follows:

Size            Description
1 byte          Length of the concatenated voteBits in bytes
2 bytes         Vote bits
up to 73 bytes  Extended vote bits

The result may be concatenated into a slice and then passed to callers

func Float64

func Float64(v float64) *float64

Float64 is a helper routine that allocates a new float64 value to store v and returns a pointer to it. This is useful when assigning optional parameters.

func GenerateHelp

func GenerateHelp(method string, descs map[string]string, resultTypes ...interface{}) (string, error)

GenerateHelp generates and returns help output for the provided method and result types given a map to provide the appropriate keys for the method synopsis, field descriptions, conditions, and result descriptions. The method must be associated with a registered type. All commands provided by this package are registered by default.

The resultTypes must be pointer-to-types which represent the specific types of values the command returns. For example, if the command only returns a boolean value, there should only be a single entry of (*bool)(nil). Note that each type must be a single pointer to the type. Therefore, it is recommended to simply pass a nil pointer cast to the appropriate type as previously shown.

The provided descriptions map must contain all of the keys or an error will be returned which includes the missing key, or the final missing key when there is more than one key missing. The generated help in the case of such an error will use the key in place of the description.

The following outlines the required keys:

"<method>--synopsis"             Synopsis for the command
"<method>-<lowerfieldname>"      Description for each command argument
"<typename>-<lowerfieldname>"    Description for each object field
"<method>--condition<#>"         Description for each result condition
"<method>--result<#>"            Description for each primitive result num

Notice that the "special" keys synopsis, condition<#>, and result<#> are preceded by a double dash to ensure they don't conflict with field names.

The condition keys are only required when there is more than on result type, and the result key for a given result type is only required if it's not an object.

For example, consider the 'help' command itself. There are two possible returns depending on the provided parameters. So, the help would be generated by calling the function as follows:

GenerateHelp("help", descs, (*string)(nil), (*string)(nil)).

The following keys would then be required in the provided descriptions map:

"help--synopsis":   "Returns a list of all commands or help for ...."
"help-command":     "The command to retrieve help for",
"help--condition0": "no command provided"
"help--condition1": "command specified"
"help--result0":    "List of commands"
"help--result1":    "Help for specified command"

func Int

func Int(v int) *int

Int is a helper routine that allocates a new int value to store v and returns a pointer to it. This is useful when assigning optional parameters.

func Int32

func Int32(v int32) *int32

Int32 is a helper routine that allocates a new int32 value to store v and returns a pointer to it. This is useful when assigning optional parameters.

func Int64

func Int64(v int64) *int64

Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it. This is useful when assigning optional parameters.

func IsValidIDType

func IsValidIDType(id interface{}) bool

IsValidIDType checks that the ID field (which can go in any of the JSON-RPC requests, responses, or notifications) is valid. JSON-RPC 1.0 allows any valid JSON type. JSON-RPC 2.0 (which bitcoind follows for some parts) only allows string, number, or null, so this function restricts the allowed types to that list. This function is only provided in case the caller is manually marshalling for some reason. The functions which accept an ID in this package already call this function to ensure the provided id is valid.

func MarshalCmd

func MarshalCmd(id interface{}, cmd interface{}) ([]byte, error)

MarshalCmd marshals the passed command to a JSON-RPC request byte slice that is suitable for transmission to an RPC server. The provided command type must be a registered type. All commands provided by this package are registered by default.

Example

This example demonstrates how to create and marshal a command into a JSON-RPC request.

package main

import (
	"fmt"

	"github.com/HcashOrg/hcd/hcjson"
)

func main() {
	// Create a new getblock command.  Notice the nil parameter indicates
	// to use the default parameter for that fields.  This is a common
	// pattern used in all of the New<Foo>Cmd functions in this package for
	// optional fields.  Also, notice the call to hcjson.Bool which is a
	// convenience function for creating a pointer out of a primitive for
	// optional parameters.
	blockHash := "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
	gbCmd := hcjson.NewGetBlockCmd(blockHash, hcjson.Bool(false), nil)

	// Marshal the command to the format suitable for sending to the RPC
	// server.  Typically the client would increment the id here which is
	// request so the response can be identified.
	id := 1
	marshalledBytes, err := hcjson.MarshalCmd(id, gbCmd)
	if err != nil {
		fmt.Println(err)
		return
	}

	// Display the marshalled command.  Ordinarily this would be sent across
	// the wire to the RPC server, but for this example, just display it.
	fmt.Printf("%s\n", marshalledBytes)

}
Output:

{"jsonrpc":"1.0","method":"getblock","params":["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",false],"id":1}

func MarshalResponse

func MarshalResponse(id interface{}, result interface{}, rpcErr *RPCError) ([]byte, error)

MarshalResponse marshals the passed id, result, and RPCError to a JSON-RPC response byte slice that is suitable for transmission to a JSON-RPC client.

Example

This example demonstrates how to marshal a JSON-RPC response.

package main

import (
	"fmt"

	"github.com/HcashOrg/hcd/hcjson"
)

func main() {
	// Marshal a new JSON-RPC response.  For example, this is a response
	// to a getblockheight request.
	marshalledBytes, err := hcjson.MarshalResponse(1, 350001, nil)
	if err != nil {
		fmt.Println(err)
		return
	}

	// Display the marshalled response.  Ordinarily this would be sent
	// across the wire to the RPC client, but for this example, just display
	// it.
	fmt.Printf("%s\n", marshalledBytes)

}
Output:

{"result":350001,"error":null,"id":1}

func MethodUsageText

func MethodUsageText(method string) (string, error)

MethodUsageText returns a one-line usage string for the provided method. The provided method must be associated with a registered type. All commands provided by this package are registered by default.

func MustRegisterCmd

func MustRegisterCmd(method string, cmd interface{}, flags UsageFlag)

MustRegisterCmd performs the same function as RegisterCmd except it panics if there is an error. This should only be called from package init functions.

func NewCmd

func NewCmd(method string, args ...interface{}) (interface{}, error)

NewCmd provides a generic mechanism to create a new command that can marshal to a JSON-RPC request while respecting the requirements of the provided method. The method must have been registered with the package already along with its type definition. All methods associated with the commands exported by this package are already registered by default.

The arguments are most efficient when they are the exact same type as the underlying field in the command struct associated with the the method, however this function also will perform a variety of conversions to make it more flexible. This allows, for example, command line args which are strings to be passed unaltered. In particular, the following conversions are supported:

  • Conversion between any size signed or unsigned integer so long as the value does not overflow the destination type
  • Conversion between float32 and float64 so long as the value does not overflow the destination type
  • Conversion from string to boolean for everything strconv.ParseBool recognizes
  • Conversion from string to any size integer for everything strconv.ParseInt and strconv.ParseUint recognizes
  • Conversion from string to any size float for everything strconv.ParseFloat recognizes
  • Conversion from string to arrays, slices, structs, and maps by treating the string as marshalled JSON and calling json.Unmarshal into the destination field

func RegisterCmd

func RegisterCmd(method string, cmd interface{}, flags UsageFlag) error

RegisterCmd registers a new command that will automatically marshal to and from JSON-RPC with full type checking and positional parameter support. It also accepts usage flags which identify the circumstances under which the command can be used.

This package automatically registers all of the exported commands by default using this function, however it is also exported so callers can easily register custom types.

The type format is very strict since it needs to be able to automatically marshal to and from JSON-RPC 1.0. The following enumerates the requirements:

  • The provided command must be a single pointer to a struct
  • All fields must be exported
  • The order of the positional parameters in the marshalled JSON will be in the same order as declared in the struct definition
  • Struct embedding is not supported
  • Struct fields may NOT be channels, functions, complex, or interface
  • A field in the provided struct with a pointer is treated as optional
  • Multiple indirections (i.e **int) are not supported
  • Once the first optional field (pointer) is encountered, the remaining fields must also be optional fields (pointers) as required by positional params
  • A field that has a 'jsonrpcdefault' struct tag must be an optional field (pointer)

NOTE: This function only needs to be able to examine the structure of the passed struct, so it does not need to be an actual instance. Therefore, it is recommended to simply pass a nil pointer cast to the appropriate type. For example, (*FooCmd)(nil).

func RegisteredCmdMethods

func RegisteredCmdMethods() []string

RegisteredCmdMethods returns a sorted list of methods for all registered commands.

func String

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it. This is useful when assigning optional parameters.

func Uint

func Uint(v uint) *uint

Uint is a helper routine that allocates a new uint value to store v and returns a pointer to it. This is useful when assigning optional parameters.

func Uint32

func Uint32(v uint32) *uint32

Uint32 is a helper routine that allocates a new uint32 value to store v and returns a pointer to it. This is useful when assigning optional parameters.

func Uint64

func Uint64(v uint64) *uint64

Uint64 is a helper routine that allocates a new uint64 value to store v and returns a pointer to it. This is useful when assigning optional parameters.

func UnmarshalCmd

func UnmarshalCmd(r *Request) (interface{}, error)

UnmarshalCmd unmarshals a JSON-RPC request into a suitable concrete command so long as the method type contained within the marshalled request is registered.

Example

This example demonstrates how to unmarshal a JSON-RPC request and then unmarshal the concrete request into a concrete command.

package main

import (
	"encoding/json"
	"fmt"

	"github.com/HcashOrg/hcd/hcjson"
)

func main() {
	// Ordinarily this would be read from the wire, but for this example,
	// it is hard coded here for clarity.
	data := []byte(`{"jsonrpc":"1.0","method":"getblock","params":["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",false],"id":1}`)

	// Unmarshal the raw bytes from the wire into a JSON-RPC request.
	var request hcjson.Request
	if err := json.Unmarshal(data, &request); err != nil {
		fmt.Println(err)
		return
	}

	// Typically there isn't any need to examine the request fields directly
	// like this as the caller already knows what response to expect based
	// on the command it sent.  However, this is done here to demonstrate
	// why the unmarshal process is two steps.
	if request.ID == nil {
		fmt.Println("Unexpected notification")
		return
	}
	if request.Method != "getblock" {
		fmt.Println("Unexpected method")
		return
	}

	// Unmarshal the request into a concrete command.
	cmd, err := hcjson.UnmarshalCmd(&request)
	if err != nil {
		fmt.Println(err)
		return
	}

	// Type assert the command to the appropriate type.
	gbCmd, ok := cmd.(*hcjson.GetBlockCmd)
	if !ok {
		fmt.Printf("Incorrect command type: %T\n", cmd)
		return
	}

	// Display the fields in the concrete command.
	fmt.Println("Hash:", gbCmd.Hash)
	fmt.Println("Verbose:", *gbCmd.Verbose)
	fmt.Println("VerboseTx:", *gbCmd.VerboseTx)

}
Output:

Hash: 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
Verbose: false
VerboseTx: false

Types

type AccountAddressIndexCmd

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

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

func NewAccountAddressIndexCmd

func NewAccountAddressIndexCmd(acct string, branch int) *AccountAddressIndexCmd

NewAccountAddressIndexCmd creates a new AccountAddressIndexCmd.

type AccountBalanceNtfn

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

AccountBalanceNtfn defines the accountbalance JSON-RPC notification.

func NewAccountBalanceNtfn

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

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

type AccountSyncAddressIndexCmd

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

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

func NewAccountSyncAddressIndexCmd

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

NewAccountSyncAddressIndexCmd creates a new AccountSyncAddressIndexCmd.

type AddMultisigAddressCmd

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

AddMultisigAddressCmd defines the addmutisigaddress JSON-RPC command.

func NewAddMultisigAddressCmd

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

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

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

type AddNodeCmd

type AddNodeCmd struct {
	Addr   string
	SubCmd AddNodeSubCmd `jsonrpcusage:"\"add|remove|onetry\""`
}

AddNodeCmd defines the addnode JSON-RPC command.

func NewAddNodeCmd

func NewAddNodeCmd(addr string, subCmd AddNodeSubCmd) *AddNodeCmd

NewAddNodeCmd returns a new instance which can be used to issue an addnode JSON-RPC command.

type AddNodeSubCmd

type AddNodeSubCmd string

AddNodeSubCmd defines the type used in the addnode JSON-RPC command for the sub command field.

const (
	// ANAdd indicates the specified host should be added as a persistent
	// peer.
	ANAdd AddNodeSubCmd = "add"

	// ANRemove indicates the specified peer should be removed.
	ANRemove AddNodeSubCmd = "remove"

	// ANOneTry indicates the specified host should try to connect once,
	// but it should not be made persistent.
	ANOneTry AddNodeSubCmd = "onetry"
)

type AddTicketCmd

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

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

func NewAddTicketCmd

func NewAddTicketCmd(ticketHex string) *AddTicketCmd

NewAddTicketCmd creates a new AddTicketCmd.

type Agenda

type Agenda struct {
	Id             string   `json:"id"`
	Description    string   `json:"description"`
	Mask           uint16   `json:"mask"`
	StartTime      uint64   `json:"starttime"`
	ExpireTime     uint64   `json:"expiretime"`
	Status         string   `json:"status"`
	QuorumProgress float64  `json:"quorumprogress"`
	Choices        []Choice `json:"choices"`
}

Agenda models an individual agenda including its choices.

type AuthenticateCmd

type AuthenticateCmd struct {
	Username   string
	Passphrase string
}

AuthenticateCmd defines the authenticate JSON-RPC command.

func NewAuthenticateCmd

func NewAuthenticateCmd(username, passphrase string) *AuthenticateCmd

NewAuthenticateCmd returns a new instance which can be used to issue an authenticate JSON-RPC command.

type BlockConnectedNtfn

type BlockConnectedNtfn struct {
	Header        string   `json:"header"`
	SubscribedTxs []string `json:"subscribedtxs"`
}

BlockConnectedNtfn defines the blockconnected JSON-RPC notification.

func NewBlockConnectedNtfn

func NewBlockConnectedNtfn(header string, subscribedTxs []string) *BlockConnectedNtfn

NewBlockConnectedNtfn returns a new instance which can be used to issue a blockconnected JSON-RPC notification.

type BlockDisconnectedNtfn

type BlockDisconnectedNtfn struct {
	Header string `json:"header"`
}

BlockDisconnectedNtfn defines the blockdisconnected JSON-RPC notification.

func NewBlockDisconnectedNtfn

func NewBlockDisconnectedNtfn(header string) *BlockDisconnectedNtfn

NewBlockDisconnectedNtfn returns a new instance which can be used to issue a blockdisconnected JSON-RPC notification.

type BtcdConnectedNtfn

type BtcdConnectedNtfn struct {
	Connected bool
}

BtcdConnectedNtfn defines the hcddconnected JSON-RPC notification.

func NewBtcdConnectedNtfn

func NewBtcdConnectedNtfn(connected bool) *BtcdConnectedNtfn

NewBtcdConnectedNtfn returns a new instance which can be used to issue a hcddconnected JSON-RPC notification.

type Choice

type Choice struct {
	Id          string  `json:"id"`
	Description string  `json:"description"`
	Bits        uint16  `json:"bits"`
	IsAbstain   bool    `json:"isabstain"`
	IsNo        bool    `json:"isno"`
	Count       uint32  `json:"count"`
	Progress    float64 `json:"progress"`
}

Choice models an individual choice inside an Agenda.

type ConsolidateCmd

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

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

func NewConsolidateCmd

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

NewConsolidateCmd creates a new ConsolidateCmd.

type CreateEncryptedWalletCmd

type CreateEncryptedWalletCmd struct {
	Passphrase string
}

CreateEncryptedWalletCmd defines the createencryptedwallet JSON-RPC command.

func NewCreateEncryptedWalletCmd

func NewCreateEncryptedWalletCmd(passphrase string) *CreateEncryptedWalletCmd

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

type CreateMultiSigResult

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

CreateMultiSigResult models the data returned from the createmultisig command.

type CreateMultisigCmd

type CreateMultisigCmd struct {
	NRequired int
	Keys      []string
}

CreateMultisigCmd defines the createmultisig JSON-RPC command.

func NewCreateMultisigCmd

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

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

type CreateNewAccountCmd

type CreateNewAccountCmd struct {
	Account     string
	AccountType string
}

CreateNewAccountCmd defines the createnewaccount JSON-RPC command.

func NewCreateNewAccountCmd

func NewCreateNewAccountCmd(account string, acctype string) *CreateNewAccountCmd

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

type CreateRawSSGenTxCmd

type CreateRawSSGenTxCmd struct {
	Inputs   []TransactionInput
	VoteBits uint16
}

CreateRawSSGenTxCmd is a type handling custom marshaling and unmarshaling of createrawssgentxcmd JSON RPC commands.

func NewCreateRawSSGenTxCmd

func NewCreateRawSSGenTxCmd(inputs []TransactionInput,
	vb uint16) *CreateRawSSGenTxCmd

NewCreateRawSSGenTxCmd creates a new CreateRawSSGenTxCmd.

type CreateRawSSRtxCmd

type CreateRawSSRtxCmd struct {
	Inputs []TransactionInput
	Fee    *float64
}

CreateRawSSRtxCmd is a type handling custom marshaling and unmarshaling of createrawssrtx JSON RPC commands.

func NewCreateRawSSRtxCmd

func NewCreateRawSSRtxCmd(inputs []TransactionInput, fee *float64) *CreateRawSSRtxCmd

NewCreateRawSSRtxCmd creates a new CreateRawSSRtxCmd.

type CreateRawSStxCmd

type CreateRawSStxCmd struct {
	Inputs []SStxInput
	Amount map[string]int64
	COuts  []SStxCommitOut
}

CreateRawSStxCmd is a type handling custom marshaling and unmarshaling of createrawsstx JSON RPC commands.

func NewCreateRawSStxCmd

func NewCreateRawSStxCmd(inputs []SStxInput, amount map[string]int64,
	couts []SStxCommitOut) *CreateRawSStxCmd

NewCreateRawSStxCmd creates a new CreateRawSStxCmd.

type CreateRawTransactionCmd

type CreateRawTransactionCmd struct {
	Inputs   []TransactionInput
	Amounts  map[string]float64 `jsonrpcusage:"{\"address\":amount,...}"` // In HC
	LockTime *int64
	PayLoad  *string
}

CreateRawTransactionCmd defines the createrawtransaction JSON-RPC command.

func NewCreateRawTransactionCmd

func NewCreateRawTransactionCmd(inputs []TransactionInput, amounts map[string]float64,
	lockTime *int64) *CreateRawTransactionCmd

NewCreateRawTransactionCmd returns a new instance which can be used to issue a createrawtransaction JSON-RPC command.

Amounts are in HC.

type DebugLevelCmd

type DebugLevelCmd struct {
	LevelSpec string
}

DebugLevelCmd defines the debuglevel JSON-RPC command. This command is not a standard Bitcoin command. It is an extension for btcd.

func NewDebugLevelCmd

func NewDebugLevelCmd(levelSpec string) *DebugLevelCmd

NewDebugLevelCmd returns a new DebugLevelCmd which can be used to issue a debuglevel JSON-RPC command. This command is not a standard Bitcoin command. It is an extension for btcd.

type DecodeRawTransactionCmd

type DecodeRawTransactionCmd struct {
	HexTx string
}

DecodeRawTransactionCmd defines the decoderawtransaction JSON-RPC command.

func NewDecodeRawTransactionCmd

func NewDecodeRawTransactionCmd(hexTx string) *DecodeRawTransactionCmd

NewDecodeRawTransactionCmd returns a new instance which can be used to issue a decoderawtransaction JSON-RPC command.

type DecodeScriptCmd

type DecodeScriptCmd struct {
	HexScript string
}

DecodeScriptCmd defines the decodescript JSON-RPC command.

func NewDecodeScriptCmd

func NewDecodeScriptCmd(hexScript string) *DecodeScriptCmd

NewDecodeScriptCmd returns a new instance which can be used to issue a decodescript JSON-RPC command.

type DecodeScriptResult

type DecodeScriptResult struct {
	Asm       string   `json:"asm"`
	ReqSigs   int32    `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
}

DumpPrivKeyCmd defines the dumpprivkey JSON-RPC command.

func NewDumpPrivKeyCmd

func NewDumpPrivKeyCmd(address string) *DumpPrivKeyCmd

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

type Error

type Error struct {
	Code    ErrorCode // Describes the kind of error
	Message string    // Human readable description of the issue
}

Error identifies a general error. This differs from an RPCError in that this error typically is used more by the consumers of the package as opposed to RPCErrors which are intended to be returned to the client across the wire via a JSON-RPC Response. The caller can use type assertions to determine the specific error and access the ErrorCode field.

func (Error) Error

func (e Error) Error() string

Error satisfies the error interface and prints human-readable errors.

type ErrorCode

type ErrorCode int

ErrorCode identifies a kind of error. These error codes are NOT used for JSON-RPC response errors.

const (
	// ErrDuplicateMethod indicates a command with the specified method
	// already exists.
	ErrDuplicateMethod ErrorCode = iota

	// ErrInvalidUsageFlags indicates one or more unrecognized flag bits
	// were specified.
	ErrInvalidUsageFlags

	// ErrInvalidType indicates a type was passed that is not the required
	// type.
	ErrInvalidType

	// ErrEmbeddedType indicates the provided command struct contains an
	// embedded type which is not not supported.
	ErrEmbeddedType

	// ErrUnexportedField indiciates the provided command struct contains an
	// unexported field which is not supported.
	ErrUnexportedField

	// ErrUnsupportedFieldType indicates the type of a field in the provided
	// command struct is not one of the supported types.
	ErrUnsupportedFieldType

	// ErrNonOptionalField indicates a non-optional field was specified
	// after an optional field.
	ErrNonOptionalField

	// ErrNonOptionalDefault indicates a 'jsonrpcdefault' struct tag was
	// specified for a non-optional field.
	ErrNonOptionalDefault

	// ErrMismatchedDefault indicates a 'jsonrpcdefault' struct tag contains
	// a value that doesn't match the type of the field.
	ErrMismatchedDefault

	// ErrUnregisteredMethod indicates a method was specified that has not
	// been registered.
	ErrUnregisteredMethod

	// ErrMissingDescription indicates a description required to generate
	// help is missing.
	ErrMissingDescription

	// ErrNumParams inidcates the number of params supplied do not
	// match the requirements of the associated command.
	ErrNumParams
)

These constants are used to identify a specific RuleError.

func (ErrorCode) String

func (e ErrorCode) String() string

String returns the ErrorCode as a human-readable name.

type EstimateFeeCmd

type EstimateFeeCmd struct {
	NumBlocks int64
}

EstimateFeeCmd defines the estimatefee JSON-RPC command.

func NewEstimateFeeCmd

func NewEstimateFeeCmd(numBlocks int64) *EstimateFeeCmd

NewEstimateFeeCmd returns a new instance which can be used to issue a estimatefee JSON-RPC command.

type EstimatePriorityCmd

type EstimatePriorityCmd struct {
	NumBlocks int64
}

EstimatePriorityCmd defines the estimatepriority JSON-RPC command.

func NewEstimatePriorityCmd

func NewEstimatePriorityCmd(numBlocks int64) *EstimatePriorityCmd

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

type EstimateStakeDiffCmd

type EstimateStakeDiffCmd struct {
	Tickets *uint32
}

EstimateStakeDiffCmd defines the eststakedifficulty JSON-RPC command.

func NewEstimateStakeDiffCmd

func NewEstimateStakeDiffCmd(tickets *uint32) *EstimateStakeDiffCmd

NewEstimateStakeDiffCmd defines the eststakedifficulty JSON-RPC command.

type EstimateStakeDiffResult

type EstimateStakeDiffResult struct {
	Min      float64  `json:"min"`
	Max      float64  `json:"max"`
	Expected float64  `json:"expected"`
	User     *float64 `json:"user,omitempty"`
}

EstimateStakeDiffResult models the data returned from the estimatestakediff command.

type ExistsAddressCmd

type ExistsAddressCmd struct {
	Address string
}

ExistsAddressCmd defines the existsaddress JSON-RPC command.

func NewExistsAddressCmd

func NewExistsAddressCmd(address string) *ExistsAddressCmd

NewExistsAddressCmd returns a new instance which can be used to issue a existsaddress JSON-RPC command.

type ExistsAddressesCmd

type ExistsAddressesCmd struct {
	Addresses []string
}

ExistsAddressesCmd defines the existsaddresses JSON-RPC command.

func NewExistsAddressesCmd

func NewExistsAddressesCmd(addresses []string) *ExistsAddressesCmd

NewExistsAddressesCmd returns a new instance which can be used to issue an existsaddresses JSON-RPC command.

type ExistsExpiredTicketsCmd

type ExistsExpiredTicketsCmd struct {
	TxHashBlob string
}

ExistsExpiredTicketsCmd defines the existsexpiredtickets JSON-RPC command.

func NewExistsExpiredTicketsCmd

func NewExistsExpiredTicketsCmd(txHashBlob string) *ExistsExpiredTicketsCmd

NewExistsExpiredTicketsCmd returns a new instance which can be used to issue an existsexpiredtickets JSON-RPC command.

type ExistsLiveTicketCmd

type ExistsLiveTicketCmd struct {
	TxHash string
}

ExistsLiveTicketCmd defines the existsliveticket JSON-RPC command.

func NewExistsLiveTicketCmd

func NewExistsLiveTicketCmd(txHash string) *ExistsLiveTicketCmd

NewExistsLiveTicketCmd returns a new instance which can be used to issue an existsliveticket JSON-RPC command.

type ExistsLiveTicketsCmd

type ExistsLiveTicketsCmd struct {
	TxHashBlob string
}

ExistsLiveTicketsCmd defines the existslivetickets JSON-RPC command.

func NewExistsLiveTicketsCmd

func NewExistsLiveTicketsCmd(txHashBlob string) *ExistsLiveTicketsCmd

NewExistsLiveTicketsCmd returns a new instance which can be used to issue an existslivetickets JSON-RPC command.

type ExistsMempoolTxsCmd

type ExistsMempoolTxsCmd struct {
	TxHashBlob string
}

ExistsMempoolTxsCmd defines the existsmempooltxs JSON-RPC command.

func NewExistsMempoolTxsCmd

func NewExistsMempoolTxsCmd(txHashBlob string) *ExistsMempoolTxsCmd

NewExistsMempoolTxsCmd returns a new instance which can be used to issue an existslivetickets JSON-RPC command.

type ExistsMissedTicketsCmd

type ExistsMissedTicketsCmd struct {
	TxHashBlob string
}

ExistsMissedTicketsCmd defines the existsmissedtickets JSON-RPC command.

func NewExistsMissedTicketsCmd

func NewExistsMissedTicketsCmd(txHashBlob string) *ExistsMissedTicketsCmd

NewExistsMissedTicketsCmd returns a new instance which can be used to issue an existsmissedtickets JSON-RPC command.

type ExportWatchingWalletCmd

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

ExportWatchingWalletCmd defines the exportwatchingwallet JSON-RPC command.

func NewExportWatchingWalletCmd

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

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

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

type FeeInfoBlock

type FeeInfoBlock struct {
	Height uint32  `json:"height"`
	Number uint32  `json:"number"`
	Min    float64 `json:"min"`
	Max    float64 `json:"max"`
	Mean   float64 `json:"mean"`
	Median float64 `json:"median"`
	StdDev float64 `json:"stddev"`
}

FeeInfoBlock is ticket fee information about a block.

type FeeInfoMempool

type FeeInfoMempool struct {
	Number uint32  `json:"number"`
	Min    float64 `json:"min"`
	Max    float64 `json:"max"`
	Mean   float64 `json:"mean"`
	Median float64 `json:"median"`
	StdDev float64 `json:"stddev"`
}

FeeInfoMempool is ticket fee information about the mempool.

type FeeInfoRange

type FeeInfoRange struct {
	Number uint32  `json:"number"`
	Min    float64 `json:"min"`
	Max    float64 `json:"max"`
	Mean   float64 `json:"mean"`
	Median float64 `json:"median"`
	StdDev float64 `json:"stddev"`
}

FeeInfoRange is ticket fee information about a range.

type FeeInfoWindow

type FeeInfoWindow struct {
	StartHeight uint32  `json:"startheight"`
	EndHeight   uint32  `json:"endheight"`
	Number      uint32  `json:"number"`
	Min         float64 `json:"min"`
	Max         float64 `json:"max"`
	Mean        float64 `json:"mean"`
	Median      float64 `json:"median"`
	StdDev      float64 `json:"stddev"`
}

FeeInfoWindow is ticket fee information about an adjustment window.

type GenerateCmd

type GenerateCmd struct {
	NumBlocks uint32
}

GenerateCmd defines the generate JSON-RPC command.

func NewGenerateCmd

func NewGenerateCmd(numBlocks uint32) *GenerateCmd

NewGenerateCmd returns a new instance which can be used to issue a generate JSON-RPC command.

type GenerateVoteCmd

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

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

func NewGenerateVoteCmd

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

NewGenerateVoteCmd creates a new GenerateVoteCmd.

type GenerateVoteResult

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

GenerateVoteResult models the data from the generatevote command.

type GetAccountAddressCmd

type GetAccountAddressCmd struct {
	Account string
}

GetAccountAddressCmd defines the getaccountaddress JSON-RPC command.

func NewGetAccountAddressCmd

func NewGetAccountAddressCmd(account string) *GetAccountAddressCmd

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

type GetAccountBalanceResult

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

GetAccountBalanceResult models the account data from the getbalance command.

type GetAccountCmd

type GetAccountCmd struct {
	Address string
}

GetAccountCmd defines the getaccount JSON-RPC command.

func NewGetAccountCmd

func NewGetAccountCmd(address string) *GetAccountCmd

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

type GetAddedNodeInfoCmd

type GetAddedNodeInfoCmd struct {
	DNS  bool
	Node *string
}

GetAddedNodeInfoCmd defines the getaddednodeinfo JSON-RPC command.

func NewGetAddedNodeInfoCmd

func NewGetAddedNodeInfoCmd(dns bool, node *string) *GetAddedNodeInfoCmd

NewGetAddedNodeInfoCmd returns a new instance which can be used to issue a getaddednodeinfo JSON-RPC command.

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

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
}

GetAddressesByAccountCmd defines the getaddressesbyaccount JSON-RPC command.

func NewGetAddressesByAccountCmd

func NewGetAddressesByAccountCmd(account string) *GetAddressesByAccountCmd

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

type GetBalanceCmd

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

GetBalanceCmd defines the getbalance JSON-RPC command.

func NewGetBalanceCmd

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

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

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

type GetBalanceResult

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

GetBalanceResult models the data from the getbalance command.

type GetBestBlockCmd

type GetBestBlockCmd struct{}

GetBestBlockCmd defines the getbestblock JSON-RPC command.

func NewGetBestBlockCmd

func NewGetBestBlockCmd() *GetBestBlockCmd

NewGetBestBlockCmd returns a new instance which can be used to issue a getbestblock JSON-RPC command.

type GetBestBlockHashCmd

type GetBestBlockHashCmd struct{}

GetBestBlockHashCmd defines the getbestblockhash JSON-RPC command.

func NewGetBestBlockHashCmd

func NewGetBestBlockHashCmd() *GetBestBlockHashCmd

NewGetBestBlockHashCmd returns a new instance which can be used to issue a getbestblockhash JSON-RPC command.

type GetBestBlockResult

type GetBestBlockResult struct {
	Hash   string `json:"hash"`
	Height int64  `json:"height"`
}

GetBestBlockResult models the data from the getbestblock command.

type GetBlockChainInfoCmd

type GetBlockChainInfoCmd struct{}

GetBlockChainInfoCmd defines the getblockchaininfo JSON-RPC command.

func NewGetBlockChainInfoCmd

func NewGetBlockChainInfoCmd() *GetBlockChainInfoCmd

NewGetBlockChainInfoCmd returns a new instance which can be used to issue a getblockchaininfo JSON-RPC command.

type GetBlockChainInfoResult

type GetBlockChainInfoResult struct {
	Chain                string  `json:"chain"`
	Blocks               int32   `json:"blocks"`
	Headers              int32   `json:"headers"`
	BestBlockHash        string  `json:"bestblockhash"`
	Difficulty           float64 `json:"difficulty"`
	VerificationProgress float64 `json:"verificationprogress"`
	ChainWork            string  `json:"chainwork"`
	SyncHeight           int64   `json:"syncheight"`
	DifficultyRatio      float64 `json:"difficultyratio"`
	MaxBlockSize         int64   `json:"maxblocksize"`
}

GetBlockChainInfoResult models the data returned from the getblockchaininfo command.

type GetBlockCmd

type GetBlockCmd struct {
	Hash      string
	Verbose   *bool `jsonrpcdefault:"true"`
	VerboseTx *bool `jsonrpcdefault:"false"`
}

GetBlockCmd defines the getblock JSON-RPC command.

func NewGetBlockCmd

func NewGetBlockCmd(hash string, verbose, verboseTx *bool) *GetBlockCmd

NewGetBlockCmd returns a new instance which can be used to issue a getblock JSON-RPC command.

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

type GetBlockCountCmd

type GetBlockCountCmd struct{}

GetBlockCountCmd defines the getblockcount JSON-RPC command.

func NewGetBlockCountCmd

func NewGetBlockCountCmd() *GetBlockCountCmd

NewGetBlockCountCmd returns a new instance which can be used to issue a getblockcount JSON-RPC command.

type GetBlockHashCmd

type GetBlockHashCmd struct {
	Index int64
}

GetBlockHashCmd defines the getblockhash JSON-RPC command.

func NewGetBlockHashCmd

func NewGetBlockHashCmd(index int64) *GetBlockHashCmd

NewGetBlockHashCmd returns a new instance which can be used to issue a getblockhash JSON-RPC command.

type GetBlockHeaderCmd

type GetBlockHeaderCmd struct {
	Hash    string
	Verbose *bool `jsonrpcdefault:"true"`
}

GetBlockHeaderCmd defines the getblockheader JSON-RPC command.

func NewGetBlockHeaderCmd

func NewGetBlockHeaderCmd(hash string, verbose *bool) *GetBlockHeaderCmd

NewGetBlockHeaderCmd returns a new instance which can be used to issue a getblockheader JSON-RPC command.

type GetBlockHeaderVerboseResult

type GetBlockHeaderVerboseResult struct {
	Hash          string  `json:"hash"`
	Confirmations int64   `json:"confirmations"`
	Version       int32   `json:"version"`
	PreviousHash  string  `json:"previousblockhash,omitempty"`
	MerkleRoot    string  `json:"merkleroot"`
	StakeRoot     string  `json:"stakeroot"`
	VoteBits      uint16  `json:"votebits"`
	FinalState    string  `json:"finalstate"`
	Voters        uint16  `json:"voters"`
	FreshStake    uint8   `json:"freshstake"`
	Revocations   uint8   `json:"revocations"`
	PoolSize      uint32  `json:"poolsize"`
	Bits          string  `json:"bits"`
	SBits         float64 `json:"sbits"`
	Height        uint32  `json:"height"`
	Size          uint32  `json:"size"`
	Time          int64   `json:"time"`
	Nonce         uint32  `json:"nonce"`
	StakeVersion  uint32  `json:"stakeversion"`
	ChainWork     string  `json:"chainwork"`
	Difficulty    float64 `json:"difficulty"`
	NextHash      string  `json:"nextblockhash,omitempty"`
}

GetBlockHeaderVerboseResult models the data from the getblockheader command when the verbose flag is set. When the verbose flag is not set, getblockheader returns a hex-encoded string.

type GetBlockSubsidyCmd

type GetBlockSubsidyCmd struct {
	Height int64
	Voters uint16
}

GetBlockSubsidyCmd defines the getblocksubsidy JSON-RPC command.

func NewGetBlockSubsidyCmd

func NewGetBlockSubsidyCmd(height int64, voters uint16) *GetBlockSubsidyCmd

NewGetBlockSubsidyCmd returns a new instance which can be used to issue a getblocksubsidy JSON-RPC command.

type GetBlockSubsidyResult

type GetBlockSubsidyResult struct {
	Developer int64 `json:"developer"`
	PoS       int64 `json:"pos"`
	PoW       int64 `json:"pow"`
	Total     int64 `json:"total"`
}

GetBlockSubsidyResult models the data returned from the getblocksubsidy command.

type GetBlockTemplateCmd

type GetBlockTemplateCmd struct {
	Request *TemplateRequest
}

GetBlockTemplateCmd defines the getblocktemplate JSON-RPC command.

func NewGetBlockTemplateCmd

func NewGetBlockTemplateCmd(request *TemplateRequest) *GetBlockTemplateCmd

NewGetBlockTemplateCmd returns a new instance which can be used to issue a getblocktemplate JSON-RPC command.

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

type GetBlockTemplateResult

type GetBlockTemplateResult struct {
	// Base fields from BIP 0022.  CoinbaseAux is optional.  One of
	// CoinbaseTxn or CoinbaseValue must be specified, but not both.
	// GBT has been modified from the Bitcoin semantics to include
	// the header rather than various components which are all part
	// of the header anyway.
	Header        string                     `json:"header"`
	SigOpLimit    int64                      `json:"sigoplimit,omitempty"`
	SizeLimit     int64                      `json:"sizelimit,omitempty"`
	Transactions  []GetBlockTemplateResultTx `json:"transactions"`
	STransactions []GetBlockTemplateResultTx `json:"stransactions"`
	CoinbaseAux   *GetBlockTemplateResultAux `json:"coinbaseaux,omitempty"`
	CoinbaseTxn   *GetBlockTemplateResultTx  `json:"coinbasetxn,omitempty"`
	CoinbaseValue *int64                     `json:"coinbasevalue,omitempty"`
	WorkID        string                     `json:"workid,omitempty"`

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

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

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

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

GetBlockTemplateResult models the data returned from the getblocktemplate command.

type GetBlockTemplateResultAux

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

GetBlockTemplateResultAux models the coinbaseaux field of the getblocktemplate command.

type GetBlockTemplateResultTx

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

GetBlockTemplateResultTx models the transactions field of the getblocktemplate command.

type GetBlockVerboseResult

type GetBlockVerboseResult struct {
	Hash          string        `json:"hash"`
	Confirmations int64         `json:"confirmations"`
	Size          int32         `json:"size"`
	Height        int64         `json:"height"`
	Version       int32         `json:"version"`
	MerkleRoot    string        `json:"merkleroot"`
	StakeRoot     string        `json:"stakeroot"`
	Tx            []string      `json:"tx,omitempty"`
	RawTx         []TxRawResult `json:"rawtx,omitempty"`
	STx           []string      `json:"stx,omitempty"`
	RawSTx        []TxRawResult `json:"rawstx,omitempty"`
	Time          int64         `json:"time"`
	Nonce         uint32        `json:"nonce"`
	VoteBits      uint16        `json:"votebits"`
	FinalState    string        `json:"finalstate"`
	Voters        uint16        `json:"voters"`
	FreshStake    uint8         `json:"freshstake"`
	Revocations   uint8         `json:"revocations"`
	PoolSize      uint32        `json:"poolsize"`
	Bits          string        `json:"bits"`
	SBits         float64       `json:"sbits"`
	Difficulty    float64       `json:"difficulty"`
	ExtraData     string        `json:"extradata"`
	StakeVersion  uint32        `json:"stakeversion"`
	PreviousHash  string        `json:"previousblockhash"`
	NextHash      string        `json:"nextblockhash,omitempty"`
}

GetBlockVerboseResult models the data from the getblock command when the verbose flag is set. When the verbose flag is not set, getblock returns a hex-encoded string. Contains Hcd additions.

type GetChainTipsCmd

type GetChainTipsCmd struct{}

GetChainTipsCmd defines the getchaintips JSON-RPC command.

func NewGetChainTipsCmd

func NewGetChainTipsCmd() *GetChainTipsCmd

NewGetChainTipsCmd returns a new instance which can be used to issue a getchaintips JSON-RPC command.

type GetChainTipsResult

type GetChainTipsResult struct {
	Height    int64  `json:"height"`
	Hash      string `json:"hash"`
	BranchLen int64  `json:"branchlen"`
	Status    string `json:"status"`
}

type GetCoinSupplyCmd

type GetCoinSupplyCmd struct{}

GetCoinSupplyCmd defines the getcoinsupply JSON-RPC command.

func NewGetCoinSupplyCmd

func NewGetCoinSupplyCmd() *GetCoinSupplyCmd

NewGetCoinSupplyCmd returns a new instance which can be used to issue a getcoinsupply JSON-RPC command.

type GetConnectionCountCmd

type GetConnectionCountCmd struct{}

GetConnectionCountCmd defines the getconnectioncount JSON-RPC command.

func NewGetConnectionCountCmd

func NewGetConnectionCountCmd() *GetConnectionCountCmd

NewGetConnectionCountCmd returns a new instance which can be used to issue a getconnectioncount JSON-RPC command.

type GetCurrentNetCmd

type GetCurrentNetCmd struct{}

GetCurrentNetCmd defines the getcurrentnet JSON-RPC command.

func NewGetCurrentNetCmd

func NewGetCurrentNetCmd() *GetCurrentNetCmd

NewGetCurrentNetCmd returns a new instance which can be used to issue a getcurrentnet JSON-RPC command.

type GetDifficultyCmd

type GetDifficultyCmd struct{}

GetDifficultyCmd defines the getdifficulty JSON-RPC command.

func NewGetDifficultyCmd

func NewGetDifficultyCmd() *GetDifficultyCmd

NewGetDifficultyCmd returns a new instance which can be used to issue a getdifficulty JSON-RPC command.

type GetGenerateCmd

type GetGenerateCmd struct{}

GetGenerateCmd defines the getgenerate JSON-RPC command.

func NewGetGenerateCmd

func NewGetGenerateCmd() *GetGenerateCmd

NewGetGenerateCmd returns a new instance which can be used to issue a getgenerate JSON-RPC command.

type GetHashesPerSecCmd

type GetHashesPerSecCmd struct{}

GetHashesPerSecCmd defines the gethashespersec JSON-RPC command.

func NewGetHashesPerSecCmd

func NewGetHashesPerSecCmd() *GetHashesPerSecCmd

NewGetHashesPerSecCmd returns a new instance which can be used to issue a gethashespersec JSON-RPC command.

type GetHeadersCmd

type GetHeadersCmd struct {
	BlockLocators string `json:"blocklocators"`
	HashStop      string `json:"hashstop"`
}

GetHeadersCmd defines the getheaders JSON-RPC command.

func NewGetHeadersCmd

func NewGetHeadersCmd(blockLocators string, hashStop string) *GetHeadersCmd

NewGetHeadersCmd returns a new instance which can be used to issue a getheaders JSON-RPC command.

type GetHeadersResult

type GetHeadersResult struct {
	Headers []string `json:"headers"`
}

GetHeadersResult models the data returned by the chain server getheaders command.

type GetInfoCmd

type GetInfoCmd struct{}

GetInfoCmd defines the getinfo JSON-RPC command.

func NewGetInfoCmd

func NewGetInfoCmd() *GetInfoCmd

NewGetInfoCmd returns a new instance which can be used to issue a getinfo JSON-RPC command.

type GetMasterPubkeyCmd

type GetMasterPubkeyCmd struct {
	Account *string
}

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

func NewGetMasterPubkeyCmd

func NewGetMasterPubkeyCmd(acct *string) *GetMasterPubkeyCmd

NewGetMasterPubkeyCmd creates a new GetMasterPubkeyCmd.

type GetMempoolInfoCmd

type GetMempoolInfoCmd struct{}

GetMempoolInfoCmd defines the getmempoolinfo JSON-RPC command.

func NewGetMempoolInfoCmd

func NewGetMempoolInfoCmd() *GetMempoolInfoCmd

NewGetMempoolInfoCmd returns a new instance which can be used to issue a getmempool JSON-RPC command.

type GetMempoolInfoResult

type GetMempoolInfoResult struct {
	Size  int64 `json:"size"`
	Bytes int64 `json:"bytes"`
}

GetMempoolInfoResult models the data returned from the getmempoolinfo command.

type GetMiningInfoCmd

type GetMiningInfoCmd struct{}

GetMiningInfoCmd defines the getmininginfo JSON-RPC command.

func NewGetMiningInfoCmd

func NewGetMiningInfoCmd() *GetMiningInfoCmd

NewGetMiningInfoCmd returns a new instance which can be used to issue a getmininginfo JSON-RPC command.

type GetMiningInfoResult

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

GetMiningInfoResult models the data from the getmininginfo command. Contains Hcd additions.

type GetMultisigOutInfoCmd

type GetMultisigOutInfoCmd struct {
	Hash  string
	Index uint32
}

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

func NewGetMultisigOutInfoCmd

func NewGetMultisigOutInfoCmd(hash string, index uint32) *GetMultisigOutInfoCmd

NewGetMultisigOutInfoCmd creates a new GetMultisigOutInfoCmd.

type GetMultisigOutInfoResult

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

GetMultisigOutInfoResult models the data returned from the getmultisigoutinfo command.

type GetNetTotalsCmd

type GetNetTotalsCmd struct{}

GetNetTotalsCmd defines the getnettotals JSON-RPC command.

func NewGetNetTotalsCmd

func NewGetNetTotalsCmd() *GetNetTotalsCmd

NewGetNetTotalsCmd returns a new instance which can be used to issue a getnettotals JSON-RPC command.

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 `jsonrpcdefault:"120"`
	Height *int `jsonrpcdefault:"-1"`
}

GetNetworkHashPSCmd defines the getnetworkhashps JSON-RPC command.

func NewGetNetworkHashPSCmd

func NewGetNetworkHashPSCmd(numBlocks, height *int) *GetNetworkHashPSCmd

NewGetNetworkHashPSCmd returns a new instance which can be used to issue a getnetworkhashps JSON-RPC command.

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

type GetNetworkInfoCmd

type GetNetworkInfoCmd struct{}

GetNetworkInfoCmd defines the getnetworkinfo JSON-RPC command.

func NewGetNetworkInfoCmd

func NewGetNetworkInfoCmd() *GetNetworkInfoCmd

NewGetNetworkInfoCmd returns a new instance which can be used to issue a getnetworkinfo JSON-RPC command.

type GetNetworkInfoResult

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

GetNetworkInfoResult models the data returned from the getnetworkinfo command.

type GetNewAddressCmd

type GetNewAddressCmd struct {
	Account   *string
	GapPolicy *string
}

GetNewAddressCmd defines the getnewaddress JSON-RPC command.

func NewGetNewAddressCmd

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

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

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

type GetPeerInfoCmd

type GetPeerInfoCmd struct{}

GetPeerInfoCmd defines the getpeerinfo JSON-RPC command.

func NewGetPeerInfoCmd

func NewGetPeerInfoCmd() *GetPeerInfoCmd

NewGetPeerInfoCmd returns a new instance which can be used to issue a getpeer JSON-RPC command.

type GetPeerInfoResult

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

GetPeerInfoResult models the data returned from the getpeerinfo command.

type GetRawChangeAddressCmd

type GetRawChangeAddressCmd struct {
	Account *string
}

GetRawChangeAddressCmd defines the getrawchangeaddress JSON-RPC command.

func NewGetRawChangeAddressCmd

func NewGetRawChangeAddressCmd(account *string) *GetRawChangeAddressCmd

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

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

type GetRawMempoolCmd

type GetRawMempoolCmd struct {
	Verbose *bool `jsonrpcdefault:"false"`
	TxType  *string
}

GetRawMempoolCmd defines the getmempool JSON-RPC command.

func NewGetRawMempoolCmd

func NewGetRawMempoolCmd(verbose *bool, txType *string) *GetRawMempoolCmd

NewGetRawMempoolCmd returns a new instance which can be used to issue a getrawmempool JSON-RPC command.

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

type GetRawMempoolTxTypeCmd

type GetRawMempoolTxTypeCmd string

GetRawMempoolTxTypeCmd defines the type used in the getrawmempool JSON-RPC command for the TxType command field.

const (
	// GRMAll indicates any type of transaction should be returned.
	GRMAll GetRawMempoolTxTypeCmd = "all"

	// GRMRegular indicates only regular transactions should be returned.
	GRMRegular GetRawMempoolTxTypeCmd = "regular"

	// GRMTickets indicates that only tickets should be returned.
	GRMTickets GetRawMempoolTxTypeCmd = "tickets"

	// GRMVotes indicates that only votes should be returned.
	GRMVotes GetRawMempoolTxTypeCmd = "votes"

	// GRMRevocations indicates that only revocations should be returned.
	GRMRevocations GetRawMempoolTxTypeCmd = "revocations"
)

type GetRawMempoolVerboseResult

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

GetRawMempoolVerboseResult models the data returned from the getrawmempool command when the verbose flag is set. When the verbose flag is not set, getrawmempool returns an array of transaction hashes.

type GetRawTransactionCmd

type GetRawTransactionCmd struct {
	Txid    string
	Verbose *int `jsonrpcdefault:"0"`
}

GetRawTransactionCmd defines the getrawtransaction JSON-RPC command.

NOTE: This field is an int versus a bool to remain compatible with Bitcoin Core even though it really should be a bool.

func NewGetRawTransactionCmd

func NewGetRawTransactionCmd(txHash string, verbose *int) *GetRawTransactionCmd

NewGetRawTransactionCmd returns a new instance which can be used to issue a getrawtransaction JSON-RPC command.

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

type GetReceivedByAccountCmd

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

GetReceivedByAccountCmd defines the getreceivedbyaccount JSON-RPC command.

func NewGetReceivedByAccountCmd

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

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

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

type GetReceivedByAddressCmd

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

GetReceivedByAddressCmd defines the getreceivedbyaddress JSON-RPC command.

func NewGetReceivedByAddressCmd

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

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

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

type GetSeedCmd

type GetSeedCmd struct {
}

GetSeedCmd is a type handling custom marshaling and unmarshaling of getseed JSON wallet extension commands.

func NewGetSeedCmd

func NewGetSeedCmd() *GetSeedCmd

NewGetSeedCmd creates a new GetSeedCmd.

type GetStakeDifficultyCmd

type GetStakeDifficultyCmd struct{}

GetStakeDifficultyCmd is a type handling custom marshaling and unmarshaling of getstakedifficulty JSON RPC commands.

func NewGetStakeDifficultyCmd

func NewGetStakeDifficultyCmd() *GetStakeDifficultyCmd

NewGetStakeDifficultyCmd returns a new instance which can be used to issue a JSON-RPC getstakedifficulty command.

type GetStakeDifficultyResult

type GetStakeDifficultyResult struct {
	CurrentStakeDifficulty float64 `json:"current"`
	NextStakeDifficulty    float64 `json:"next"`
}

GetStakeDifficultyResult models the data returned from the getstakedifficulty command.

type GetStakeInfoCmd

type GetStakeInfoCmd struct {
}

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

func NewGetStakeInfoCmd

func NewGetStakeInfoCmd() *GetStakeInfoCmd

NewGetStakeInfoCmd creates a new GetStakeInfoCmd.

type GetStakeInfoResult

type GetStakeInfoResult struct {
	BlockHeight      int64   `json:"blockheight"`
	PoolSize         uint32  `json:"poolsize"`
	Difficulty       float64 `json:"difficulty"`
	AllMempoolTix    uint32  `json:"allmempooltix"`
	OwnMempoolTix    uint32  `json:"ownmempooltix"`
	Immature         uint32  `json:"immature"`
	Live             uint32  `json:"live"`
	ProportionLive   float64 `json:"proportionlive"`
	Voted            uint32  `json:"voted"`
	TotalSubsidy     float64 `json:"totalsubsidy"`
	Missed           uint32  `json:"missed"`
	ProportionMissed float64 `json:"proportionmissed"`
	Revoked          uint32  `json:"revoked"`
	Expired          uint32  `json:"expired"`
}

GetStakeInfoResult models the data returned from the getstakeinfo command.

type GetStakeVersionInfoCmd

type GetStakeVersionInfoCmd struct {
	Count *int32
}

GetStakeVersionInfoCmd returns stake version info for the current interval. Optionally, Count indicates how many additional intervals to return.

func NewGetStakeVersionInfoCmd

func NewGetStakeVersionInfoCmd(count int32) *GetStakeVersionInfoCmd

NewGetStakeVersionInfoCmd returns a new instance which can be used to issue a JSON-RPC getstakeversioninfo command.

type GetStakeVersionInfoResult

type GetStakeVersionInfoResult struct {
	CurrentHeight int64             `json:"currentheight"`
	Hash          string            `json:"hash"`
	Intervals     []VersionInterval `json:"intervals"`
}

GetStakeVersionInfoResult models the resulting data for getstakeversioninfo command.

type GetStakeVersionsCmd

type GetStakeVersionsCmd struct {
	Hash  string
	Count int32
}

GetStakeVersionsCmd returns stake version for a range of blocks. Count indicates how many blocks are walked backwards.

func NewGetStakeVersionsCmd

func NewGetStakeVersionsCmd(hash string, count int32) *GetStakeVersionsCmd

NewGetStakeVersionsCmd returns a new instance which can be used to issue a JSON-RPC getstakeversions command.

type GetStakeVersionsResult

type GetStakeVersionsResult struct {
	StakeVersions []StakeVersions `json:"stakeversions"`
}

GetStakeVersionsResult models the data returned from the getstakeversions command.

type GetStraightPubKeyCmd

type GetStraightPubKeyCmd struct {
	SrcAddress string
}

type GetStraightPubKeyResult

type GetStraightPubKeyResult struct {
	StraightPubKey string `json:"StraightPubKey"`
}

GetStraightPubKeyResult models the data returned from the getStraightPubKey command.

type GetTicketFeeCmd

type GetTicketFeeCmd struct {
}

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

func NewGetTicketFeeCmd

func NewGetTicketFeeCmd() *GetTicketFeeCmd

NewGetTicketFeeCmd creates a new GetTicketFeeCmd.

type GetTicketPoolValueCmd

type GetTicketPoolValueCmd struct{}

GetTicketPoolValueCmd defines the getticketpoolvalue JSON-RPC command.

func NewGetTicketPoolValueCmd

func NewGetTicketPoolValueCmd() *GetTicketPoolValueCmd

NewGetTicketPoolValueCmd returns a new instance which can be used to issue a getticketpoolvalue JSON-RPC command.

type GetTicketsCmd

type GetTicketsCmd struct {
	IncludeImmature bool
}

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

func NewGetTicketsCmd

func NewGetTicketsCmd(includeImmature bool) *GetTicketsCmd

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

type GetTicketsResult

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

GetTicketsResult models the data returned from the gettickets command.

type GetTransactionCmd

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

GetTransactionCmd defines the gettransaction JSON-RPC command.

func NewGetTransactionCmd

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

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

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

type GetTransactionDetailsResult

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

GetTransactionDetailsResult models the details data from the gettransaction command.

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

type GetTransactionResult

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

GetTransactionResult models the data from the gettransaction command.

type GetTxOutCmd

type GetTxOutCmd struct {
	Txid           string
	Vout           uint32
	IncludeMempool *bool `jsonrpcdefault:"true"`
}

GetTxOutCmd defines the gettxout JSON-RPC command.

func NewGetTxOutCmd

func NewGetTxOutCmd(txHash string, vout uint32, includeMempool *bool) *GetTxOutCmd

NewGetTxOutCmd returns a new instance which can be used to issue a gettxout JSON-RPC command.

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

type GetTxOutResult

type GetTxOutResult struct {
	BestBlock     string             `json:"bestblock"`
	Confirmations int64              `json:"confirmations"`
	Value         float64            `json:"value"`
	ScriptPubKey  ScriptPubKeyResult `json:"scriptPubKey"`
	Version       int32              `json:"version"`
	Coinbase      bool               `json:"coinbase"`
}

GetTxOutResult models the data from the gettxout command.

type GetTxOutSetInfoCmd

type GetTxOutSetInfoCmd struct{}

GetTxOutSetInfoCmd defines the gettxoutsetinfo JSON-RPC command.

func NewGetTxOutSetInfoCmd

func NewGetTxOutSetInfoCmd() *GetTxOutSetInfoCmd

NewGetTxOutSetInfoCmd returns a new instance which can be used to issue a gettxoutsetinfo JSON-RPC command.

type GetUnconfirmedBalanceCmd

type GetUnconfirmedBalanceCmd struct {
	Account *string
}

GetUnconfirmedBalanceCmd defines the getunconfirmedbalance JSON-RPC command.

func NewGetUnconfirmedBalanceCmd

func NewGetUnconfirmedBalanceCmd(account *string) *GetUnconfirmedBalanceCmd

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

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

type GetVoteChoicesCmd

type GetVoteChoicesCmd struct {
}

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

func NewGetVoteChoicesCmd

func NewGetVoteChoicesCmd() *GetVoteChoicesCmd

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

type GetVoteChoicesResult

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

GetVoteChoicesResult models the data returned by the getvotechoices command.

type GetVoteInfoCmd

type GetVoteInfoCmd struct {
	Version uint32
}

GetVoteInfoCmd returns voting results over a range of blocks. Count indicates how many blocks are walked backwards.

func NewGetVoteInfoCmd

func NewGetVoteInfoCmd(version uint32) *GetVoteInfoCmd

NewGetVoteInfoCmd returns a new instance which can be used to issue a JSON-RPC getvoteinfo command.

type GetVoteInfoResult

type GetVoteInfoResult struct {
	CurrentHeight int64    `json:"currentheight"`
	StartHeight   int64    `json:"startheight"`
	EndHeight     int64    `json:"endheight"`
	Hash          string   `json:"hash"`
	VoteVersion   uint32   `json:"voteversion"`
	Quorum        uint32   `json:"quorum"`
	TotalVotes    uint32   `json:"totalvotes"`
	Agendas       []Agenda `json:"agendas,omitempty"`
}

GetVoteInfoResult models the data returned from the getvoteinfo command.

type GetWalletFeeCmd

type GetWalletFeeCmd struct{}

GetWalletFeeCmd defines the getwalletfee JSON-RPC command.

func NewGetWalletFeeCmd

func NewGetWalletFeeCmd() *GetWalletFeeCmd

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

type GetWorkCmd

type GetWorkCmd struct {
	Data *string
}

GetWorkCmd defines the getwork JSON-RPC command.

func NewGetWorkCmd

func NewGetWorkCmd(data *string) *GetWorkCmd

NewGetWorkCmd returns a new instance which can be used to issue a getwork JSON-RPC command.

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

type GetWorkResult

type GetWorkResult struct {
	Data   string `json:"data"`
	Target string `json:"target"`
}

GetWorkResult models the data from the getwork command.

type HelpCmd

type HelpCmd struct {
	Command *string
}

HelpCmd defines the help JSON-RPC command.

func NewHelpCmd

func NewHelpCmd(command *string) *HelpCmd

NewHelpCmd returns a new instance which can be used to issue a help JSON-RPC command.

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

type ImportAddressCmd

type ImportAddressCmd struct {
	Address string
	Rescan  *bool `jsonrpcdefault:"true"`
}

ImportAddressCmd defines the importaddress JSON-RPC command.

func NewImportAddressCmd

func NewImportAddressCmd(address string, rescan *bool) *ImportAddressCmd

NewImportAddressCmd returns a new instance which can be used to issue an importaddress JSON-RPC command.

type ImportPrivKeyCmd

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

ImportPrivKeyCmd defines the importprivkey JSON-RPC command.

func NewImportPrivKeyCmd

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

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

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

type ImportPubKeyCmd

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

ImportPubKeyCmd defines the importpubkey JSON-RPC command.

func NewImportPubKeyCmd

func NewImportPubKeyCmd(pubKey string, rescan *bool) *ImportPubKeyCmd

NewImportPubKeyCmd returns a new instance which can be used to issue an importpubkey JSON-RPC command.

type ImportScriptCmd

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

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

func NewImportScriptCmd

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

NewImportScriptCmd creates a new GetImportScriptCmd.

type InfoChainResult

type InfoChainResult struct {
	Version         int32   `json:"version"`
	ProtocolVersion int32   `json:"protocolversion"`
	Blocks          int64   `json:"blocks"`
	TimeOffset      int64   `json:"timeoffset"`
	Connections     int32   `json:"connections"`
	Proxy           string  `json:"proxy"`
	Difficulty      float64 `json:"difficulty"`
	TestNet         bool    `json:"testnet"`
	RelayFee        float64 `json:"relayfee"`
	Errors          string  `json:"errors"`
}

InfoChainResult models the data returned by the chain server getinfo command.

type InfoWalletResult

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

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

type KeyPoolRefillCmd

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

KeyPoolRefillCmd defines the keypoolrefill JSON-RPC command.

func NewKeyPoolRefillCmd

func NewKeyPoolRefillCmd(newSize *uint) *KeyPoolRefillCmd

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

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

type ListAccountsCmd

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

ListAccountsCmd defines the listaccounts JSON-RPC command.

func NewListAccountsCmd

func NewListAccountsCmd(minConf *int) *ListAccountsCmd

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

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

type ListAddressTransactionsCmd

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

ListAddressTransactionsCmd defines the listaddresstransactions JSON-RPC command.

func NewListAddressTransactionsCmd

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

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

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

type ListAllTransactionsCmd

type ListAllTransactionsCmd struct {
	Account *string
}

ListAllTransactionsCmd defines the listalltransactions JSON-RPC command.

func NewListAllTransactionsCmd

func NewListAllTransactionsCmd(account *string) *ListAllTransactionsCmd

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

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

type ListLockUnspentCmd

type ListLockUnspentCmd struct{}

ListLockUnspentCmd defines the listlockunspent JSON-RPC command.

func NewListLockUnspentCmd

func NewListLockUnspentCmd() *ListLockUnspentCmd

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

type ListReceivedByAccountCmd

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

ListReceivedByAccountCmd defines the listreceivedbyaccount JSON-RPC command.

func NewListReceivedByAccountCmd

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

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

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

type ListReceivedByAccountResult

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

ListReceivedByAccountResult models the data from the listreceivedbyaccount command.

type ListReceivedByAddressCmd

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

ListReceivedByAddressCmd defines the listreceivedbyaddress JSON-RPC command.

func NewListReceivedByAddressCmd

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

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

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

type ListReceivedByAddressResult

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

ListReceivedByAddressResult models the data from the listreceivedbyaddress command.

type ListScriptsCmd

type ListScriptsCmd struct {
}

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

func NewListScriptsCmd

func NewListScriptsCmd() *ListScriptsCmd

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

type ListScriptsResult

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

ListScriptsResult models the data returned from the listscripts command.

type ListSinceBlockCmd

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

ListSinceBlockCmd defines the listsinceblock JSON-RPC command.

func NewListSinceBlockCmd

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

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

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

type ListSinceBlockResult

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

ListSinceBlockResult models the data from the listsinceblock command.

type ListTransactionsCmd

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

ListTransactionsCmd defines the listtransactions JSON-RPC command.

func NewListTransactionsCmd

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

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

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

type ListTransactionsResult

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

ListTransactionsResult models the data from the listtransactions command.

type ListTransactionsTxType

type ListTransactionsTxType string

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

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

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

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

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

type ListUnspentCmd

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

ListUnspentCmd defines the listunspent JSON-RPC command.

func NewListUnspentCmd

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

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

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

type ListUnspentResult

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

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

type LiveTicketsCmd

type LiveTicketsCmd struct{}

LiveTicketsCmd is a type handling custom marshaling and unmarshaling of livetickets JSON RPC commands.

func NewLiveTicketsCmd

func NewLiveTicketsCmd() *LiveTicketsCmd

NewLiveTicketsCmd returns a new instance which can be used to issue a JSON-RPC livetickets command.

type LiveTicketsResult

type LiveTicketsResult struct {
	Tickets []string `json:"tickets"`
}

LiveTicketsResult models the data returned from the livetickets command.

type LoadTxFilterCmd

type LoadTxFilterCmd struct {
	Reload    bool
	Addresses []string
	OutPoints []OutPoint
}

LoadTxFilterCmd defines the loadtxfilter request parameters to load or reload a transaction filter.

func NewLoadTxFilterCmd

func NewLoadTxFilterCmd(reload bool, addresses []string, outPoints []OutPoint) *LoadTxFilterCmd

NewLoadTxFilterCmd returns a new instance which can be used to issue a loadtxfilter JSON-RPC command.

type LocalAddressesResult

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

LocalAddressesResult models the localaddresses data from the getnetworkinfo command.

type LockUnspentCmd

type LockUnspentCmd struct {
	Unlock       bool
	Transactions []TransactionInput
}

LockUnspentCmd defines the lockunspent JSON-RPC command.

func NewLockUnspentCmd

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

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

type MissedTicketsCmd

type MissedTicketsCmd struct{}

MissedTicketsCmd is a type handling custom marshaling and unmarshaling of missedtickets JSON RPC commands.

func NewMissedTicketsCmd

func NewMissedTicketsCmd() *MissedTicketsCmd

NewMissedTicketsCmd returns a new instance which can be used to issue a JSON-RPC missedtickets command.

type MissedTicketsResult

type MissedTicketsResult struct {
	Tickets []string `json:"tickets"`
}

MissedTicketsResult models the data returned from the missedtickets command.

type NetworksResult

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

NetworksResult models the networks data from the getnetworkinfo command.

type NewTicketsNtfn

type NewTicketsNtfn struct {
	Hash      string
	Height    int32
	StakeDiff int64
	Tickets   []string
}

NewTicketsNtfn is a type handling custom marshaling and unmarshaling of newtickets JSON websocket notifications.

func NewNewTicketsNtfn

func NewNewTicketsNtfn(hash string, height int32, stakeDiff int64, tickets []string) *NewTicketsNtfn

NewNewTicketsNtfn creates a new NewTicketsNtfn.

type NewTxNtfn

type NewTxNtfn struct {
	Account string
	Details ListTransactionsResult
}

NewTxNtfn defines the newtx JSON-RPC notification.

func NewNewTxNtfn

func NewNewTxNtfn(account string, details ListTransactionsResult) *NewTxNtfn

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

type NodeCmd

type NodeCmd struct {
	SubCmd        NodeSubCmd `jsonrpcusage:"\"connect|remove|disconnect\""`
	Target        string
	ConnectSubCmd *string `jsonrpcusage:"\"perm|temp\""`
}

NodeCmd defines the dropnode JSON-RPC command.

func NewNodeCmd

func NewNodeCmd(subCmd NodeSubCmd, target string, connectSubCmd *string) *NodeCmd

NewNodeCmd returns a new instance which can be used to issue a `node` JSON-RPC command.

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

type NodeSubCmd

type NodeSubCmd string

NodeSubCmd defines the type used in the addnode JSON-RPC command for the sub command field.

const (
	// NConnect indicates the specified host that should be connected to.
	NConnect NodeSubCmd = "connect"

	// NRemove indicates the specified peer that should be removed as a
	// persistent peer.
	NRemove NodeSubCmd = "remove"

	// NDisconnect indicates the specified peer should be disonnected.
	NDisconnect NodeSubCmd = "disconnect"
)

type NotifyBlocksCmd

type NotifyBlocksCmd struct{}

NotifyBlocksCmd defines the notifyblocks JSON-RPC command.

func NewNotifyBlocksCmd

func NewNotifyBlocksCmd() *NotifyBlocksCmd

NewNotifyBlocksCmd returns a new instance which can be used to issue a notifyblocks JSON-RPC command.

type NotifyNewTicketsCmd

type NotifyNewTicketsCmd struct {
}

NotifyNewTicketsCmd is a type handling custom marshaling and unmarshaling of notifynewtickets JSON websocket extension commands.

func NewNotifyNewTicketsCmd

func NewNotifyNewTicketsCmd() *NotifyNewTicketsCmd

NewNotifyNewTicketsCmd creates a new NotifyNewTicketsCmd.

type NotifyNewTransactionsCmd

type NotifyNewTransactionsCmd struct {
	Verbose *bool `jsonrpcdefault:"false"`
}

NotifyNewTransactionsCmd defines the notifynewtransactions JSON-RPC command.

func NewNotifyNewTransactionsCmd

func NewNotifyNewTransactionsCmd(verbose *bool) *NotifyNewTransactionsCmd

NewNotifyNewTransactionsCmd returns a new instance which can be used to issue a notifynewtransactions JSON-RPC command.

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

type NotifySpentAndMissedTicketsCmd

type NotifySpentAndMissedTicketsCmd struct {
}

NotifySpentAndMissedTicketsCmd is a type handling custom marshaling and unmarshaling of notifyspentandmissedtickets JSON websocket extension commands.

func NewNotifySpentAndMissedTicketsCmd

func NewNotifySpentAndMissedTicketsCmd() *NotifySpentAndMissedTicketsCmd

NewNotifySpentAndMissedTicketsCmd creates a new NotifySpentAndMissedTicketsCmd.

type NotifyStakeDifficultyCmd

type NotifyStakeDifficultyCmd struct {
}

NotifyStakeDifficultyCmd is a type handling custom marshaling and unmarshaling of notifystakedifficulty JSON websocket extension commands.

func NewNotifyStakeDifficultyCmd

func NewNotifyStakeDifficultyCmd() *NotifyStakeDifficultyCmd

NewNotifyStakeDifficultyCmd creates a new NotifyStakeDifficultyCmd.

type NotifyWinningTicketsCmd

type NotifyWinningTicketsCmd struct {
}

NotifyWinningTicketsCmd is a type handling custom marshaling and unmarshaling of notifywinningtickets JSON websocket extension commands.

func NewNotifyWinningTicketsCmd

func NewNotifyWinningTicketsCmd() *NotifyWinningTicketsCmd

NewNotifyWinningTicketsCmd creates a new NotifyWinningTicketsCmd.

type OmniClearCmd

type OmniClearCmd struct{}

OmniClearCmd Sets the global flag that determines whether transactions are automatically committed and broadcasted. example: $ omnicore-cli "OmniClearCmd" false

func NewOmniClearCmd

func NewOmniClearCmd(height uint32, hashs *[]string) *OmniClearCmd

type OmniCreateAgreementCmd

type OmniCreateAgreementCmd struct {
	AgtType                string
	AgtContent             string
	AgtnonencryptedContent string
	AgtKey                 string
	AgtEncryptedContent    string
}

OmniCreateAgreementCmd

func NewOmniCreateAgreementCmd

func NewOmniCreateAgreementCmd() *OmniCreateAgreementCmd

type OmniCreatepayloadCancelalltradesCmd

type OmniCreatepayloadCancelalltradesCmd struct {
}

OmniCreatepayloadCancelalltrades // Creates the payload to cancel all offers on the distributed token exchange with the given currency pair. example: $ omnicore-cli "omni_createpayload_cancelalltrades" 1

func NewOmniCreatepayloadCancelalltradesCmd

func NewOmniCreatepayloadCancelalltradesCmd() *OmniCreatepayloadCancelalltradesCmd

type OmniCreatepayloadCancelalltradesResult

type OmniCreatepayloadCancelalltradesResult struct {
}

type OmniCreatepayloadCanceltradesbypairCmd

type OmniCreatepayloadCanceltradesbypairCmd struct {
	Propertyidforsale int64 `json:"propertyidforsale" desc:"the identifier of the tokens to list for sale"`
	Propertyiddesired int64 `json:"propertyiddesired" desc:"the identifier of the tokens desired in exchange"`
}

OmniCreatepayloadCanceltradesbypair // Creates the payload to cancel all offers on the distributed token exchange with the given currency pair. example: $ omnicore-cli "omni_createpayload_canceltradesbypair" 1 31

func NewOmniCreatepayloadCanceltradesbypairCmd

func NewOmniCreatepayloadCanceltradesbypairCmd(propertyidforsale int64, propertyiddesired int64) *OmniCreatepayloadCanceltradesbypairCmd

type OmniCreatepayloadCanceltradesbypairResult

type OmniCreatepayloadCanceltradesbypairResult struct {
}

type OmniCreatepayloadCanceltradesbypriceCmd

type OmniCreatepayloadCanceltradesbypriceCmd struct {
	Propertyidforsale int64  `json:"propertyidforsale" desc:"the identifier of the tokens to list for sale"`
	Amountforsale     string `json:"amountforsale" desc:"the amount of tokens to list for sale"`
	Propertyiddesired int64  `json:"propertyiddesired" desc:"the identifier of the tokens desired in exchange"`
	Amountdesired     string `json:"amountdesired" desc:"the amount of tokens desired in exchange"`
}

OmniCreatepayloadCanceltradesbyprice // Creates the payload to cancel offers on the distributed token exchange with the specified price. Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! example: $ omnicore-cli "omni_createpayload_canceltradesbyprice" 31 "100.0" 1 "5.0"

func NewOmniCreatepayloadCanceltradesbypriceCmd

func NewOmniCreatepayloadCanceltradesbypriceCmd(propertyidforsale int64, amountforsale string, propertyiddesired int64, amountdesired string) *OmniCreatepayloadCanceltradesbypriceCmd

type OmniCreatepayloadCanceltradesbypriceResult

type OmniCreatepayloadCanceltradesbypriceResult struct {
}

type OmniCreatepayloadChangeissuerCmd

type OmniCreatepayloadChangeissuerCmd struct {
	Propertyid int64 `json:"propertyid" desc:"the identifier of the tokens to revoke"`
}

OmniCreatepayloadChangeissuer // Creates the payload to change the issuer on record of the given tokens. example: $ omnicore-cli "omni_createpayload_changeissuer" 3

func NewOmniCreatepayloadChangeissuerCmd

func NewOmniCreatepayloadChangeissuerCmd() *OmniCreatepayloadChangeissuerCmd

type OmniCreatepayloadChangeissuerResult

type OmniCreatepayloadChangeissuerResult struct {
}

type OmniCreatepayloadClosecrowdsaleCmd

type OmniCreatepayloadClosecrowdsaleCmd struct {
}

OmniCreatepayloadClosecrowdsale // Creates the payload to manually close a crowdsale. example: $ omnicore-cli "omni_createpayload_closecrowdsale" 70

func NewOmniCreatepayloadClosecrowdsaleCmd

func NewOmniCreatepayloadClosecrowdsaleCmd() *OmniCreatepayloadClosecrowdsaleCmd

type OmniCreatepayloadClosecrowdsaleResult

type OmniCreatepayloadClosecrowdsaleResult struct {
}

type OmniCreatepayloadDexacceptCmd

type OmniCreatepayloadDexacceptCmd struct {
	Propertyid int64  `json:"propertyid" desc:"the identifier of the token to purchase"`
	Amount     string `json:"amount" desc:"the amount to accept"`
}

OmniCreatepayloadDexaccept // Create the payload for an accept offer for the specified token and amount. Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! example: $ omnicore-cli "omni_createpayload_dexaccept" 1 "15.0"

func NewOmniCreatepayloadDexacceptCmd

func NewOmniCreatepayloadDexacceptCmd(propertyid int64, amount string) *OmniCreatepayloadDexacceptCmd

type OmniCreatepayloadDexacceptResult

type OmniCreatepayloadDexacceptResult struct {
}

type OmniCreatepayloadDexsellCmd

type OmniCreatepayloadDexsellCmd struct {
	Propertyidforsale int64  `json:"propertyidforsale" desc:"the identifier of the tokens to list for sale (must be 1 for OMNI or 2 for TOMNI)"`
	Amountforsale     string `json:"amountforsale" desc:"the amount of tokens to list for sale"`
	Amountdesired     string `json:"amountdesired" desc:"the amount of bitcoins desired"`
	Paymentwindow     int64  `json:"paymentwindow" desc:"a time limit in blocks a buyer has to pay following a successful accepting order"`
	Minacceptfee      string `json:"minacceptfee" desc:"a minimum mining fee a buyer has to pay to accept the offer"`
	Action            int64  `json:"action" desc:"the action to take (1 for new offers, 2 to update\", 3 to cancel)"`
}

OmniCreatepayloadDexsell // Create a payload to place, update or cancel a sell offer on the traditional distributed OMNI/BTC exchange. example: $ omnicore-cli "omni_createpayload_dexsell" 1 "1.5" "0.75" 25 "0.0005" 1

func NewOmniCreatepayloadDexsellCmd

func NewOmniCreatepayloadDexsellCmd(propertyidforsale int64, amountforsale string, amountdesired string, paymentwindow int64, minacceptfee string, action int64) *OmniCreatepayloadDexsellCmd

type OmniCreatepayloadDexsellResult

type OmniCreatepayloadDexsellResult struct {
}

type OmniCreatepayloadDisablefreezingCmd

type OmniCreatepayloadDisablefreezingCmd struct {
	Propertyid int64 `json:"propertyid" desc:"the identifier of the tokens"`
}

OmniCreatepayloadDisablefreezing // Creates the payload to disable address freezing for a centrally managed property. IMPORTANT NOTE: Disabling freezing for a property will UNFREEZE all frozen addresses for that property! example: $ omnicore-cli "omni_createpayload_disablefreezing" 3

func NewOmniCreatepayloadDisablefreezingCmd

func NewOmniCreatepayloadDisablefreezingCmd() *OmniCreatepayloadDisablefreezingCmd

type OmniCreatepayloadDisablefreezingResult

type OmniCreatepayloadDisablefreezingResult struct {
}

type OmniCreatepayloadEnablefreezingCmd

type OmniCreatepayloadEnablefreezingCmd struct {
	Propertyid int64 `json:"propertyid" desc:"the identifier of the tokens"`
}

OmniCreatepayloadEnablefreezing // Creates the payload to enable address freezing for a centrally managed property. example: $ omnicore-cli "omni_createpayload_enablefreezing" 3

func NewOmniCreatepayloadEnablefreezingCmd

func NewOmniCreatepayloadEnablefreezingCmd() *OmniCreatepayloadEnablefreezingCmd

type OmniCreatepayloadEnablefreezingResult

type OmniCreatepayloadEnablefreezingResult struct {
}

type OmniCreatepayloadFreezeCmd

type OmniCreatepayloadFreezeCmd struct {
	Toaddress  string `json:"toaddress" desc:"the address to freeze tokens for"`
	Propertyid int64  `json:"propertyid" desc:"the property to freeze tokens for (must be managed type and have freezing option enabled)"`
	Amount     string `` /* 128-byte string literal not displayed */
}

OmniCreatepayloadFreeze // Creates the payload to freeze an address for a centrally managed token. Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! example: $ omnicore-cli "omni_createpayload_freeze" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 31 "100"

func NewOmniCreatepayloadFreezeCmd

func NewOmniCreatepayloadFreezeCmd(toaddress string, propertyid int64, amount string) *OmniCreatepayloadFreezeCmd

type OmniCreatepayloadFreezeResult

type OmniCreatepayloadFreezeResult struct {
}

type OmniCreatepayloadGrantCmd

type OmniCreatepayloadGrantCmd struct {
	Propertyid int64   `json:"propertyid" desc:"the identifier of the tokens to grant"`
	Amount     string  `json:"amount" desc:"the amount of tokens to create"`
	Memo       *string `json:"memo" desc:"a text note attached to this transaction (none by default)"`
}

OmniCreatepayloadGrant // Creates the payload to issue or grant new units of managed tokens. Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! example: $ omnicore-cli "omni_createpayload_grant" 51 "7000"

func NewOmniCreatepayloadGrantCmd

func NewOmniCreatepayloadGrantCmd(propertyid int64, amount string, memo *string) *OmniCreatepayloadGrantCmd

type OmniCreatepayloadGrantResult

type OmniCreatepayloadGrantResult struct {
}

type OmniCreatepayloadIssuancecrowdsaleCmd

type OmniCreatepayloadIssuancecrowdsaleCmd struct {
	Ecosystem         int64  `json:"ecosystem" desc:"the ecosystem to create the tokens in (1 for main ecosystem, 2 for test ecosystem)"`
	Typo              int64  `json:"type" desc:"the type of the tokens to create: (1 for indivisible tokens, 2 for divisible tokens)"`
	Previousid        int64  `json:"previousid" desc:"an identifier of a predecessor token (use 0 for new tokens)"`
	Category          string `json:"category" desc:"a category for the new tokens (can be "")"`
	Subcategory       string `json:"subcategory" desc:"a subcategory for the new tokens (can be "")"`
	Name              string `json:"name" desc:"the name of the new tokens to create"`
	Url               string `json:"url" desc:"an URL for further information about the new tokens (can be "")"`
	Data              string `json:"data" desc:"a description for the new tokens (can be "")"`
	Propertyiddesired int64  `json:"propertyiddesired" desc:"the identifier of a token eligible to participate in the crowdsale"`
	Tokensperunit     string `json:"tokensperunit" desc:"the amount of tokens granted per unit invested in the crowdsale"`
	Deadline          int64  `json:"deadline" desc:"the deadline of the crowdsale as Unix timestamp"`
	Earlybonus        int64  `json:"earlybonus" desc:"an early bird bonus for participants in percent per week"`
	Issuerpercentage  int64  `json:"issuerpercentage" desc:"a percentage of tokens that will be granted to the issuer"`
}

OmniCreatepayloadIssuancecrowdsale // Creates the payload for a new tokens issuance with crowdsale. example: $ omnicore-cli "omni_createpayload_issuancecrowdsale" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" "" 2 "100" 1483228800 30 2

func NewOmniCreatepayloadIssuancecrowdsaleCmd

func NewOmniCreatepayloadIssuancecrowdsaleCmd(ecosystem int64, typo int64, previousid int64, category string, subcategory string, name string, url string, data string, propertyiddesired int64, tokensperunit string, deadline int64, earlybonus int64, issuerpercentage int64) *OmniCreatepayloadIssuancecrowdsaleCmd

type OmniCreatepayloadIssuancecrowdsaleResult

type OmniCreatepayloadIssuancecrowdsaleResult struct {
}

type OmniCreatepayloadIssuancefixedCmd

type OmniCreatepayloadIssuancefixedCmd struct {
	Ecosystem   int64  `json:"ecosystem" desc:"the ecosystem to create the tokens in (1 for main ecosystem, 2 for test ecosystem)"`
	Typo        int64  `json:"type" desc:"the type of the tokens to create: (1 for indivisible tokens, 2 for divisible tokens)"`
	Previousid  int64  `json:"previousid" desc:"an identifier of a predecessor token (use 0 for new tokens)"`
	Category    string `json:"category" desc:"a category for the new tokens (can be "")"`
	Subcategory string `json:"subcategory" desc:"a subcategory for the new tokens (can be "")"`
	Name        string `json:"name" desc:"the name of the new tokens to create"`
	Url         string `json:"url" desc:"an URL for further information about the new tokens (can be "")"`
	Data        string `json:"data" desc:"a description for the new tokens (can be "")"`
	Amount      string `json:"amount" desc:"the number of tokens to create"`
}

OmniCreatepayloadIssuancefixed // Creates the payload for a new tokens issuance with fixed supply. example: $ omnicore-cli "omni_createpayload_issuancefixed" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" "" "1000000"

func NewOmniCreatepayloadIssuancefixedCmd

func NewOmniCreatepayloadIssuancefixedCmd(ecosystem int64, typo int64, previousid int64, category string, subcategory string, name string, url string, data string, amount string) *OmniCreatepayloadIssuancefixedCmd

type OmniCreatepayloadIssuancefixedResult

type OmniCreatepayloadIssuancefixedResult struct {
}

type OmniCreatepayloadIssuancemanagedCmd

type OmniCreatepayloadIssuancemanagedCmd struct {
	Ecosystem   int64  `json:"ecosystem" desc:"the ecosystem to create the tokens in (1 for main ecosystem, 2 for test ecosystem)"`
	Typo        int64  `json:"type" desc:"the type of the tokens to create: (1 for indivisible tokens, 2 for divisible tokens)"`
	Previousid  int64  `json:"previousid" desc:"an identifier of a predecessor token (use 0 for new tokens)"`
	Category    string `json:"category" desc:"a category for the new tokens (can be "")"`
	Subcategory string `json:"subcategory" desc:"a subcategory for the new tokens (can be "")"`
	Name        string `json:"name" desc:"the name of the new tokens to create"`
	Url         string `json:"url" desc:"an URL for further information about the new tokens (can be "")"`
	Data        string `json:"data" desc:"a description for the new tokens (can be "")"`
}

OmniCreatepayloadIssuancemanaged // Creates the payload for a new tokens issuance with manageable supply. example: $ omnicore-cli "omni_createpayload_issuancemanaged" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" ""

func NewOmniCreatepayloadIssuancemanagedCmd

func NewOmniCreatepayloadIssuancemanagedCmd(ecosystem int64, typo int64, previousid int64, category string, subcategory string, name string, url string, data string) *OmniCreatepayloadIssuancemanagedCmd

type OmniCreatepayloadIssuancemanagedResult

type OmniCreatepayloadIssuancemanagedResult struct {
}

type OmniCreatepayloadRevokeCmd

type OmniCreatepayloadRevokeCmd struct {
	Propertyid int64   `json:"propertyid" desc:"the identifier of the tokens to revoke"`
	Amount     string  `json:"amount" desc:"the amount of tokens to revoke"`
	Memo       *string `json:"memo" desc:"a text note attached to this transaction (none by default)"`
}

OmniCreatepayloadRevoke // Creates the payload to revoke units of managed tokens. Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units!f example: $ omnicore-cli "omni_createpayload_revoke" 51 "100"

func NewOmniCreatepayloadRevokeCmd

func NewOmniCreatepayloadRevokeCmd(propertyid int64, amount string, memo *string) *OmniCreatepayloadRevokeCmd

type OmniCreatepayloadRevokeResult

type OmniCreatepayloadRevokeResult struct {
}

type OmniCreatepayloadSendallCmd

type OmniCreatepayloadSendallCmd struct {
}

OmniCreatepayloadSendall // Create the payload for a send all transaction. example: $ omnicore-cli "omni_createpayload_sendall" 2

func NewOmniCreatepayloadSendallCmd

func NewOmniCreatepayloadSendallCmd() *OmniCreatepayloadSendallCmd

type OmniCreatepayloadSendallResult

type OmniCreatepayloadSendallResult struct {
}

type OmniCreatepayloadSimplesendCmd

type OmniCreatepayloadSimplesendCmd struct {
	Propertyid int64  `json:"propertyid" desc:"the identifier of the tokens to send"`
	Amount     string `json:"amount" desc:"the amount to send"`
}

OmniCreatepayloadSimplesend // Create the payload for a simple send transaction. Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! example: $ omnicore-cli "omni_createpayload_simplesend" 1 "100.0"

func NewOmniCreatepayloadSimplesendCmd

func NewOmniCreatepayloadSimplesendCmd(propertyid int64, amount string) *OmniCreatepayloadSimplesendCmd

type OmniCreatepayloadSimplesendResult

type OmniCreatepayloadSimplesendResult struct {
}

type OmniCreatepayloadStoCmd

type OmniCreatepayloadStoCmd struct {
	Propertyid           int64  `json:"propertyid" desc:"the identifier of the token to distribute"`
	Amount               string `json:"amount" desc:"the amount to distribute"`
	Distributionproperty *int64 `json:"distributionproperty" desc:"the identifier of the property holders to distribute to"`
}

OmniCreatepayloadSto // Creates the payload for a send-to-owners transaction. Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! example: $ omnicore-cli "omni_createpayload_sto" 3 "5000"

func NewOmniCreatepayloadStoCmd

func NewOmniCreatepayloadStoCmd(propertyid int64, amount string, distributionproperty *int64) *OmniCreatepayloadStoCmd

type OmniCreatepayloadStoResult

type OmniCreatepayloadStoResult struct {
}

type OmniCreatepayloadTradeCmd

type OmniCreatepayloadTradeCmd struct {
	Propertyidforsale int64  `json:"propertyidforsale" desc:"the identifier of the tokens to list for sale"`
	Amountforsale     string `json:"amountforsale" desc:"the amount of tokens to list for sale"`
	Propertyiddesired int64  `json:"propertyiddesired" desc:"the identifier of the tokens desired in exchange"`
	Amountdesired     string `json:"amountdesired" desc:"the amount of tokens desired in exchange"`
}

OmniCreatepayloadTrade // Creates the payload to place a trade offer on the distributed token exchange. Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! example: $ omnicore-cli "omni_createpayload_trade" 31 "250.0" 1 "10.0"

func NewOmniCreatepayloadTradeCmd

func NewOmniCreatepayloadTradeCmd(propertyidforsale int64, amountforsale string, propertyiddesired int64, amountdesired string) *OmniCreatepayloadTradeCmd

type OmniCreatepayloadTradeResult

type OmniCreatepayloadTradeResult struct {
}

type OmniCreatepayloadUnfreezeCmd

type OmniCreatepayloadUnfreezeCmd struct {
	Toaddress  string `json:"toaddress" desc:"the address to unfreeze tokens for"`
	Propertyid int64  `json:"propertyid" desc:"the property to unfreeze tokens for (must be managed type and have freezing option enabled)"`
	Amount     string `json:"amount" desc:"the amount of tokens to unfreeze (note: this is unused)"`
}

OmniCreatepayloadUnfreeze // Creates the payload to unfreeze an address for a centrally managed token. Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! example: $ omnicore-cli "omni_createpayload_unfreeze" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 31 "100"

func NewOmniCreatepayloadUnfreezeCmd

func NewOmniCreatepayloadUnfreezeCmd(toaddress string, propertyid int64, amount string) *OmniCreatepayloadUnfreezeCmd

type OmniCreatepayloadUnfreezeResult

type OmniCreatepayloadUnfreezeResult struct {
}

type OmniCreaterawtxChangeCmd

type OmniCreaterawtxChangeCmd struct {
	Rawtx       string `json:"rawtx" desc:"the raw transaction to extend"`
	Prevtxs     string `json:"prevtxs" desc:"a JSON array of transaction inputs"`
	Destination string `json:"destination" desc:"the destination for the change"`
	Fee         int64  `json:"fee" desc:"the desired transaction fees"`
	Position    *int64 `json:"position" desc:"the position of the change output (default: first position)"`
}

OmniCreaterawtxChange // Adds a change output to the transaction. The provided inputs are not added to the transaction, but only used to determine the change. It is assumed that the inputs were previously added, for example via `"createrawtransaction"`. Optionally a position can be provided, where the change output should be inserted, starting with `0`. If the number of outputs is smaller than the position, then the change output is added to the end. Change outputs should be inserted before reference outputs, and as per default, the change output is added to the`first position. If the change amount would be considered as dust, then no change output is added. example: $ omnicore-cli "omni_createrawtx_change" \ "0100000001b15ee60431ef57ec682790dec5a3c0d83a0c360633ea8308fbf6d5fc10a779670400000000ffffffff025c0d00000 \ 000000047512102f3e471222bb57a7d416c82bf81c627bfcd2bdc47f36e763ae69935bba4601ece21021580b888ff56feb27f17f \ 08802ebed26258c23697d6a462d43fc13b565fda2dd52aeaa0a0000000000001976a914946cb2e08075bcbaf157e47bcb67eb2b2 \ 339d24288ac00000000" \ "[{\"txid\":\"6779a710fcd5f6fb0883ea3306360c3ad8c0a3c5de902768ec57ef3104e65eb1\",\"vout\":4, \ \"scriptPubKey\":\"76a9147b25205fd98d462880a3e5b0541235831ae959e588ac\",\"value\":0.00068257}]" \ "1CE8bBr1dYZRMnpmyYsFEoexa1YoPz2mfB" 0.000035 1

func NewOmniCreaterawtxChangeCmd

func NewOmniCreaterawtxChangeCmd(rawtx string, prevtxs string, destination string, fee int64, position *int64) *OmniCreaterawtxChangeCmd

type OmniCreaterawtxChangeResult

type OmniCreaterawtxChangeResult struct {
}

type OmniCreaterawtxInputCmd

type OmniCreaterawtxInputCmd struct {
	Rawtx string `json:"rawtx" desc:"the raw transaction to extend (can be null)"`
	Txid  string `json:"txid" desc:"the hash of the input transaction"`
	N     int64  `json:"n" desc:"the index of the transaction output used as input"`
}

OmniCreaterawtxInput // Adds a transaction input to the transaction. If no raw transaction is provided, a new transaction is created. example: $ omnicore-cli "omni_createrawtx_input" \ "01000000000000000000" "b006729017df05eda586df9ad3f8ccfee5be340aadf88155b784d1fc0e8342ee" 0

func NewOmniCreaterawtxInputCmd

func NewOmniCreaterawtxInputCmd(rawtx string, txid string, n int64) *OmniCreaterawtxInputCmd

type OmniCreaterawtxInputResult

type OmniCreaterawtxInputResult struct {
}

type OmniCreaterawtxMultisigCmd

type OmniCreaterawtxMultisigCmd struct {
	Rawtx             string `json:"rawtx" desc:"the raw transaction to extend (can be null)"`
	AddPayload        string `json:"addPayload" desc:"the hex-encoded payload to add"`
	Seed              string `json:"seed" desc:"the seed for obfuscation"`
	RedemptionPayload string `json:"redemptionPayload" desc:"a public key or address for dust redemption"`
}

OmniCreaterawtxMultisig // Adds a payload with class B (bare-multisig) encoding to the transaction. If no raw transaction is provided, a new transaction is created. If the data encoding fails, then the transaction is not modified. example: $ omnicore-cli "omni_createrawtx_multisig" \ "0100000001a7a9402ecd77f3c9f745793c9ec805bfa2e14b89877581c734c774864247e6f50400000000ffffffff01aa0a00000 \ 00000001976a9146d18edfe073d53f84dd491dae1379f8fb0dfe5d488ac00000000" \ "00000000000000020000000000989680" "1LifmeXYHeUe2qdKWBGVwfbUCMMrwYtoMm" \ "0252ce4bdd3ce38b4ebbc5a6e1343608230da508ff12d23d85b58c964204c4cef3"

func NewOmniCreaterawtxMultisigCmd

func NewOmniCreaterawtxMultisigCmd(rawtx string, addPayload string, seed string, redemptionPayload string) *OmniCreaterawtxMultisigCmd

type OmniCreaterawtxMultisigResult

type OmniCreaterawtxMultisigResult struct {
}

type OmniCreaterawtxOpreturnCmd

type OmniCreaterawtxOpreturnCmd struct {
	Rawtx   string `json:"rawtx" desc:"the raw transaction to extend (can be null)"`
	Payload string `json:"payload" desc:"the hex-encoded payload to add"`
}

OmniCreaterawtxOpreturn // Adds a payload with class C (op-return) encoding to the transaction. If no raw transaction is provided, a new transaction is created. If the data encoding fails, then the transaction is not modified. example: $ omnicore-cli "omni_createrawtx_opreturn" "01000000000000000000" "00000000000000020000000006dac2c0"

func NewOmniCreaterawtxOpreturnCmd

func NewOmniCreaterawtxOpreturnCmd(rawtx string, payload string) *OmniCreaterawtxOpreturnCmd

type OmniCreaterawtxOpreturnResult

type OmniCreaterawtxOpreturnResult struct {
}

type OmniCreaterawtxReferenceCmd

type OmniCreaterawtxReferenceCmd struct {
	Rawtx       string `json:"rawtx" desc:"the raw transaction to extend (can be null)"`
	Destination string `json:"destination" desc:"the reference address or destination"`
	Amount      *int64 `json:"amount" desc:"the optional reference amount (minimal by default)"`
}

OmniCreaterawtxReference // Adds a reference output to the transaction. If no raw transaction is provided, a new transaction is created. The output value is set to at least the dust threshold. example: $ omnicore-cli "omni_createrawtx_reference" \ "0100000001a7a9402ecd77f3c9f745793c9ec805bfa2e14b89877581c734c774864247e6f50400000000ffffffff03aa0a00000 00000001976a9146d18edfe073d53f84dd491dae1379f8fb0dfe5d488ac5c0d0000000000004751210252ce4bdd3ce38b4ebbc5a 6e1343608230da508ff12d23d85b58c964204c4cef3210294cc195fc096f87d0f813a337ae7e5f961b1c8a18f1f8604a909b3a51 21f065b52aeaa0a0000000000001976a914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac00000000" \ "1CE8bBr1dYZRMnpmyYsFEoexa1YoPz2mfB" \ 0.005

func NewOmniCreaterawtxReferenceCmd

func NewOmniCreaterawtxReferenceCmd(rawtx string, destination string, amount *int64) *OmniCreaterawtxReferenceCmd

type OmniCreaterawtxReferenceResult

type OmniCreaterawtxReferenceResult struct {
}

type OmniDecodetransactionCmd

type OmniDecodetransactionCmd struct {
	Rawtx   string  `json:"rawtx" desc:"the raw transaction to decode"`
	Prevtxs *string `json:"prevtxs" desc:"a JSON array of transaction inputs (default: none)"`
	Height  *int64  `json:"height" desc:"the parsing block height (default: 0 for chain height)"`
}

OmniDecodetransaction // Decodes an Omni transaction. If the inputs of the transaction are not in the chain, then they must be provided, because the transaction inputs are used to identify the sender of a transaction. A block height can be provided, which is used to determine the parsing rules. example: $ omnicore-cli "omni_decodetransaction" "010000000163af14ce6d477e1c793507e32a5b7696288fa89705c0d02a3f66beb3c \ 5b8afee0100000000ffffffff02ac020000000000004751210261ea979f6a06f9dafe00fb1263ea0aca959875a7073556a088cdf \ adcd494b3752102a3fd0a8a067e06941e066f78d930bfc47746f097fcd3f7ab27db8ddf37168b6b52ae22020000000000001976a \ 914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac00000000" \ "[{\"txid\":\"eeafb8c5b3be663f2ad0c00597a88f2896765b2ae30735791c7e476dce14af63\",\"vout\":1, \ \"scriptPubKey\":\"76a9149084c0bd89289bc025d0264f7f23148fb683d56c88ac\",\"value\":0.0001123}]"

func NewOmniDecodetransactionCmd

func NewOmniDecodetransactionCmd(rawtx string, prevtxs *string, height *int64) *OmniDecodetransactionCmd

type OmniDecodetransactionResult

type OmniDecodetransactionResult struct {
}

type OmniFundedSendCmd

type OmniFundedSendCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address to send from"`
	Toaddress   string `json:"toaddress" desc:"the address of the receiver"`
	Propertyid  int64  `json:"propertyid" desc:"the identifier of the tokens to send"`
	Amount      string `json:"amount" desc:"the amount to send"`
	Feeaddress  string `json:"feeaddress" desc:"the address that is used to pay for fees, if needed"`
}

OmniFundedSend // Creates and sends a funded simple send transaction. All bitcoins from the sender are consumed and if there are bitcoins missing, they are taken from the specified fee source. Change is sent to the fee source! example: $ omnicore-cli "omni_funded_send" "1DFa5bT6KMEr6ta29QJouainsjaNBsJQhH" \ "15cWrfuvMxyxGst2FisrQcvcpF48x6sXoH" 1 "100.0" \ "15Jhzz4omEXEyFKbdcccJwuVPea5LqsKM1"

func NewOmniFundedSendCmd

func NewOmniFundedSendCmd(fromaddress string, toaddress string, propertyid int64, amount string, feeaddress string) *OmniFundedSendCmd

type OmniFundedSendResult

type OmniFundedSendResult struct {
}

type OmniFundedSendallCmd

type OmniFundedSendallCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address to send from"`
	Toaddress   string `json:"toaddress" desc:"the address of the receiver"`
	Ecosystem   int64  `json:"ecosystem" desc:"the ecosystem of the tokens to send (1 for main ecosystem, 2 for test ecosystem)"`
	Feeaddress  string `json:"feeaddress" desc:"the address that is used to pay for fees, if needed"`
}

OmniFundedSendall // Creates and sends a transaction that transfers all available tokens in the given ecosystem to the recipient. All bitcoins from the sender are consumed and if there are bitcoins missing, they are taken from the specified fee source. Change is sent to the fee source! example: $ omnicore-cli "omni_funded_sendall" "1DFa5bT6KMEr6ta29QJouainsjaNBsJQhH" \ "15cWrfuvMxyxGst2FisrQcvcpF48x6sXoH" 1 "15Jhzz4omEXEyFKbdcccJwuVPea5LqsKM1"

func NewOmniFundedSendallCmd

func NewOmniFundedSendallCmd(fromaddress string, toaddress string, ecosystem int64, feeaddress string) *OmniFundedSendallCmd

type OmniFundedSendallResult

type OmniFundedSendallResult struct {
}

type OmniGetBlockInfoCmd

type OmniGetBlockInfoCmd struct {
	Height uint32
}

OmniGetBlockInfoCmd Sets the global flag that determines whether transactions are automatically committed and broadcasted. example: $ omnicore-cli "OmniRoolBackCmd" false

func NewOmniGetBlockInfoCmd

func NewOmniGetBlockInfoCmd(height uint32) *OmniGetBlockInfoCmd

type OmniGetactivationsCmd

type OmniGetactivationsCmd struct {
}

OmniGetactivations // Returns pending and completed feature activations. example: $ omnicore-cli "omni_getactivations"

func NewOmniGetactivationsCmd

func NewOmniGetactivationsCmd() *OmniGetactivationsCmd

type OmniGetactivationsResult

type OmniGetactivationsResult struct {
}

type OmniGetactivecrowdsalesCmd

type OmniGetactivecrowdsalesCmd struct {
}

OmniGetactivecrowdsales // Lists currently active crowdsales. example: $ omnicore-cli "omni_getactivecrowdsales"

func NewOmniGetactivecrowdsalesCmd

func NewOmniGetactivecrowdsalesCmd() *OmniGetactivecrowdsalesCmd

type OmniGetactivecrowdsalesResult

type OmniGetactivecrowdsalesResult struct {
}

type OmniGetactivedexsellsCmd

type OmniGetactivedexsellsCmd struct {
}

OmniGetactivedexsells // Returns currently active offers on the distributed exchange. example: $ omnicore-cli "omni_getactivedexsells"

func NewOmniGetactivedexsellsCmd

func NewOmniGetactivedexsellsCmd() *OmniGetactivedexsellsCmd

type OmniGetactivedexsellsResult

type OmniGetactivedexsellsResult struct {
}

type OmniGetallbalancesforaddressCmd

type OmniGetallbalancesforaddressCmd struct {
	Address string `json:"address" desc:"the address"`
}

OmniGetallbalancesforaddress // Returns a list of all token balances for a given address. example: $ omnicore-cli "omni_getallbalancesforaddress" "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P"

func NewOmniGetallbalancesforaddressCmd

func NewOmniGetallbalancesforaddressCmd() *OmniGetallbalancesforaddressCmd

type OmniGetallbalancesforaddressResult

type OmniGetallbalancesforaddressResult struct {
}

type OmniGetallbalancesforidCmd

type OmniGetallbalancesforidCmd struct {
	Propertyid int64 `json:"propertyid" desc:"the identifier of the tokens"`
}

OmniGetallbalancesforid // Returns a list of token balances for a given currency or property identifier. example: $ omnicore-cli "omni_getallbalancesforid" 1

func NewOmniGetallbalancesforidCmd

func NewOmniGetallbalancesforidCmd() *OmniGetallbalancesforidCmd

type OmniGetallbalancesforidResult

type OmniGetallbalancesforidResult struct {
}

type OmniGetbalanceCmd

type OmniGetbalanceCmd struct {
	Address    string `json:"address" desc:"the address"`
	Propertyid int64  `json:"propertyid" desc:"the property identifier"`
}

OmniGetbalance // Returns the token balance for a given address and property. example: $ omnicore-cli "omni_getbalance", "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P" 1

func NewOmniGetbalanceCmd

func NewOmniGetbalanceCmd(address string, propertyid int64) *OmniGetbalanceCmd

type OmniGetbalanceResult

type OmniGetbalanceResult struct {
}

type OmniGetcrowdsaleCmd

type OmniGetcrowdsaleCmd struct {
	Propertyid int64 `json:"propertyid" desc:"the identifier of the crowdsale"`
	Verbose    *bool `json:"verbose" desc:"list crowdsale participants (default: false)"`
}

OmniGetcrowdsale // Returns information about a crowdsale. example: $ omnicore-cli "omni_getcrowdsale" 3 true

func NewOmniGetcrowdsaleCmd

func NewOmniGetcrowdsaleCmd(propertyid int64, verbose *bool) *OmniGetcrowdsaleCmd

type OmniGetcrowdsaleResult

type OmniGetcrowdsaleResult struct {
}

type OmniGetcurrentconsensushashCmd

type OmniGetcurrentconsensushashCmd struct {
}

OmniGetcurrentconsensushash // Returns the consensus hash covering the state of the current block. example: $ omnicore-cli "omni_getcurrentconsensushash"

func NewOmniGetcurrentconsensushashCmd

func NewOmniGetcurrentconsensushashCmd() *OmniGetcurrentconsensushashCmd

type OmniGetcurrentconsensushashResult

type OmniGetcurrentconsensushashResult struct {
}

type OmniGetfeecacheCmd

type OmniGetfeecacheCmd struct {
	PropertyId int64
}

OmniGetfeecache // Obtains the current amount of fees cached (pending distribution). If a property ID is supplied the results will be filtered to show this property ID only. If no property ID is supplied the results will contain all properties that currently have fees cached pending distribution. example: $ omnicore-cli "omni_getfeecache" 31

func NewOmniGetfeecacheCmd

func NewOmniGetfeecacheCmd() *OmniGetfeecacheCmd

type OmniGetfeecacheResult

type OmniGetfeecacheResult struct {
}

type OmniGetfeedistributionCmd

type OmniGetfeedistributionCmd struct {
	Distributionid int64
}

OmniGetfeedistribution // Obtains data for a past distribution of fees. A distribution ID must be supplied to identify the distribution to obtain data for. example: $ omnicore-cli "omni_getfeedistribution" 1

func NewOmniGetfeedistributionCmd

func NewOmniGetfeedistributionCmd() *OmniGetfeedistributionCmd

type OmniGetfeedistributionResult

type OmniGetfeedistributionResult struct {
}

type OmniGetfeedistributionsCmd

type OmniGetfeedistributionsCmd struct {
	PropertyId int64
}

OmniGetfeedistributions // Obtains data for past distributions of fees for a property. A property ID must be supplied to retrieve past distributions for. example: $ omnicore-cli "omni_getfeedistributions" 31

func NewOmniGetfeedistributionsCmd

func NewOmniGetfeedistributionsCmd() *OmniGetfeedistributionsCmd

type OmniGetfeedistributionsResult

type OmniGetfeedistributionsResult struct {
}

type OmniGetfeeshareCmd

type OmniGetfeeshareCmd struct {
	Address   *string `json:"address" desc:"the address to filter results on"`
	Ecosystem *int64  `json:"ecosystem" desc:"the ecosystem to obtain the current percentage fee share (1 = main, 2 = test)"`
}

OmniGetfeeshare // Obtains the current percentage share of fees addresses would receive if a distribution were to occur. If an address is supplied the results will be filtered to show this address only. If no address is supplied the results will be filtered to show wallet addresses only. If a wildcard is provided (```"*"```) the results will contain all addresses that would receive a share. If an ecosystem is supplied the results will reflect the fee share for that ecosystem (main or test). If no ecosystem is supplied the results will reflect the main ecosystem. example: $ omnicore-cli "omni_getfeeshare" "1CE8bBr1dYZRMnpmyYsFEoexa1YoPz2mfB" 1

func NewOmniGetfeeshareCmd

func NewOmniGetfeeshareCmd(address *string, ecosystem *int64) *OmniGetfeeshareCmd

type OmniGetfeeshareResult

type OmniGetfeeshareResult struct {
}

type OmniGetfeetriggerCmd

type OmniGetfeetriggerCmd struct {
}

OmniGetfeetrigger // Obtains the amount at which cached fees will be distributed. If a property ID is supplied the results will be filtered to show this property ID only. If no property ID is supplied the results will contain all properties. example: $ omnicore-cli "omni_getfeetrigger" 31

func NewOmniGetfeetriggerCmd

func NewOmniGetfeetriggerCmd() *OmniGetfeetriggerCmd

type OmniGetfeetriggerResult

type OmniGetfeetriggerResult struct {
}

type OmniGetgrantsCmd

type OmniGetgrantsCmd struct {
	PropertyId int64
}

OmniGetgrants // Returns information about granted and revoked units of managed tokens. example: $ omnicore-cli "omni_getgrants" 31

func NewOmniGetgrantsCmd

func NewOmniGetgrantsCmd() *OmniGetgrantsCmd

type OmniGetgrantsResult

type OmniGetgrantsResult struct {
}

type OmniGetinfoCmd

type OmniGetinfoCmd struct {
}

OmniGetinfo // Returns various state information of the client and protocol. example: $ omnicore-cli "omni_getinfo"

func NewOmniGetinfoCmd

func NewOmniGetinfoCmd() *OmniGetinfoCmd

type OmniGetinfoResult

type OmniGetinfoResult struct {
}

type OmniGetorderbookCmd

type OmniGetorderbookCmd struct {
	SalePropertyid    int64  `json:"salePropertyid" desc:"filter orders by propertyid for sale"`
	Desiredpropertyid *int64 `json:"desiredpropertyid" desc:"filter orders by propertyid desired"`
}

OmniGetorderbook // List active offers on the distributed token exchange. example: $ omnicore-cli "omni_getorderbook" 2

func NewOmniGetorderbookCmd

func NewOmniGetorderbookCmd(salePropertyid int64, desiredpropertyid *int64) *OmniGetorderbookCmd

type OmniGetorderbookResult

type OmniGetorderbookResult struct {
}

type OmniGetpayloadCmd

type OmniGetpayloadCmd struct {
	TxHash string
}

OmniGetpayload // Get the payload for an Omni transaction. example: $ omnicore-cli "omni_getactivations" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"

func NewOmniGetpayloadCmd

func NewOmniGetpayloadCmd() *OmniGetpayloadCmd

type OmniGetpayloadResult

type OmniGetpayloadResult struct {
}

type OmniGetpropertyCmd

type OmniGetpropertyCmd struct {
	Propertyid    int64  `json:"propertyid" desc:"the identifier of the tokens or property"`
	CurrentHeight *int64 `json:"height" desc:"current block height"`
}

OmniGetproperty // Returns details for about the tokens or smart property to lookup. example: $ omnicore-cli "omni_getproperty" 3

func NewOmniGetpropertyCmd

func NewOmniGetpropertyCmd() *OmniGetpropertyCmd

type OmniGetpropertyResult

type OmniGetpropertyResult struct {
}

type OmniGetseedblocksCmd

type OmniGetseedblocksCmd struct {
	Startblock int64 `json:"startblock" desc:"the first block to look for Omni transactions (inclusive)"`
	Endblock   int64 `json:"endblock" desc:"the last block to look for Omni transactions (inclusive)"`
}

OmniGetseedblocks // Returns a list of blocks containing Omni transactions for use in seed block filtering. WARNING: The Exodus crowdsale is not stored in LevelDB, thus this is currently only safe to use to generate seed blocks after block 255365. example: $ omnicore-cli "omni_getseedblocks" 290000 300000

func NewOmniGetseedblocksCmd

func NewOmniGetseedblocksCmd(startblock int64, endblock int64) *OmniGetseedblocksCmd

type OmniGetseedblocksResult

type OmniGetseedblocksResult struct {
}

type OmniGetstoCmd

type OmniGetstoCmd struct {
	Txid            string  `json:"txid" desc:"the hash of the transaction to lookup"`
	Recipientfilter *string `json:"recipientfilter" desc:"a filter for recipients (wallet by default, "*" for all)"`
}

OmniGetsto // Get information and recipients of a send-to-owners transaction. example: $ omnicore-cli "omni_getsto" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" "*"

func NewOmniGetstoCmd

func NewOmniGetstoCmd(txid string, recipientfilter *string) *OmniGetstoCmd

type OmniGetstoResult

type OmniGetstoResult struct {
}

type OmniGettradeCmd

type OmniGettradeCmd struct {
	Txid string `json:"txid" desc:"the hash of the order to lookup"`
}

OmniGettrade // Get detailed information and trade matches for orders on the distributed token exchange. example: $ omnicore-cli "omni_gettrade" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"

func NewOmniGettradeCmd

func NewOmniGettradeCmd() *OmniGettradeCmd

type OmniGettradeResult

type OmniGettradeResult struct {
}

type OmniGettradehistoryforaddressCmd

type OmniGettradehistoryforaddressCmd struct {
	Address    string `json:"address" desc:"address to retrieve history for"`
	Count      *int64 `json:"count" desc:"number of orders to retrieve (default: 10)"`
	Propertyid *int64 `json:"propertyid" desc:"filter by propertyid transacted (default: no filter)"`
}

OmniGettradehistoryforaddress // Retrieves the history of orders on the distributed exchange for the supplied address. example: $ omnicore-cli "omni_gettradehistoryforaddress" "1MCHESTptvd2LnNp7wmr2sGTpRomteAkq8"

func NewOmniGettradehistoryforaddressCmd

func NewOmniGettradehistoryforaddressCmd(address string, count *int64, propertyid *int64) *OmniGettradehistoryforaddressCmd

type OmniGettradehistoryforaddressResult

type OmniGettradehistoryforaddressResult struct {
}

type OmniGettradehistoryforpairCmd

type OmniGettradehistoryforpairCmd struct {
	FirstPropertyid  int64  `json:"firstPropertyid" desc:"the first side of the traded pair"`
	SecondPropertyid int64  `json:"secondPropertyid" desc:"the second side of the traded pair"`
	Count            *int64 `json:"count" desc:"number of trades to retrieve (default: 10)"`
}

OmniGettradehistoryforpair // Retrieves the history of trades on the distributed token exchange for the specified market. example: $ omnicore-cli "omni_gettradehistoryforpair" 1 12 500

func NewOmniGettradehistoryforpairCmd

func NewOmniGettradehistoryforpairCmd(firstPropertyid int64, secondPropertyid int64, count *int64) *OmniGettradehistoryforpairCmd

type OmniGettradehistoryforpairResult

type OmniGettradehistoryforpairResult struct {
}

type OmniGettransactionCmd

type OmniGettransactionCmd struct {
	Txid *string `json:"txid" desc:"the hash of the transaction to lookup"`
}

OmniGettransaction // Get detailed information about an Omni transaction. example: $ omnicore-cli "omni_gettransaction" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"

func NewOmniGettransactionCmd

func NewOmniGettransactionCmd() *OmniGettransactionCmd

type OmniGettransactionResult

type OmniGettransactionResult struct {
}

type OmniGetwalletaddressbalancesCmd

type OmniGetwalletaddressbalancesCmd struct {
}

OmniGetwalletaddressbalances // Returns a list of all token balances for every wallet address. example: $ omnicore-cli "omni_getwalletaddressbalances"

func NewOmniGetwalletaddressbalancesCmd

func NewOmniGetwalletaddressbalancesCmd() *OmniGetwalletaddressbalancesCmd

type OmniGetwalletaddressbalancesResult

type OmniGetwalletaddressbalancesResult struct {
}

type OmniGetwalletbalancesCmd

type OmniGetwalletbalancesCmd struct {
}

OmniGetwalletbalances // Returns a list of the total token balances of the whole wallet. example: $ omnicore-cli "omni_getwalletbalances"

func NewOmniGetwalletbalancesCmd

func NewOmniGetwalletbalancesCmd() *OmniGetwalletbalancesCmd

type OmniGetwalletbalancesResult

type OmniGetwalletbalancesResult struct {
}

type OmniListblocktransactionsCmd

type OmniListblocktransactionsCmd struct {
	Height int64 `json:"height" desc:"specific height to query"`
}

OmniListblocktransactions // Lists all Omni transactions in a block. example: $ omnicore-cli "omni_listblocktransactions" 279007

func NewOmniListblocktransactionsCmd

func NewOmniListblocktransactionsCmd() *OmniListblocktransactionsCmd

type OmniListblocktransactionsResult

type OmniListblocktransactionsResult struct {
}

type OmniListpendingtransactionsCmd

type OmniListpendingtransactionsCmd struct {
	Address *string `json:"address" desc:"filter results by address (default: "" for no filter)"`
}

OmniListpendingtransactions // Returns a list of unconfirmed Omni transactions, pending in the memory pool. Note: the validity of pending transactions is uncertain, and the state of the memory pool may change at any moment. It is recommended to check transactions after confirmation, and pending transactions should be considered as invalid. example: $ omnicore-cli "omni_listpendingtransactions"

func NewOmniListpendingtransactionsCmd

func NewOmniListpendingtransactionsCmd() *OmniListpendingtransactionsCmd

type OmniListpendingtransactionsResult

type OmniListpendingtransactionsResult struct {
}

type OmniListpropertiesCmd

type OmniListpropertiesCmd struct {
}

OmniListproperties // Lists all tokens or smart properties. example: $ omnicore-cli "omni_listproperties"

func NewOmniListpropertiesCmd

func NewOmniListpropertiesCmd() *OmniListpropertiesCmd

type OmniListpropertiesResult

type OmniListpropertiesResult struct {
}

type OmniListtransactionsCmd

type OmniListtransactionsCmd struct {
	Txid       *string `json:"txid" desc:"address filter (default: "*")"`
	Count      *int64  `json:"count" desc:"show at most n transactions (default: 10)"`
	Skip       *int64  `json:"skip" desc:"skip the first n transactions (default: 0)"`
	Startblock *int64  `json:"startblock" desc:"first block to begin the search (default: 0)"`
	Endblock   *int64  `json:"endblock" desc:"last block to include in the search (default: 999999999)"`
}

OmniListtransactions // List wallet transactions, optionally filtered by an address and block boundaries. example: $ omnicore-cli "omni_listtransactions"

func NewOmniListtransactionsCmd

func NewOmniListtransactionsCmd(txid *string, count *int64, skip *int64, startblock *int64, endblock *int64) *OmniListtransactionsCmd

type OmniListtransactionsResult

type OmniListtransactionsResult struct {
}

type OmniListwallettransactionsCmd

type OmniListwallettransactionsCmd struct {
	Addrlist   []string `json:"Addrlist" desc:"address filter (default: "*")"`
	Count      *int64   `json:"count" desc:"show at most n transactions (default: 10)"`
	Skip       *int64   `json:"skip" desc:"skip the first n transactions (default: 0)"`
	Startblock *int64   `json:"startblock" desc:"first block to begin the search (default: 0)"`
	Endblock   *int64   `json:"endblock" desc:"last block to include in the search (default: 999999999)"`
}

OmniListwallettransactions // List wallet transactions, optionally filtered by block boundaries. example: $ omnicore-cli "omni_listwallettransactions"

func NewOmniListwallettransactionsCmd

func NewOmniListwallettransactionsCmd(addrlist []string, count *int64, skip *int64, startblock *int64, endblock *int64) *OmniListwallettransactionsCmd

type OmniPendingAddCmd

type OmniPendingAddCmd struct {
	TxId       string
	Sender     string
	MscType    int
	Propertyid uint32
	Amount     string
	Subtract   bool
}

func NewOmniPendingAddCmd

func NewOmniPendingAddCmd() *OmniPendingAddCmd

type OmniPrevtx

type OmniPrevtx struct {
	Txid         string `json:txid`
	Vout         int    `json:vout`
	ScriptPubKey string `json:scriptPubKey`
	Value        int64  `json:value`
}

type OmniPrevtxs

type OmniPrevtxs struct {
	Prevtxs []OmniPrevtx `json:prevtxs`
}

type OmniProcessPaymentCmd

type OmniProcessPaymentCmd struct {
	Sender    string
	Reference string
	TxHash    string
	Amount    int64
	Block     uint32
	Idx       int
}

func NewOmniProcessPaymentCmd

func NewOmniProcessPaymentCmd() *OmniProcessPaymentCmd

type OmniProcessTxCmd

type OmniProcessTxCmd struct {
	Sender       string
	Reference    string
	TxHash       string
	BlockHash    string
	Block        uint32
	Idx          int
	ScriptEncode string
	Fee          int64
	Time         int64
}

func NewOmniProcessTxCmd

func NewOmniProcessTxCmd() *OmniProcessTxCmd

type OmniReadAllTxHashCmd

type OmniReadAllTxHashCmd struct {
}

OmniReadAllTxHashCmd Sets the global flag that determines whether transactions are automatically committed and broadcasted. example: $ omnicore-cli "OmniReadAllTxHashCmd" false

func NewOmniReadAllTxHashCmd

func NewOmniReadAllTxHashCmd() *OmniReadAllTxHashCmd

type OmniRollBackCmd

type OmniRollBackCmd struct {
	Height uint32
	Hashs  *[]string
}

OmniRoolBackCmd Sets the global flag that determines whether transactions are automatically committed and broadcasted. example: $ omnicore-cli "OmniRoolBackCmd" false

func NewOmniRollBackCmd

func NewOmniRollBackCmd(height uint32, hashs *[]string) *OmniRollBackCmd

type OmniSendAgreementCmd

type OmniSendAgreementCmd struct {
	FromAddress            string
	ToAddress              string
	AgtId                  string
	AgtnonencryptedContent string
	AgtKey                 string
	AgtEncryptedContent    string
}

OmniSendAgreementCmd

func NewOmniSendAgreementCmd

func NewOmniSendAgreementCmd() *OmniSendAgreementCmd

type OmniSendCmd

type OmniSendCmd struct {
	Fromaddress     string  `json:"fromaddress" desc:"the address to send from"`
	Toaddress       string  `json:"toaddress" desc:"the address of the receiver"`
	Propertyid      int64   `json:"propertyid" desc:"the identifier of the tokens to send"`
	Amount          string  `json:"amount" desc:"the amount to send"`
	Redeemaddress   *string `json:"redeemaddress" desc:"an address that can spend the transaction dust (sender by default)"`
	Referenceamount *string `json:"referenceamount" desc:"a bitcoin amount that is sent to the receiver (minimal by default)"`
}

OmniSend // Create and broadcast a simple send transaction. example: $ omnicore-cli "omni_send" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 1 "100.0"

func NewOmniSendCmd

func NewOmniSendCmd(fromaddress string, toaddress string, propertyid int64, amount string, redeemaddress *string, referenceamount *string) *OmniSendCmd

type OmniSendResult

type OmniSendResult struct {
}

type OmniSendallCmd

type OmniSendallCmd struct {
	Fromaddress     string  `json:"fromaddress" desc:"the address to send from"`
	Toaddress       string  `json:"toaddress  " desc:"the address of the receiver"`
	Ecosystem       int64   `json:"ecosystem" desc:"the ecosystem of the tokens to send (1 for main ecosystem, 2 for test ecosystem)"`
	Redeemaddress   *string `json:"redeemaddress" desc:"an address that can spend the transaction dust (sender by default)"`
	Referenceamount *string `json:"referenceamount" desc:"a bitcoin amount that is sent to the receiver (minimal by default)"`
}

OmniSendall // Transfers all available tokens in the given ecosystem to the recipient. example: $ omnicore-cli "omni_sendall" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 2

func NewOmniSendallCmd

func NewOmniSendallCmd(fromaddress string, toaddress string, ecosystem int64, redeemaddress *string, referenceamount *string) *OmniSendallCmd

type OmniSendallResult

type OmniSendallResult struct {
}

type OmniSendcancelalltradesCmd

type OmniSendcancelalltradesCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address to trade with"`
	Ecosystem   int64  `json:"ecosystem" desc:"the ecosystem of the offers to cancel (1 for main ecosystem, 2 for test ecosystem)"`
}

OmniSendcancelalltrades // Cancel all offers on the distributed token exchange. example: $ omnicore-cli "omni_sendcancelalltrades" "3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR" 1

func NewOmniSendcancelalltradesCmd

func NewOmniSendcancelalltradesCmd(fromaddress string, ecosystem int64) *OmniSendcancelalltradesCmd

type OmniSendcancelalltradesResult

type OmniSendcancelalltradesResult struct {
}

type OmniSendcanceltradesbypairCmd

type OmniSendcanceltradesbypairCmd struct {
	Fromaddress       string `json:"fromaddress" desc:"the address to trade with"`
	Propertyidforsale int64  `json:"propertyidforsale" desc:"the identifier of the tokens listed for sale"`
	Propertiddesired  int64  `json:"propertiddesired" desc:"the identifier of the tokens desired in exchange"`
}

OmniSendcanceltradesbypair // Cancel all offers on the distributed token exchange with the given currency pair. example: $ omnicore-cli "omni_sendcanceltradesbypair" "3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR" 1 31

func NewOmniSendcanceltradesbypairCmd

func NewOmniSendcanceltradesbypairCmd(fromaddress string, propertyidforsale int64, propertiddesired int64) *OmniSendcanceltradesbypairCmd

type OmniSendcanceltradesbypairResult

type OmniSendcanceltradesbypairResult struct {
}

type OmniSendcanceltradesbypriceCmd

type OmniSendcanceltradesbypriceCmd struct {
	Fromaddress       string `json:"fromaddress" desc:"the address to trade with"`
	Propertyidforsale int64  `json:"propertyidforsale" desc:"the identifier of the tokens listed for sale"`
	Amountforsale     string `json:"amountforsale" desc:"the amount of tokens to listed for sale"`
	Propertiddesired  int64  `json:"propertiddesired" desc:"the identifier of the tokens desired in exchange"`
	Amountdesired     string `json:"amountdesired" desc:"the amount of tokens desired in exchange"`
}

OmniSendcanceltradesbyprice // Cancel offers on the distributed token exchange with the specified price. example: $ omnicore-cli "omni_sendcanceltradesbyprice" "3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR" 31 "100.0" 1 "5.0"

func NewOmniSendcanceltradesbypriceCmd

func NewOmniSendcanceltradesbypriceCmd(fromaddress string, propertyidforsale int64, amountforsale string, propertiddesired int64, amountdesired string) *OmniSendcanceltradesbypriceCmd

type OmniSendcanceltradesbypriceResult

type OmniSendcanceltradesbypriceResult struct {
}

type OmniSendchangeissuerCmd

type OmniSendchangeissuerCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address associated with the tokens"`
	Toaddress   string `json:"toaddress  " desc:"the address to transfer administrative control to"`
	Propertyid  int64  `json:"propertyid" desc:"the identifier of the tokens"`
}

OmniSendchangeissuer // Change the issuer on record of the given tokens. example: $ omnicore-cli "omni_sendchangeissuer" \ "1ARjWDkZ7kT9fwjPrjcQyvbXDkEySzKHwu" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 3

func NewOmniSendchangeissuerCmd

func NewOmniSendchangeissuerCmd(fromaddress string, toaddress string, propertyid int64) *OmniSendchangeissuerCmd

type OmniSendchangeissuerResult

type OmniSendchangeissuerResult struct {
}

type OmniSendclosecrowdsaleCmd

type OmniSendclosecrowdsaleCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address associated with the crowdsale to close"`
	Propertyid  int64  `json:"propertyid" desc:"the identifier of the crowdsale to close"`
}

OmniSendclosecrowdsale // Manually close a crowdsale. example: $ omnicore-cli "omni_sendclosecrowdsale" "3JYd75REX3HXn1vAU83YuGfmiPXW7BpYXo" 70

func NewOmniSendclosecrowdsaleCmd

func NewOmniSendclosecrowdsaleCmd(fromaddress string, propertyid int64) *OmniSendclosecrowdsaleCmd

type OmniSendclosecrowdsaleResult

type OmniSendclosecrowdsaleResult struct {
}

type OmniSenddexacceptCmd

type OmniSenddexacceptCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address to send from"`
	Toaddress   string `json:"toaddress" desc:"the address of the seller"`
	Propertyid  int64  `json:"propertyid" desc:"the identifier of the token to purchase"`
	Amount      string `json:"amount" desc:"the amount to accept"`
	Override    *bool  `json:"override" desc:"override minimum accept fee and payment window checks (use with caution!)"`
}

OmniSenddexaccept // Create and broadcast an accept offer for the specified token and amount. example: $ omnicore-cli "omni_senddexaccept" \ "35URq1NN3xL6GeRKUP6vzaQVcxoJiiJKd8" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 1 "15.0"

func NewOmniSenddexacceptCmd

func NewOmniSenddexacceptCmd(fromaddress string, toaddress string, propertyid int64, amount string, override bool) *OmniSenddexacceptCmd

type OmniSenddexacceptResult

type OmniSenddexacceptResult struct {
}

type OmniSenddexsellCmd

type OmniSenddexsellCmd struct {
	Fromaddress       string `json:"fromaddress" desc:"the address to send from"`
	Propertyidforsale int64  `json:"propertyidforsale" desc:"the identifier of the tokens to list for sale (must be 1 for OMNI or 2for TOMNI)"`
	Amountforsale     string `json:"amountforsale" desc:"the amount of tokens to list for sale"`
	Amountdesired     string `json:"amountdesired" desc:"the amount of bitcoins desired"`
	Paymentwindow     int64  `json:"paymentwindow" desc:"a time limit in blocks a buyer has to pay following a successful accepting order"`
	Minacceptfee      string `json:"minacceptfee" desc:"a minimum mining fee a buyer has to pay to accept the offer"`
	Action            int64  `json:"action" desc:"the action to take (1 for new offers, 2 to update, 3 to cancel)"`
}

OmniSenddexsell // Place, update or cancel a sell offer on the traditional distributed OMNI/BTC exchange. example: $ omnicore-cli "omni_senddexsell" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 1 "1.5" "0.75" 25 "0.0005" 1

func NewOmniSenddexsellCmd

func NewOmniSenddexsellCmd(fromaddress string, propertyidforsale int64, amountforsale string, amountdesired string, paymentwindow int64, minacceptfee string, action int64) *OmniSenddexsellCmd

type OmniSenddexsellResult

type OmniSenddexsellResult struct {
}

type OmniSenddisablefreezingCmd

type OmniSenddisablefreezingCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address to send from (must be issuer of a managed property)"`
	Propertyid  int64  `json:"propertyid" desc:"the identifier of the tokens"`
}

OmniSenddisablefreezing // Disables address freezing for a centrally managed property. IMPORTANT NOTE: Disabling freezing for a property will UNFREEZE all frozen addresses for that property! example: $ omnicore-cli "omni_senddisablefreezing" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" 2

func NewOmniSenddisablefreezingCmd

func NewOmniSenddisablefreezingCmd(fromaddress string, propertyid int64) *OmniSenddisablefreezingCmd

type OmniSenddisablefreezingResult

type OmniSenddisablefreezingResult struct {
}

type OmniSendenablefreezingCmd

type OmniSendenablefreezingCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address to send from (must be issuer of a managed property)"`
	Propertyid  int64  `json:"propertyid" desc:"the identifier of the tokens"`
}

OmniSendenablefreezing // Enables address freezing for a centrally managed property. example: $ omnicore-cli "omni_sendenablefreezing" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" 2

func NewOmniSendenablefreezingCmd

func NewOmniSendenablefreezingCmd(fromaddress string, propertyid int64) *OmniSendenablefreezingCmd

type OmniSendenablefreezingResult

type OmniSendenablefreezingResult struct {
}

type OmniSendfreezeCmd

type OmniSendfreezeCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address to send from (must be issuer of a managed property with freezing enabled"`
	Toaddress   string `json:"toaddress" desc:"the address to freeze"`
	Propertyid  int64  `json:"propertyid" desc:"the identifier of the tokens to freeze"`
	Amount      string `json:"amount" desc:"the amount to freeze (note: currently unused, frozen addresses cannot transact the property)"`
}

OmniSendfreeze // Freeze an address for a centrally managed token. Note: Only the issuer may freeze tokens, and only if the token is of the managed type with the freezing option enabled. example: $ omnicore-cli "omni_sendfreeze" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 2 1000

func NewOmniSendfreezeCmd

func NewOmniSendfreezeCmd(fromaddress string, toaddress string, propertyid int64, amount string) *OmniSendfreezeCmd

type OmniSendfreezeResult

type OmniSendfreezeResult struct {
}

type OmniSendgrantCmd

type OmniSendgrantCmd struct {
	Fromaddress string  `json:"fromaddress" desc:"the address to send from"`
	Toaddress   string  `json:"toaddress" desc:"the receiver of the tokens (sender by default, can be "")"`
	Propertyid  int64   `json:"propertyid" desc:"the identifier of the tokens to grant"`
	Amount      string  `json:"amount" desc:"the amount of tokens to create"`
	Memo        *string `json:"memo" desc:"a text note attached to this transaction (none by default)"`
}

OmniSendgrant // Issue or grant new units of managed tokens. example: $ omnicore-cli "omni_sendgrant" "3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH" "" 51 "7000"

func NewOmniSendgrantCmd

func NewOmniSendgrantCmd(fromaddress string, toaddress string, propertyid int64, amount string, memo *string) *OmniSendgrantCmd

type OmniSendgrantResult

type OmniSendgrantResult struct {
}

type OmniSendissuancecrowdsaleCmd

type OmniSendissuancecrowdsaleCmd struct {
	Fromaddress       string `json:"fromaddress" desc:"the address to send from"`
	Ecosystem         int64  `json:"ecosystem" desc:"the ecosystem to create the tokens in (1 for main ecosystem, 2 for test ecosystem)"`
	Typo              int64  `json:"type" desc:"the type of the tokens to create: (1 for indivisible tokens, 2 for divisible tokens)"`
	Previousid        int64  `json:"previousid" desc:"an identifier of a predecessor token (0 for new crowdsales)"`
	Category          string `json:"category" desc:"a category for the new tokens (can be "")"`
	Subcategory       string `json:"subcategory" desc:"a subcategory for the new tokens (can be "")"`
	Name              string `json:"name" desc:"the name of the new tokens to create"`
	Url               string `json:"url" desc:"an URL for further information about the new tokens (can be "")"`
	Data              string `json:"data" desc:"a description for the new tokens (can be "")"`
	Propertyiddesired int64  `json:"propertyiddesired" desc:"the identifier of a token eligible to participate in the crowdsale"`
	Tokensperunit     string `json:"tokensperunit" desc:"the amount of tokens granted per unit invested in the crowdsale"`
	Deadline          int64  `json:"deadline" desc:"the deadline of the crowdsale as Unix timestamp"`
	Earlybonus        int64  `json:"earlybonus" desc:"an early bird bonus for participants in percent per week"`
	Issuerpercentage  int64  `json:"issuerpercentage" desc:"a percentage of tokens that will be granted to the issuer"`
}

OmniSendissuancecrowdsale // Create new tokens as crowdsale. example: $ omnicore-cli "omni_sendissuancecrowdsale" \ "3JYd75REX3HXn1vAU83YuGfmiPXW7BpYXo" 2 1 0 "Companies" "Bitcoin Mining" \ "Quantum Miner" "" "" 2 "100" 1483228800 30 2

func NewOmniSendissuancecrowdsaleCmd

func NewOmniSendissuancecrowdsaleCmd(fromaddress string, ecosystem int64, typo int64, previousid int64, category string, subcategory string, name string, url string, data string, propertyiddesired int64, tokensperunit string, deadline int64, earlybonus int64, issuerpercentage int64) *OmniSendissuancecrowdsaleCmd

type OmniSendissuancecrowdsaleResult

type OmniSendissuancecrowdsaleResult struct {
}

type OmniSendissuancefixedCmd

type OmniSendissuancefixedCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address to send from"`
	Ecosystem   int64  `json:"ecosystem" desc:"the ecosystem to create the tokens in (1 for main ecosystem, 2 for test ecosystem)"`
	Typo        int64  `json:"type" desc:"the type of the tokens to create: (1 for indivisible tokens, 2 for divisible tokens)"`
	Previousid  int64  `json:"previousid" desc:"an identifier of a predecessor token (0 for new tokens)"`
	Category    string `json:"category" desc:"a category for the new tokens (can be "")"`
	Subcategory string `json:"subcategory" desc:"a subcategory for the new tokens (can be "")"`
	Name        string `json:"name" desc:"the name of the new tokens to create"`
	Url         string `json:"url" desc:"an URL for further information about the new tokens (can be "")"`
	Data        string `json:"data" desc:"a description for the new tokens (can be "")"`
	Amount      string `json:"amount" desc:"the number of tokens to create"`
}

OmniSendissuancefixed // Create new tokens with fixed supply. example: $ omnicore-cli "omni_sendissuancefixed" \ "3Ck2kEGLJtZw9ENj2tameMCtS3HB7uRar3" 2 1 0 "Companies" "Bitcoin Mining" \ "Quantum Miner" "" "" "1000000"

func NewOmniSendissuancefixedCmd

func NewOmniSendissuancefixedCmd(fromaddress string, ecosystem int64, typo int64, previousid int64, category string, subcategory string, name string, url string, data string, amount string) *OmniSendissuancefixedCmd

type OmniSendissuancefixedResult

type OmniSendissuancefixedResult struct {
}

type OmniSendissuancemanagedCmd

type OmniSendissuancemanagedCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address to send from"`
	Ecosystem   int64  `json:"ecosystem" desc:"the ecosystem to create the tokens in (1 for main ecosystem, 2 for test ecosystem)"`
	Typo        int64  `json:"type" desc:"the type of the tokens to create: (1 for indivisible tokens, 2 for divisible tokens)"`
	Previousid  int64  `json:"previousid" desc:"an identifier of a predecessor token (0 for new tokens)"`
	Category    string `json:"category" desc:"a category for the new tokens (can be "")"`
	Subcategory string `json:"subcategory" desc:"a subcategory for the new tokens (can be "")"`
	Name        string `json:"name" desc:"the name of the new tokens to create"`
	Url         string `json:"url" desc:"an URL for further information about the new tokens (can be "")"`
	Data        string `json:"data" desc:"a description for the new tokens (can be "")"`
}

OmniSendissuancemanaged // Create new tokens with manageable supply. example: $ omnicore-cli "omni_sendissuancemanaged" \ "3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" ""

func NewOmniSendissuancemanagedCmd

func NewOmniSendissuancemanagedCmd(fromaddress string, ecosystem int64, typo int64, previousid int64, category string, subcategory string, name string, url string, data string) *OmniSendissuancemanagedCmd

type OmniSendissuancemanagedResult

type OmniSendissuancemanagedResult struct {
}

type OmniSendrawtxCmd

type OmniSendrawtxCmd struct {
	Fromaddress      string  `json:"fromaddress" desc:"the address to send from"`
	Rawtransaction   string  `json:"rawtransaction" desc:"the hex-encoded raw transaction"`
	Referenceaddress *string `json:"referenceaddress" desc:"a reference address (none by default)"`
	Redeemaddress    *string `json:"redeemaddress" desc:"an address that can spend the transaction dust (sender by default)"`
	Referenceamount  *string `json:"referenceamount" desc:"a bitcoin amount that is sent to the receiver (minimal by default)"`
}

OmniSendrawtx // Broadcasts a raw Omni Layer transaction. example: $ omnicore-cli "omni_sendrawtx" \ "1MCHESTptvd2LnNp7wmr2sGTpRomteAkq8" "000000000000000100000000017d7840" \ "1EqTta1Rt8ixAA32DuC29oukbsSWU62qAV"

func NewOmniSendrawtxCmd

func NewOmniSendrawtxCmd(fromaddress string, rawtransaction string, referenceaddress *string, redeemaddress *string, referenceamount *string) *OmniSendrawtxCmd

type OmniSendrawtxResult

type OmniSendrawtxResult struct {
}

type OmniSendrevokeCmd

type OmniSendrevokeCmd struct {
	Fromaddress string  `json:"fromaddress" desc:"the address to send from"`
	Propertyid  int64   `json:"propertyid" desc:"the identifier of the tokens to revoke"`
	Amount      string  `json:"amount" desc:"the amount of tokens to revoke"`
	Memo        *string `json:"memo" desc:"a text note attached to this transaction (none by default)"`
}

OmniSendrevoke // Revoke units of managed tokens. example: $ omnicore-cli "omni_sendrevoke" "3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH" "" 51 "100"

func NewOmniSendrevokeCmd

func NewOmniSendrevokeCmd(fromaddress string, propertyid int64, amount string, memo *string) *OmniSendrevokeCmd

type OmniSendrevokeResult

type OmniSendrevokeResult struct {
}

type OmniSendstoCmd

type OmniSendstoCmd struct {
	Fromaddress          string  `json:"fromaddress" desc:"the address to send from"`
	Propertyid           int64   `json:"propertyid" desc:"the identifier of the tokens to distribute"`
	Amount               string  `json:"amount" desc:"the amount to distribute"`
	Redeemaddress        *string `json:"redeemaddress" desc:"an address that can spend the transaction dust (sender by default)"`
	Distributionproperty *int64  `json:"distributionproperty" desc:"the identifier of the property holders to distribute to"`
}

OmniSendsto // Create and broadcast a send-to-owners transaction. example: $ omnicore-cli "omni_sendsto" \ "32Z3tJccZuqQZ4PhJR2hxHC3tjgjA8cbqz" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 3 "5000"

func NewOmniSendstoCmd

func NewOmniSendstoCmd(fromaddress string, propertyid int64, amount string, redeemaddress *string, distributionproperty *int64) *OmniSendstoCmd

type OmniSendstoResult

type OmniSendstoResult struct {
}

type OmniSendtradeCmd

type OmniSendtradeCmd struct {
	Fromaddress       string `json:"fromaddress" desc:"the address to trade with"`
	Propertyidforsale int64  `json:"propertyidforsale" desc:"the identifier of the tokens to list for sale"`
	Amountforsale     string `json:"amountforsale" desc:"the amount of tokens to list for sale"`
	Propertiddesired  int64  `json:"propertiddesired" desc:"the identifier of the tokens desired in exchange"`
	Amountdesired     string `json:"amountdesired" desc:"the amount of tokens desired in exchange"`
}

OmniSendtrade // Place a trade offer on the distributed token exchange. example: $ omnicore-cli "omni_sendtrade" "3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR" 31 "250.0" 1 "10.0"

func NewOmniSendtradeCmd

func NewOmniSendtradeCmd(fromaddress string, propertyidforsale int64, amountforsale string, propertiddesired int64, amountdesired string) *OmniSendtradeCmd

type OmniSendtradeResult

type OmniSendtradeResult struct {
}

type OmniSendunfreezeCmd

type OmniSendunfreezeCmd struct {
	Fromaddress string `json:"fromaddress" desc:"the address to send from (must be issuer of a managed property with freezing enabled"`
	Toaddress   string `json:"toaddress" desc:"the address to unfreeze"`
	Propertyid  int64  `json:"propertyid" desc:"the identifier of the tokens to unfreeze"`
	Amount      string `json:"amount" desc:"the amount to unfreeze (note: currently unused"`
}

OmniSendunfreeze // Unfreeze an address for a centrally managed token. Note: Only the issuer may unfreeze tokens example: $ omnicore-cli "omni_sendunfreeze" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 2 1000

func NewOmniSendunfreezeCmd

func NewOmniSendunfreezeCmd(fromaddress string, toaddress string, propertyid int64, amount string) *OmniSendunfreezeCmd

type OmniSendunfreezeResult

type OmniSendunfreezeResult struct {
}

type OmniSetautocommitCmd

type OmniSetautocommitCmd struct {
	AutoCommit bool
}

OmniSetautocommit // Sets the global flag that determines whether transactions are automatically committed and broadcasted. example: $ omnicore-cli "omni_setautocommit" false

func NewOmniSetautocommitCmd

func NewOmniSetautocommitCmd() *OmniSetautocommitCmd

type OmniSetautocommitResult

type OmniSetautocommitResult struct {
}

type OmniTXExodusFundraiserCmd

type OmniTXExodusFundraiserCmd struct {
	Hash           string
	StrSender      string
	NBlock         int
	AmountInvested int64
	NTime          int32
}

TXExodusFundraiserCmd Sets the global flag that determines whether transactions are automatically committed and broadcasted. example: $ omnicore-cli "TXExodusFundraiserCmd" false

func NewTXExodusFundraiserCmd

func NewTXExodusFundraiserCmd() *OmniTXExodusFundraiserCmd

type OutPoint

type OutPoint struct {
	Hash  string `json:"hash"`
	Tree  int8   `json:"tree"`
	Index uint32 `json:"index"`
}

OutPoint describes a transaction outpoint that will be marshalled to and from JSON. Contains Hcd addition.

type PingCmd

type PingCmd struct{}

PingCmd defines the ping JSON-RPC command.

func NewPingCmd

func NewPingCmd() *PingCmd

NewPingCmd returns a new instance which can be used to issue a ping JSON-RPC command.

type PoolUserTicket

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

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

type PrevOut

type PrevOut struct {
	Addresses []string `json:"addresses,omitempty"`
	Value     float64  `json:"value"`
}

PrevOut represents previous output for an input Vin.

type PurchaseTicketCmd

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

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

func NewPurchaseTicketCmd

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

NewPurchaseTicketCmd creates a new PurchaseTicketCmd.

type RPCError

type RPCError struct {
	Code    RPCErrorCode `json:"code,omitempty"`
	Message string       `json:"message,omitempty"`
}

RPCError represents an error that is used as a part of a JSON-RPC Response object.

func NewRPCError

func NewRPCError(code RPCErrorCode, message string) *RPCError

NewRPCError constructs and returns a new JSON-RPC error that is suitable for use in a JSON-RPC Response object.

func (RPCError) Error

func (e RPCError) Error() string

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

type RPCErrorCode

type RPCErrorCode int

RPCErrorCode represents an error code to be used as a part of an RPCError which is in turn used in a JSON-RPC Response object.

A specific type is used to help ensure the wrong errors aren't used.

const (
	ErrRPCMisc                RPCErrorCode = -1
	ErrRPCForbiddenBySafeMode RPCErrorCode = -2
	ErrRPCType                RPCErrorCode = -3
	ErrRPCInvalidAddressOrKey RPCErrorCode = -5
	ErrRPCOutOfMemory         RPCErrorCode = -7
	ErrRPCInvalidParameter    RPCErrorCode = -8
	ErrRPCDatabase            RPCErrorCode = -20
	ErrRPCDeserialization     RPCErrorCode = -22
	ErrRPCVerify              RPCErrorCode = -25
)

General application defined JSON errors.

const (
	ErrRPCClientNotConnected      RPCErrorCode = -9
	ErrRPCClientInInitialDownload RPCErrorCode = -10
)

Peer-to-peer client errors.

const (
	ErrRPCWallet                    RPCErrorCode = -4
	ErrRPCWalletInsufficientFunds   RPCErrorCode = -6
	ErrRPCWalletInvalidAccountName  RPCErrorCode = -11
	ErrRPCWalletKeypoolRanOut       RPCErrorCode = -12
	ErrRPCWalletUnlockNeeded        RPCErrorCode = -13
	ErrRPCWalletPassphraseIncorrect RPCErrorCode = -14
	ErrRPCWalletWrongEncState       RPCErrorCode = -15
	ErrRPCWalletEncryptionFailed    RPCErrorCode = -16
	ErrRPCWalletAlreadyUnlocked     RPCErrorCode = -17
)

Wallet JSON errors

const (
	ErrRPCBlockNotFound     RPCErrorCode = -5
	ErrRPCBlockCount        RPCErrorCode = -5
	ErrRPCBestBlockHash     RPCErrorCode = -5
	ErrRPCDifficulty        RPCErrorCode = -5
	ErrRPCOutOfRange        RPCErrorCode = -1
	ErrRPCNoTxInfo          RPCErrorCode = -5
	ErrRPCNoNewestBlockInfo RPCErrorCode = -5
	ErrRPCInvalidTxVout     RPCErrorCode = -5
	ErrRPCRawTxString       RPCErrorCode = -32602
	ErrRPCDecodeHexString   RPCErrorCode = -22
)

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.

const (
	ErrRPCNoWallet      RPCErrorCode = -1
	ErrRPCUnimplemented RPCErrorCode = -1
)

Errors that are specific to btcd.

type RawTxInput

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

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

type RebroadcastMissedCmd

type RebroadcastMissedCmd struct{}

RebroadcastMissedCmd is a type handling custom marshaling and unmarshaling of rebroadcastwinners JSON RPC commands.

func NewRebroadcastMissedCmd

func NewRebroadcastMissedCmd() *RebroadcastMissedCmd

NewRebroadcastMissedCmd returns a new instance which can be used to issue a JSON-RPC rebroadcastmissed command.

type RebroadcastWinnersCmd

type RebroadcastWinnersCmd struct{}

RebroadcastWinnersCmd is a type handling custom marshaling and unmarshaling of rebroadcastwinners JSON RPC commands.

func NewRebroadcastWinnersCmd

func NewRebroadcastWinnersCmd() *RebroadcastWinnersCmd

NewRebroadcastWinnersCmd returns a new instance which can be used to issue a JSON-RPC rebroadcastwinners command.

type RecoverAddressesCmd

type RecoverAddressesCmd struct {
	Account string
	N       int
}

RecoverAddressesCmd defines the recoveraddresses JSON-RPC command.

func NewRecoverAddressesCmd

func NewRecoverAddressesCmd(account string, n int) *RecoverAddressesCmd

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

type RedeemMultiSigOutCmd

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

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

func NewRedeemMultiSigOutCmd

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

NewRedeemMultiSigOutCmd creates a new RedeemMultiSigOutCmd.

type RedeemMultiSigOutResult

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

RedeemMultiSigOutResult models the data returned from the redeemmultisigout command.

type RedeemMultiSigOutsCmd

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

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

func NewRedeemMultiSigOutsCmd

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

NewRedeemMultiSigOutsCmd creates a new RedeemMultiSigOutsCmd.

type RedeemMultiSigOutsResult

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

RedeemMultiSigOutsResult models the data returned from the redeemmultisigouts command.

type RelevantTxAcceptedNtfn

type RelevantTxAcceptedNtfn struct {
	Transaction string `json:"transaction"`
}

RelevantTxAcceptedNtfn defines the parameters to the relevanttxaccepted JSON-RPC notification.

func NewRelevantTxAcceptedNtfn

func NewRelevantTxAcceptedNtfn(txHex string) *RelevantTxAcceptedNtfn

NewRelevantTxAcceptedNtfn returns a new instance which can be used to issue a relevantxaccepted JSON-RPC notification.

type RenameAccountCmd

type RenameAccountCmd struct {
	OldAccount string
	NewAccount string
}

RenameAccountCmd defines the renameaccount JSON-RPC command.

func NewRenameAccountCmd

func NewRenameAccountCmd(oldAccount, newAccount string) *RenameAccountCmd

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

type ReorganizationNtfn

type ReorganizationNtfn struct {
	OldHash   string `json:"oldhash"`
	OldHeight int32  `json:"oldheight"`
	NewHash   string `json:"newhash"`
	NewHeight int32  `json:"newheight"`
}

ReorganizationNtfn defines the reorganization JSON-RPC notification.

func NewReorganizationNtfn

func NewReorganizationNtfn(oldHash string, oldHeight int32, newHash string,
	newHeight int32) *ReorganizationNtfn

NewReorganizationNtfn returns a new instance which can be used to issue a blockdisconnected JSON-RPC notification.

type Request

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

Request is a type for raw JSON-RPC 1.0 requests. The Method field identifies the specific command type which in turns leads to different parameters. Callers typically will not use this directly since this package provides a statically typed command infrastructure which handles creation of these requests, however this struct it being exported in case the caller wants to construct raw requests for some reason.

func NewRequest

func NewRequest(id interface{}, method string, params []interface{}) (*Request, error)

NewRequest returns a new JSON-RPC 1.0 request object given the provided id, method, and parameters. The parameters are marshalled into a json.RawMessage for the Params field of the returned request object. This function is only provided in case the caller wants to construct raw requests for some reason.

Typically callers will instead want to create a registered concrete command type with the NewCmd or New<Foo>Cmd functions and call the MarshalCmd function with that command to generate the marshalled JSON-RPC request.

type RescanCmd

type RescanCmd struct {
	// Concatenated block hashes in non-byte-reversed hex encoding.  Must
	// have length evenly divisible by 2*chainhash.HashSize.
	BlockHashes string
}

RescanCmd defines the rescan JSON-RPC command.

func NewRescanCmd

func NewRescanCmd(blockHashes string) *RescanCmd

NewRescanCmd returns a new instance which can be used to issue a rescan JSON-RPC command.

type RescanResult

type RescanResult struct {
	DiscoveredData []RescannedBlock `json:"discovereddata"`
}

RescanResult models the result object returned by the rescan RPC.

type RescanWalletCmd

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

RescanWalletCmd describes the rescanwallet JSON-RPC request and parameters.

type RescannedBlock

type RescannedBlock struct {
	Hash         string   `json:"hash"`
	Transactions []string `json:"transactions"`
}

RescannedBlock contains the hash and all discovered transactions of a single rescanned block.

type Response

type Response struct {
	Result json.RawMessage `json:"result"`
	Error  *RPCError       `json:"error"`
	ID     *interface{}    `json:"id"`
}

Response is the general form of a JSON-RPC response. The type of the Result field varies from one command to the next, so it is implemented as an interface. The ID field has to be a pointer for Go to put a null in it when empty.

func NewResponse

func NewResponse(id interface{}, marshalledResult []byte, rpcErr *RPCError) (*Response, error)

NewResponse returns a new JSON-RPC response object given the provided id, marshalled result, and RPC error. This function is only provided in case the caller wants to construct raw responses for some reason.

Typically callers will instead want to create the fully marshalled JSON-RPC response to send over the wire with the MarshalResponse function.

type RevocationCreatedNtfn

type RevocationCreatedNtfn struct {
	TxHash string
	SStxIn string
}

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

func NewRevocationCreatedNtfn

func NewRevocationCreatedNtfn(txHash string, sstxIn string) *RevocationCreatedNtfn

NewRevocationCreatedNtfn creates a new RevocationCreatedNtfn.

type RevokeTicketsCmd

type RevokeTicketsCmd struct {
}

RevokeTicketsCmd describes the revoketickets JSON-RPC request and parameters.

func NewRevokeTicketsCmd

func NewRevokeTicketsCmd() *RevokeTicketsCmd

NewRevokeTicketsCmd creates a new RevokeTicketsCmd.

type SStxCommitOut

type SStxCommitOut struct {
	Addr       string `json:"addr"`
	CommitAmt  int64  `json:"commitamt"`
	ChangeAddr string `json:"changeaddr"`
	ChangeAmt  int64  `json:"changeamt"`
}

SStxCommitOut represents the output to an SStx transaction. Specifically a a commitment address and amount, and a change address and amount.

type SStxInput

type SStxInput struct {
	Txid string `json:"txid"`
	Vout uint32 `json:"vout"`
	Tree int8   `json:"tree"`
	Amt  int64  `json:"amt"`
}

SStxInput represents the inputs to an SStx transaction. Specifically a transactionsha and output number pair, along with the output amounts.

type ScriptInfo

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

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

type ScriptPubKeyResult

type ScriptPubKeyResult struct {
	Asm       string   `json:"asm"`
	Hex       string   `json:"hex,omitempty"`
	ReqSigs   int32    `json:"reqSigs,omitempty"`
	Type      string   `json:"type"`
	Addresses []string `json:"addresses,omitempty"`
	CommitAmt *float64 `json:"commitamt,omitempty"`
}

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

type ScriptSig

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

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

type SearchRawTransactionsCmd

type SearchRawTransactionsCmd struct {
	Address     string
	Verbose     *int  `jsonrpcdefault:"1"`
	Skip        *int  `jsonrpcdefault:"0"`
	Count       *int  `jsonrpcdefault:"100"`
	VinExtra    *int  `jsonrpcdefault:"0"`
	Reverse     *bool `jsonrpcdefault:"false"`
	FilterAddrs *[]string
}

SearchRawTransactionsCmd defines the searchrawtransactions JSON-RPC command.

func NewSearchRawTransactionsCmd

func NewSearchRawTransactionsCmd(address string, verbose, skip, count *int, vinExtra *int, reverse *bool, filterAddrs *[]string) *SearchRawTransactionsCmd

NewSearchRawTransactionsCmd returns a new instance which can be used to issue a sendrawtransaction JSON-RPC command.

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

type SearchRawTransactionsResult

type SearchRawTransactionsResult struct {
	Hex           string       `json:"hex,omitempty"`
	Txid          string       `json:"txid"`
	Version       int32        `json:"version"`
	LockTime      uint32       `json:"locktime"`
	Vin           []VinPrevOut `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"`
}

SearchRawTransactionsResult models the data from the searchrawtransaction command.

type SendFromAddressToAddressCmd

type SendFromAddressToAddressCmd struct {
	FromAddress string
	Address     string
	Amount      float64
}

SendToAddressCmd defines the sendtoaddress JSON-RPC command.

func NewSendFromAddressToAddressCmd

func NewSendFromAddressToAddressCmd(fromAddress string, address string, amount float64) *SendFromAddressToAddressCmd

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

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

type SendFromCmd

type SendFromCmd struct {
	FromAccount string
	ToAddress   string
	Amount