agent

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type BlockrAddrData

type BlockrAddrData struct {
	Address string        `json:"address"`
	Balance float64       `json:"balance"`
	FirstTx *BlockrTxData `json:"first_tx"`
}

type BlockrAgent

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

func NewBlockrAgent

func NewBlockrAgent(apiHost string) *BlockrAgent

func (BlockrAgent) GetAddrUnspent

func (b BlockrAgent) GetAddrUnspent(addr string) ([]*tx.UTXO, error)

func (BlockrAgent) Send

func (b BlockrAgent) Send(rawTx string) (string, error)

type BlockrResp

type BlockrResp struct {
	Status  string          `json:"status"`
	Data    json.RawMessage `json:"data"`
	Message string          `json:"message"`
	Code    int             `json:"code"`
}

type BlockrTxData

type BlockrTxData struct {
	Tx    string `json:"tx"`
	Block int64  `json:"block_nb,string"`
}

type BlockrUTXO

type BlockrUTXO struct {
	Hash  string  `json:"tx"`
	Index uint32  `json:"n"`
	Value float64 `json:"amount,string"`
}

type BlockrUnspentData

type BlockrUnspentData struct {
	Address string       `json:"address"`
	Unspent []BlockrUTXO `json:"unspent"`
}

type CoinAgent

type CoinAgent interface {
	GetAddrUnspent(string) ([]*tx.UTXO, 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) GetAddrUnspent

func (da DaemonAgent) GetAddrUnspent(addr string) ([]*tx.UTXO, error)

func (DaemonAgent) Send

func (da DaemonAgent) Send(rawTx string) (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"`
	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"`
}

Jump to

Keyboard shortcuts

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