agent

package
Version: v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrImportAddress = fmt.Errorf("fail to import address")
)
View Source
var (
	ErrNoTxForAddr = fmt.Errorf("no transaction for the address")
)

Functions

This section is empty.

Types

type CoinAgent

type CoinAgent interface {
	ListAllUnspent() (map[string]tx.UTXOs, error)
	WatchAddress(addr string) error
	Send(string) (string, error)
}

type DaemonAgent

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

func NewDaemonAgent

func NewDaemonAgent(apiUrl, username, password string) *DaemonAgent

func (DaemonAgent) ListAllUnspent added in v0.6.2

func (da DaemonAgent) ListAllUnspent() (map[string]tx.UTXOs, error)

func (DaemonAgent) Send

func (da DaemonAgent) Send(rawTx string) (string, error)

func (DaemonAgent) WatchAddress added in v0.6.2

func (da DaemonAgent) WatchAddress(addr string) error

type ErrQueryFailure

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

func (ErrQueryFailure) Error

func (e ErrQueryFailure) Error() string

type RPCError

type RPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type RPCParam

type RPCParam struct {
	Method string        `json:"method"`
	Params []interface{} `json:"params"`
}

type RPCResponse

type RPCResponse struct {
	Result json.RawMessage `json:"result"`
	Error  *RPCError       `json:"error"`
}

type RPCUTXO

type RPCUTXO struct {
	TxId    string  `json:"txid"`
	Address string  `json:"address"`
	Index   uint32  `json:"vout"`
	Value   float64 `json:"amount"`
}

type ReceivedAddress

type ReceivedAddress struct {
	Address string   `json:"address"`
	Amount  float64  `json:"amount"`
	TxIds   []string `json:"txids"`
}

Source Files

Jump to

Keyboard shortcuts

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