bitcoind

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxSend    = "send"
	TxReceive = "receive"
)

Variables

This section is empty.

Functions

func NewBtcdRPCClient

func NewBtcdRPCClient() (*rpcclient.Client, error)

Types

type HttpBitcoind

type HttpBitcoind struct {
	HttpClient *http.Client
	// contains filtered or unexported fields
}

HttpBitcoind is a client to bitcoind

func NewHttpRPCClient

func NewHttpRPCClient(client *http.Client) (*HttpBitcoind, error)

func (*HttpBitcoind) Call

func (c *HttpBitcoind) Call(method string, params []interface{}) (int, json.RawMessage, error)

func (*HttpBitcoind) GetRawTransaction

func (c *HttpBitcoind) GetRawTransaction(txId string) (*RawTransaction, error)

func (*HttpBitcoind) GetTransaction

func (c *HttpBitcoind) GetTransaction(txId string) (*Transaction, error)

type RPCResult

type RPCResult struct {
	Result json.RawMessage
	Error  map[string]interface{}
}

type RawTransaction

type RawTransaction struct {
	TxID          string `json:"txid"`
	Hash          string `json:"hash"`
	Version       int    `json:"version"`
	Size          int    `json:"size"`
	Vsize         int    `json:"vsize"`
	Weight        int    `json:"weight"`
	Locktime      int    `json:"locktime"`
	Vins          []Vin  `json:"vin"`
	Vouts         []Vout `json:"vout"`
	Hex           string `json:"hex"`
	Blockhash     string `json:"blockhash"`
	Confirmations int    `json:"confirmations"`
	Time          int    `json:"time"`
	Blocktime     int    `json:"blocktime"`
}

type Transaction

type Transaction struct {
	Amount        float64              `json:"amount"`
	Fee           float64              `json:"fee"`
	Blockheight   int                  `json:"blockheight"`
	TxID          string               `json:"txid"`
	Timereceived  int                  `json:"timereceived"`
	Blockhash     string               `json:"blockhash"`
	Confirmations int                  `json:"confirmations"`
	Time          int                  `json:"time"`
	Blocktime     int                  `json:"blocktime"`
	Details       []TransactionDetails `json:"details"`
	Decoded       RawTransaction       `json:"decoded"`
}

type TransactionDetails

type TransactionDetails struct {
	Address  string  `json:"address"`
	Category string  `json:"category"`
	Amount   float64 `json:"amount"`
	Label    string  `json:"label"`
	Vout     int     `json:"vout"`
}

type Vin

type Vin struct {
	TxID string `json:"txid"`
	Vout int64  `json:"vout"`
}

type Vout

type Vout struct {
	Value        float64 `json:"value"`
	N            int     `json:"n"`
	ScriptPubKey struct {
		Asm       string   `json:"asm"`
		Hex       string   `json:"hex"`
		ReqSigs   int      `json:"reqSigs"`
		Type      string   `json:"type"`
		Addresses []string `json:"addresses"`
	} `json:"scriptPubKey,omitempty"`
}

Jump to

Keyboard shortcuts

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