Documentation
¶
Index ¶
- func GetRawTx(txid string) (*wire.MsgTx, error)
- type APILink
- func (a *APILink) DirtyCheckLoop()
- func (a *APILink) GetOPTxs() error
- func (a *APILink) GetVAdrTxos() error
- func (a *APILink) GetVOPTxs() error
- func (a *APILink) NsightGetAdrTxos() error
- func (a *APILink) PushTx(tx *wire.MsgTx) error
- func (a *APILink) PushTxSmartBit(tx *wire.MsgTx) error
- func (a *APILink) RawBlocks() chan *wire.MsgBlock
- func (a *APILink) RegisterAddress(adr160 [20]byte) error
- func (a *APILink) RegisterOutPoint(op wire.OutPoint) error
- func (a *APILink) Start(startHeight int32, host, path string, proxyURL string, ...) (chan lnutil.TxAndHeight, chan int32, error)
- func (a *APILink) TipRefreshLoop() error
- func (a *APILink) UnregisterOutPoint(op wire.OutPoint) error
- func (a *APILink) UpdateHeight(height int32)
- func (a *APILink) VGetRawTx(txid string) (*wire.MsgTx, error)
- type AdrUtxoResponse
- type RawTxResponse
- type TxResponse
- type VBlock
- type VBlocksResponse
- type VRawResponse
- type VRawTx
- type VSpendResponse
- type VoutJson
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APILink ¶
type APILink struct {
// TrackingAdrs and OPs are slices of addresses and outpoints to watch for.
// Using struct{} saves a byte of RAM but is ugly so I'll use bool.
TrackingAdrs map[[20]byte]bool
TrackingAdrsMtx sync.Mutex
TrackingOPs map[wire.OutPoint]bool
TrackingOPsMtx sync.Mutex
TxUpToWallit chan lnutil.TxAndHeight
CurrentHeightChan chan int32
// contains filtered or unexported fields
}
APILink is a link to a web API that can tell you about blockchain data.
func (*APILink) DirtyCheckLoop ¶
func (a *APILink) DirtyCheckLoop()
DirtyCheckLoop checks with the server once things have changed on the client end. this is actually a bit ugly because it checks *everything* when *anything* has changed. It could be much more efficient if, eg it checks for a newly created address by itself.
func (*APILink) GetVAdrTxos ¶
GetVAdrTxos gets new utxos for the wallet from the indexer.
func (*APILink) NsightGetAdrTxos ¶
...use insight api. at least that's open source, can run yourself, seems to have some dev activity behind it.
func (*APILink) PushTxSmartBit ¶
PushTx pushes a tx to the network via the smartbit site / api smartbit supports segwit so
func (*APILink) RegisterAddress ¶
RegisterAddress gets a 20 byte address from the wallit and starts watching for utxos at that address.
func (*APILink) RegisterOutPoint ¶
RegisterOutPoint gets an outpoint from the wallit and starts looking for txins that spend it.
func (*APILink) Start ¶
func (a *APILink) Start( startHeight int32, host, path string, proxyURL string, params *coinparam.Params) ( chan lnutil.TxAndHeight, chan int32, error)
Start starts the APIlink
func (*APILink) TipRefreshLoop ¶
TipRefreshLoop checks for a change in the highest block hash if so it sets the dirty flag to true to trigger a refresh
func (*APILink) UnregisterOutPoint ¶
UnregisterOutPoint stops watching an outpoint for spends.
func (*APILink) UpdateHeight ¶
type AdrUtxoResponse ¶
ARGHGH all fields have to be exported (caps) or the json unmarshaller won't populate them !
type TxResponse ¶
type VBlock ¶
type VBlock struct {
Height int32
Hash string
Time int64
TxLength int32
Size int32
PoolInfo string
}
VBlock is the json data that comes back from the /blocks query to the indexer
type VBlocksResponse ¶
type VBlocksResponse []VBlock
VBlocksResponse is a list of Vblocks, which comes back from the /blocks query to the indexer
type VRawResponse ¶
type VRawResponse []VRawTx
type VSpendResponse ¶
VSpendResponse is the JSON response from the / outpointSpend call