coind

package
v0.0.0-...-2dea52a Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RpcclientTimeout VERSION represents bicoind package version
	// Version = 0.1
	// RpcclientTimeout DEFAULT_RPCCLIENT_TIMEOUT represent http timeout for rcp client
	RpcclientTimeout = 15
)

Variables

This section is empty.

Functions

func SendCoins

func SendCoins(walletConfig models.Daemon, addressReceive string, addressSend string, amount float64, stakeWallet bool) (string, error)

func WrapDaemon

func WrapDaemon(daemon models.Daemon, maxTries int, method string, params ...interface{}) ([]byte, error)

Types

type Coind

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

Coind A Bitcoind represents a Bitcoind client

func New

func New(host string, port int, user, passwd string, useSSL bool, timeoutParam ...int) (*Coind, error)

New return a new bitcoind

func (*Coind) Call

func (b *Coind) Call(command string, par ...any) ([]byte, error)

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 (RPCError) Error

func (e RPCError) Error() string

Error returns a string describing the RPC error. This satisfies 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 errs aren't used.

Jump to

Keyboard shortcuts

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