cmds

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: ISC Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultServiceNameSpace = "qitmeer"
	MinerNameSpace          = "miner"
	TestNameSpace           = "test"
	LogNameSpace            = "log"
	NotifyNameSpace         = ""
)

These are all service namespace in node

View Source
const (
	BlockConnectedNtfnMethod    = "blockConnected"
	BlockDisconnectedNtfnMethod = "blockDisconnected"
	BlockAcceptedNtfnMethod     = "blockAccepted"
	ReorganizationNtfnMethod    = "reorganization"
	TxAcceptedNtfnMethod        = "txaccepted"
	TxAcceptedVerboseNtfnMethod = "txacceptedverbose"
	TxConfirmNtfnMethod         = "txconfirm"
	RescanProgressNtfnMethod    = "rescanprocess"
	RescanCompleteNtfnMethod    = "rescancomplete"
	NodeExitMethod              = "nodeexit"
)

Variables

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",
	}
	// ErrRPCDatabase indicates a database error.
	ErrRPCDatabase = &RPCError{
		Code:    -32001,
		Message: "Database error",
	}
	ErrRPCBlockNotFound = &RPCError{
		Code:    -32002,
		Message: "Block Not Found error",
	}

	ErrInvalidNode = &RPCError{
		Code:    -32003,
		Message: "Invalid Node",
	}
	ErrRPCParse = &RPCError{
		Code:    -32700,
		Message: "Parse error",
	}
	ErrRPCDecodeHexString = &RPCError{
		Code:    -32701,
		Message: "Hex decode error",
	}
)

Functions

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 IsValidIDType

func IsValidIDType(id interface{}) bool

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.

func MarshalResponse

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

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

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

func UseLogger

