api

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UniqueTxidsInReverse

func UniqueTxidsInReverse(txids []string) []string

UniqueTxidsInReverse reverts the order of transactions (so that newest are first) and removes duplicate transactions

Types

type Address

type Address struct {
	AddrStr                 string  `json:"addrStr"`
	Balance                 float64 `json:"balance"`
	BalanceSat              int64   `json:"balanceSat"`
	TotalReceived           float64 `json:"totalReceived"`
	TotalReceivedSat        int64   `json:"totalReceivedSat"`
	TotalSent               float64 `json:"totalSent"`
	TotalSentSat            int64   `json:"totalSentSat"`
	UnconfirmedBalance      float64 `json:"unconfirmedBalance"`
	UnconfirmedBalanceSat   int64   `json:"unconfirmedBalanceSat"`
	UnconfirmedTxApperances int     `json:"unconfirmedTxApperances"`
	TxApperances            int     `json:"txApperances"`
	Transactions            []*Tx   `json:"transactions"`
}

type ScriptPubKey

type ScriptPubKey struct {
	Hex       string   `json:"hex"`
	Asm       string   `json:"asm,omitempty"`
	Addresses []string `json:"addresses"`
	Type      string   `json:"type,omitempty"`
}

type ScriptSig

type ScriptSig struct {
	Hex string `json:"hex"`
	Asm string `json:"asm,omitempty"`
}

type Tx

type Tx struct {
	Txid          string  `json:"txid"`
	Version       int32   `json:"version,omitempty"`
	Locktime      uint32  `json:"locktime,omitempty"`
	Vin           []Vin   `json:"vin"`
	Vout          []Vout  `json:"vout"`
	Blockhash     string  `json:"blockhash,omitempty"`
	Blockheight   int     `json:"blockheight"`
	Confirmations uint32  `json:"confirmations"`
	Time          int64   `json:"time,omitempty"`
	Blocktime     int64   `json:"blocktime"`
	ValueOut      float64 `json:"valueOut"`
	Size          int     `json:"size,omitempty"`
	ValueIn       float64 `json:"valueIn"`
	Fees          float64 `json:"fees"`
	WithSpends    bool    `json:"withSpends,omitempty"`
}

type Vin

type Vin struct {
	Txid      string    `json:"txid"`
	Vout      uint32    `json:"vout"`
	Sequence  int64     `json:"sequence,omitempty"`
	N         int       `json:"n"`
	ScriptSig ScriptSig `json:"scriptSig"`
	Addr      string    `json:"addr"`
	ValueSat  int64     `json:"valueSat"`
	Value     float64   `json:"value"`
}

type Vout

type Vout struct {
	Value        float64      `json:"value"`
	N            int          `json:"n"`
	ScriptPubKey ScriptPubKey `json:"scriptPubKey"`
	SpentTxID    string       `json:"spentTxId,omitempty"`
	SpentIndex   int          `json:"spentIndex,omitempty"`
	SpentHeight  int          `json:"spentHeight,omitempty"`
}

type Worker

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

Worker is handle to api worker

func NewWorker

func NewWorker(db *db.RocksDB, chain bchain.BlockChain, txCache *db.TxCache, is *common.InternalState) (*Worker, error)

NewWorker creates new api worker

func (*Worker) GetAddress

func (w *Worker) GetAddress(addrID string, page int) (*Address, error)

GetAddress computes address value and gets transactions for given address

func (*Worker) GetTransaction

func (w *Worker) GetTransaction(txid string, bestheight uint32, spendingTx bool) (*Tx, error)

GetTransaction reads transaction data from txid

Jump to

Keyboard shortcuts

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