Documentation
¶
Index ¶
- Constants
- func NewApiError(s string, public bool) error
- func UniqueTxidsInReverse(txids []string) []string
- type Address
- type ApiError
- type Block
- type BlockbookInfo
- type Blocks
- type Paging
- type ScriptPubKey
- type ScriptSig
- type SystemInfo
- type Tx
- type Vin
- type Vout
- type Worker
- func (w *Worker) GetAddress(address string, page int, txsOnPage int, onlyTxids bool) (*Address, error)
- func (w *Worker) GetBlock(bid string, page int, txsOnPage int) (*Block, error)
- func (w *Worker) GetBlocks(page int, blocksOnPage int) (*Blocks, error)
- func (w *Worker) GetSpendingTxid(txid string, n int) (string, error)
- func (w *Worker) GetSystemInfo(internal bool) (*SystemInfo, error)
- func (w *Worker) GetTransaction(txid string, spendingTxs bool) (*Tx, error)
Constants ¶
View Source
const BlockbookAbout = "Blockbook - blockchain indexer for TREZOR wallet https://trezor.io/. Do not use for any other purpose."
Variables ¶
This section is empty.
Functions ¶
func NewApiError ¶ added in v0.0.7
func UniqueTxidsInReverse ¶
UniqueTxidsInReverse reverts the order of transactions (so that newest are first) and removes duplicate transactions
Types ¶
type Address ¶
type Address struct { Paging AddrStr string `json:"addrStr"` Balance string `json:"balance"` TotalReceived string `json:"totalReceived"` TotalSent string `json:"totalSent"` UnconfirmedBalance string `json:"unconfirmedBalance"` UnconfirmedTxApperances int `json:"unconfirmedTxApperances"` TxApperances int `json:"txApperances"` Transactions []*Tx `json:"txs,omitempty"` Txids []string `json:"transactions,omitempty"` }
type BlockbookInfo ¶ added in v0.0.7
type BlockbookInfo struct { Coin string `json:"coin"` Host string `json:"host"` Version string `json:"version"` GitCommit string `json:"gitcommit"` BuildTime string `json:"buildtime"` SyncMode bool `json:"syncMode"` InitialSync bool `json:"initialsync"` InSync bool `json:"inSync"` BestHeight uint32 `json:"bestHeight"` LastBlockTime time.Time `json:"lastBlockTime"` InSyncMempool bool `json:"inSyncMempool"` LastMempoolTime time.Time `json:"lastMempoolTime"` MempoolSize int `json:"mempoolSize"` DbSize int64 `json:"dbSize"` DbSizeFromColumns int64 `json:"dbSizeFromColumns,omitempty"` DbColumns []common.InternalStateColumn `json:"dbColumns,omitempty"` About string `json:"about"` }
type ScriptPubKey ¶
type SystemInfo ¶ added in v0.0.7
type SystemInfo struct { Blockbook *BlockbookInfo `json:"blockbook"` Backend *bchain.ChainInfo `json:"backend"` }
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 string `json:"valueOut"` ValueOutSat big.Int `json:"-"` Size int `json:"size,omitempty"` ValueIn string `json:"valueIn"` ValueInSat big.Int `json:"-"` Fees string `json:"fees"` FeesSat big.Int `json:"-"` Hex string `json:"hex"` }
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"` AddrDesc bchain.AddressDescriptor `json:"-"` Addresses []string `json:"addresses"` Searchable bool `json:"-"` Value string `json:"value"` ValueSat big.Int `json:"-"` }
type Vout ¶
type Vout struct { Value string `json:"value"` ValueSat big.Int `json:"-"` N int `json:"n"` ScriptPubKey ScriptPubKey `json:"scriptPubKey"` Spent bool `json:"-"` 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(address string, page int, txsOnPage int, onlyTxids bool) (*Address, error)
GetAddress computes address value and gets transactions for given address
func (*Worker) GetSpendingTxid ¶ added in v0.0.7
GetSpendingTxid returns transaction id of transaction that spent given output
func (*Worker) GetSystemInfo ¶ added in v0.0.7
func (w *Worker) GetSystemInfo(internal bool) (*SystemInfo, error)
GetSystemInfo returns information about system
Click to show internal directories.
Click to hide internal directories.