func UseLogger(logger l.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type BanlistCmd

type BanlistCmd struct{}

func NewBanlistCmd

func NewBanlistCmd() *BanlistCmd

type BlockAcceptedNtfn

type BlockAcceptedNtfn struct {
	Hash   string
	Height int64
	Order  int64
	Time   int64
	Txs    []string
}

type BlockConnectedNtfn

type BlockConnectedNtfn struct {
	Hash   string
	Height int64
	Order  int64
	Time   int64
	Txs    []string
}

func NewBlockConnectedNtfn

func NewBlockConnectedNtfn(hash string, height, order int64, time int64, txs []string) *BlockConnectedNtfn

type BlockDetails

type BlockDetails struct {
	Order uint64 `json:"order"`
	Hash  string `json:"hash"`
	Index int    `json:"index"`
	Time  int64  `json:"time"`
}

BlockDetails describes details of a tx in a block.

type BlockDisconnectedNtfn

type BlockDisconnectedNtfn struct {
	Hash   string
	Height int64
	Order  int64
	Time   int64
	Txs    []string
}

func NewBlockDisconnectedNtfn

func NewBlockDisconnectedNtfn(hash string, height, order int64, time int64, txs []string) *BlockDisconnectedNtfn

type CheckAddressCmd

type CheckAddressCmd struct {
	Address string
	Network string
}

func NewCheckAddressCmd

func NewCheckAddressCmd(address string, network string) *CheckAddressCmd

type CreateRawTransactionCmd

type CreateRawTransactionCmd struct {
	Inputs   []json.TransactionInput
	Amounts  json.Amounts
	LockTime int64
}

func NewCreateRawTransactionCmd

func NewCreateRawTransactionCmd(inputs []json.TransactionInput, amounts json.Amounts, lockTime int64) *CreateRawTransactionCmd

type DecodeRawTransactionCmd

type DecodeRawTransactionCmd struct {
	HexTx string
}

func NewDecodeRawTransactionCmd

func NewDecodeRawTransactionCmd(hexTx string) *DecodeRawTransactionCmd

type Error

type Error struct {
	ErrorCode   ErrorCode // Describes the kind of error
	Description 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 GenerateCmd

type GenerateCmd struct {
	NumBlocks uint32
	PowType   pow.PowType
}

func NewGenerateCmd

func NewGenerateCmd(numBlocks uint32, powType pow.PowType) *GenerateCmd

type GetBestBlockHashCmd

type GetBestBlockHashCmd struct{}

func NewGetBestBlockHashCmd

func NewGetBestBlockHashCmd() *GetBestBlockHashCmd

type GetBlockByNumCmd

type GetBlockByNumCmd struct {
	ID      uint
	Verbose bool
	InclTx  bool
	FullTx  bool
}

func NewGetBlockByNumCmd

func NewGetBlockByNumCmd(id uint, verbose bool, inclTx bool, fullTx bool) *GetBlockByNumCmd

type GetBlockByOrderCmd

type GetBlockByOrderCmd struct {
	Order   uint
	Verbose bool
	InclTx  bool
	FullTx  bool
}

func NewGetBlockByOrderCmd

func NewGetBlockByOrderCmd(order uint, verbose bool, inclTx bool, fullTx bool) *GetBlockByOrderCmd

type GetBlockCmd

type GetBlockCmd struct {
	H       string
	Verbose bool
	InclTx  bool
	FullTx  bool
}

func NewGetBlockCmd

func NewGetBlockCmd(h string, verbose bool, inclTx bool, fullTx bool) *GetBlockCmd

func NewGetBlockV2Cmd

func NewGetBlockV2Cmd(h string, verbose bool, inclTx bool, fullTx bool) *GetBlockCmd

type GetBlockCountCmd

type GetBlockCountCmd struct{}

func NewGetBlockCountCmd

func NewGetBlockCountCmd() *GetBlockCountCmd

type GetBlockHeaderCmd

type GetBlockHeaderCmd struct {
	Hash    string
	Verbose bool
}

func NewGetBlockHeaderCmd

func NewGetBlockHeaderCmd(hash string, verbose bool) *GetBlockHeaderCmd

type GetBlockTemplateCmd

type GetBlockTemplateCmd struct {
	Capabilities []string
	PowType      byte
}

func NewGetBlockTemplateCmd

func NewGetBlockTemplateCmd(capabilities []string, powType byte) *GetBlockTemplateCmd

type GetBlockTotalCmd

type GetBlockTotalCmd struct{}

func NewGetBlockTotalCmd

func NewGetBlockTotalCmd() *GetBlockTotalCmd

type GetBlockV2Cmd

type GetBlockV2Cmd struct {
	H       string
	Verbose bool
	InclTx  bool
	FullTx  bool
}

type GetBlockWeightCmd

type GetBlockWeightCmd struct {
	H string
}

func NewGetBlockWeightCmd

func NewGetBlockWeightCmd(h string) *GetBlockWeightCmd

type GetBlockhashByRangeCmd

type GetBlockhashByRangeCmd struct {
	Start uint
	End   uint
}

func NewGetBlockhashByRangeCmd

func NewGetBlockhashByRangeCmd(start uint, end uint) *GetBlockhashByRangeCmd

type GetBlockhashCmd

type GetBlockhashCmd struct {
	Order uint
}

func NewGetBlockhashCmd

func NewGetBlockhashCmd(order uint) *GetBlockhashCmd

type GetCoinbaseCmd

type GetCoinbaseCmd struct {
}

func NewGetCoinbaseCmd

func NewGetCoinbaseCmd() *GetCoinbaseCmd

type GetFeesCmd

type GetFeesCmd struct {
	H string
}

func NewGetFeesCmd

func NewGetFeesCmd(h string) *GetFeesCmd

type GetMainChainHeightCmd

type GetMainChainHeightCmd struct{}

func NewGetMainChainHeightCmd

func NewGetMainChainHeightCmd() *GetMainChainHeightCmd

type GetMempoolCmd

type GetMempoolCmd struct {
	TxType  string
	Verbose bool
}

func NewGetMempoolCmd

func NewGetMempoolCmd(txType string, verbose bool) *GetMempoolCmd

type GetNodeInfoCmd

type GetNodeInfoCmd struct{}

func NewGetNodeInfoCmd

func NewGetNodeInfoCmd() *GetNodeInfoCmd

type GetOrphansTotalCmd

type GetOrphansTotalCmd struct{}

func NewGetOrphansTotalCmd

func NewGetOrphansTotalCmd() *GetOrphansTotalCmd

type GetPeerInfoCmd

type GetPeerInfoCmd struct{}

func NewGetPeerInfoCmd

func NewGetPeerInfoCmd() *GetPeerInfoCmd

type GetRawTransactionCmd

type GetRawTransactionCmd struct {
	TxHash  string
	Verbose bool
}

func NewGetRawTransactionCmd

func NewGetRawTransactionCmd(txHash string, verbose bool) *GetRawTransactionCmd

type GetRawTransactionsCmd

type GetRawTransactionsCmd struct {
	Addre       string
	Vinext      bool
	Count       uint
	Skip        uint
	Revers      bool
	Verbose     bool
	FilterAddrs []string
}

func NewGetRawTransactionsCmd

func NewGetRawTransactionsCmd(addre string, vinext bool, count uint, skip uint, revers bool, verbose bool, filterAddrs []string) *GetRawTransactionsCmd

type GetRemoteGBTCmd added in v0.10.6

type GetRemoteGBTCmd struct {
	PowType pow.PowType
}

func NewGetRemoteGBTCmd added in v0.10.6

func NewGetRemoteGBTCmd(powType pow.PowType) *GetRemoteGBTCmd

type GetRpcInfoCmd

type GetRpcInfoCmd struct{}

func NewGetRpcInfoCmd

func NewGetRpcInfoCmd() *GetRpcInfoCmd

type GetTimeInfoCmd

type GetTimeInfoCmd struct{}

func NewGetTimeInfoCmd

func NewGetTimeInfoCmd() *GetTimeInfoCmd

type GetUtxoCmd

type GetUtxoCmd struct {
	TxHash         string
	Vout           uint32
	IncludeMempool bool
}

func NewGetUtxoCmd

func NewGetUtxoCmd(txHash string, vout uint32, includeMempool bool) *GetUtxoCmd

type IsBlueCmd

type IsBlueCmd struct {
	H string
}

func NewIsBlueCmd

func NewIsBlueCmd(h string) *IsBlueCmd

type IsCurrentCmd

type IsCurrentCmd struct {
}

func NewIsCurrentCmd

func NewIsCurrentCmd() *IsCurrentCmd

type IsOnMainChainCmd

type IsOnMainChainCmd struct {
	H string
}

func NewIsOnMainChainCmd

func NewIsOnMainChainCmd(h string) *IsOnMainChainCmd

type JsonRequestStatus

type JsonRequestStatus struct {
	Name         string `json:"name"`
	TotalCalls   int    `json:"totalcalls"`
	TotalTime    string `json:"totaltime"`
	AverageTime  string `json:"averagetime"`
	MaxTime      string `json:"maxtime"`
	MinTime      string `json:"mintime"`
	MaxTimeReqID string `json:"maxtimereqid"`
	MinTimeReqID string `json:"mintimereqid"`
	RunningNum   int    `json:"runningnum"`
}

type NodeExitNtfn

type NodeExitNtfn struct {
}

type NotificationTxConfirmNtfn

type NotificationTxConfirmNtfn struct {
	ConfirmResult TxConfirmResult
}

type NotifyBlocksCmd

type NotifyBlocksCmd struct{}

func NewNotifyBlocksCmd

func NewNotifyBlocksCmd() *NotifyBlocksCmd

type NotifyNewTransactionsCmd

type NotifyNewTransactionsCmd struct {
	Verbose bool
}

ws

func NewNotifyNewTransactionsCmd

func NewNotifyNewTransactionsCmd(verbose bool) *NotifyNewTransactionsCmd

type NotifyReceivedCmd

type NotifyReceivedCmd struct {
	Addresses []string
}

TODO op

func NewNotifyReceivedCmd

func NewNotifyReceivedCmd(addresses []string) *NotifyReceivedCmd

type NotifyTxsByAddrCmd

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

ws

func NewNotifyTxsByAddrCmd

func NewNotifyTxsByAddrCmd(reload bool, addr []string, outpoint []OutPoint) *NotifyTxsByAddrCmd

type NotifyTxsConfirmedCmd

type NotifyTxsConfirmedCmd struct {
	Txs []TxConfirm
}

func NewNotifyTxsConfirmed

func NewNotifyTxsConfirmed(txs []TxConfirm) *NotifyTxsConfirmedCmd

type OutPoint

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

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

type RPCError

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

func InternalRPCError

func InternalRPCError(errStr, context string) *RPCError

func NewRPCError

func NewRPCError(code RPCErrorCode, message string) *RPCError

func (RPCError) Error

func (e RPCError) Error() string

type RPCErrorCode

type RPCErrorCode int

type RedeemingTxNtfn

type RedeemingTxNtfn struct {
	HexTx string
	Block *BlockDetails
}

RedeemingTxNtfn defines the redeemingtx JSON-RPC notification.

type RemoveBanCmd

type RemoveBanCmd struct {
	Id string
}

func NewRemoveBanCmd

func NewRemoveBanCmd(id string) *RemoveBanCmd

type RemoveTxsConfirmedCmd added in v0.10.6

type RemoveTxsConfirmedCmd struct {
	Txs []TxConfirm
}

func NewRemoveTxsConfirmed added in v0.10.6

func NewRemoveTxsConfirmed(txs []TxConfirm) *RemoveTxsConfirmedCmd

type ReorganizationNtfn

type ReorganizationNtfn struct {
	Hash   string
	Height int64
	Order  int64
	Olds   []string
}

func NewReorganizationNtfn

func NewReorganizationNtfn(hash string, order int64, olds []string) *ReorganizationNtfn

type Request

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

func NewRequest

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

type RescanCmd

type RescanCmd struct {
	BeginBlock uint64
	Addresses  []string
	OutPoints  []OutPoint
	EndBlock   uint64
}

RescanCmd defines the rescan JSON-RPC command.

func NotifyRescanCmd

func NotifyRescanCmd(beginBlock, endBlock uint64, addrs []string, op []OutPoint) *RescanCmd

type RescanFinishedNtfn

type RescanFinishedNtfn struct {
	Hash       string
	Order      uint64
	Time       int64
	LastTxHash string
}

RescanFinishedNtfn defines the rescanfinished JSON-RPC notification.

func NewRescanFinishedNtfn

func NewRescanFinishedNtfn(hash, txHash string, order uint64, time int64) *RescanFinishedNtfn

NewRescanFinishedNtfn returns a new instance which can be used to issue a rescanfinished JSON-RPC notification.

type RescanProgressNtfn

type RescanProgressNtfn struct {
	Hash  string
	Order uint64
	Time  int64
}

RescanProgressNtfn defines the rescanprogress JSON-RPC notification.

func NewRescanProgressNtfn

func NewRescanProgressNtfn(hash string, order uint64, time int64) *RescanProgressNtfn

NewRescanProgressNtfn returns a new instance which can be used to issue a rescanprogress JSON-RPC notification.

type Response

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

func NewResponse

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

type SendRawTransactionCmd

type SendRawTransactionCmd struct {
	HexTx         string
	AllowHighFees bool
}

func NewSendRawTransactionCmd

func NewSendRawTransactionCmd(hexTx string, allowHighFees bool) *SendRawTransactionCmd

type SessionCmd

type SessionCmd struct{}

func NewSessionCmd

func NewSessionCmd() *SessionCmd

type SetLogLevelCmd

type SetLogLevelCmd struct {
	Level string
}

func NewSetLogLevelCmd

func NewSetLogLevelCmd(level string) *SetLogLevelCmd

type SetRpcMaxClientsCmd

type SetRpcMaxClientsCmd struct {
	Max int
}

func NewSetRpcMaxClientsCmd

func NewSetRpcMaxClientsCmd(max int) *SetRpcMaxClientsCmd

type StopCmd

type StopCmd struct{}

func NewStopCmd

func NewStopCmd() *StopCmd

type StopNotifyBlocksCmd

type StopNotifyBlocksCmd struct{}

func NewStopNotifyBlocksCmd

func NewStopNotifyBlocksCmd() *StopNotifyBlocksCmd

type StopNotifyNewTransactionsCmd

type StopNotifyNewTransactionsCmd struct{}

func NewStopNotifyNewTransactionsCmd

func NewStopNotifyNewTransactionsCmd() *StopNotifyNewTransactionsCmd

type SubmitBlockCmd

type SubmitBlockCmd struct {
	HexBlock string
}

func NewSubmitBlockCmd

func NewSubmitBlockCmd(hexBlock string) *SubmitBlockCmd

type SubmitBlockHeaderCmd added in v0.10.6

type SubmitBlockHeaderCmd struct {
	HexBlockHeader string
}

func NewSubmitBlockHeaderCmd added in v0.10.6

func NewSubmitBlockHeaderCmd(blockHeader *types.BlockHeader) *SubmitBlockHeaderCmd

type TipsCmd

type TipsCmd struct {
}

func NewTipsCmd

func NewTipsCmd() *TipsCmd

type TxAcceptedNtfn

type TxAcceptedNtfn struct {
	TxID    string
	Amounts types.AmountGroup
}

func NewTxAcceptedNtfn

func NewTxAcceptedNtfn(txHash string, amounts types.AmountGroup) *TxAcceptedNtfn

type TxAcceptedVerboseNtfn

type TxAcceptedVerboseNtfn struct {
	Tx json.DecodeRawTransactionResult
}

type TxConfirm

type TxConfirm struct {
	Txid          string
	Order         uint64
	Confirmations int32
	EndHeight     uint64
}

type TxConfirmResult

type TxConfirmResult struct {
	Confirms uint64
	Tx       string
	Order    uint64
	IsValid  bool
	IsBlue   bool
}

type TxSignCmd

type TxSignCmd struct {
	PrivkeyStr string
	RawTxStr   string
}

func NewTxSignCmd

func NewTxSignCmd(privkeyStr string, rawTxStr string) *TxSignCmd

type UnNotifyTxsByAddrCmd

type UnNotifyTxsByAddrCmd struct {
	Addresses []string
}

ws

func StopNotifyTxsByAddrCmd

func StopNotifyTxsByAddrCmd(addr []string) *UnNotifyTxsByAddrCmd

type UsageFlag

type UsageFlag uint32

UsageFlag define flags that specify additional properties about the circumstances under which a command can be used.

const (
	// UFWalletOnly indicates that the command can only be used with an RPC
	// server that supports wallet commands.
	UFWalletOnly UsageFlag = 1 << iota

	// UFWebsocketOnly indicates that the command can only be used when
	// communicating with an RPC server over websockets.  This typically
	// applies to notifications and notification registration functions
	// since neiher makes since when using a single-shot HTTP-POST request.
	UFWebsocketOnly

	// UFNotification indicates that the command is actually a notification.
	// This means when it is marshalled, the ID must be nil.
	UFNotification
)

func MethodUsageFlags

func MethodUsageFlags(method string) (UsageFlag, error)

MethodUsageFlags returns the usage flags for the passed command method. The provided method must be associated with a registered type. All commands provided by this package are registered by default.

func (UsageFlag) String

func (fl UsageFlag) String() string

String returns the UsageFlag in human-readable form.

Jump to

Keyboard shortcuts

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