Documentation ¶
Index ¶
- type Address
- type Block
- type Blocks
- type ClientCore
- type Input
- type LatestBlock
- type ListReceivedByAddressObj
- type ListReceivedByAddressResponse
- type ListTransansactionsObj
- type ListTransansactionsResponse
- type MercuryError
- type MultiAddress
- type Output
- type PreviousOut
- type RPCCLient
- type Response
- type SingleAddress
- type Transaction
- type UTXO
- type Unspent
- type UnspentOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { BlockHash string `json:"hash"` Version uint8 `json:"ver"` PreviousBlockHash string `json:"prev_block"` MerkleRoot string `json:"mrkl_root"` Time int64 `json:"time"` Bits int64 `json:"bits"` Nonce int64 `json:"nonce"` TransactionCount int `json:"n_tx"` Size int64 `json:"size"` BlockIndex uint64 `json:"block_index"` MainChain bool `json:"main_chain"` Height int64 `json:"height"` ReceivedTime int64 `json:"received_time"` RelayedBy string `json:"relayed_by"` Transactions []Transaction `json:"tx"` }
type ClientCore ¶
type ClientCore interface { // NetworkParams should return the network parameters of the underlying // Bitcoin blockchain. NetworkParams() *chaincfg.Params GetUTXOs(ctx context.Context, address string, limit, confitmations int64) ([]UTXO, error) GetUTXO(ctx context.Context, txHash string, vout uint32) (UTXO, error) Confirmations(ctx context.Context, txHash string) (int64, error) // ScriptFunded checks whether a script is funded. ScriptFunded(ctx context.Context, address string, value int64) (bool, int64, error) // ScriptRedeemed checks whether a script is redeemed. ScriptRedeemed(ctx context.Context, address string, value int64) (bool, int64, error) // ScriptSpent checks whether a script is spent. ScriptSpent(ctx context.Context, script, spender string) (bool, string, error) // PublishTransaction should publish a signed transaction to the Bitcoin // blockchain. PublishTransaction(ctx context.Context, signedTransaction *wire.MsgTx) error }
func NewBitcoinFNClientCore ¶
func NewBitcoinFNClientCore(host, user, password string) (ClientCore, error)
func NewBlockchainInfoClientCore ¶
func NewBlockchainInfoClientCore(network string) (ClientCore, error)
func NewMercuryClientCore ¶
func NewMercuryClientCore(network string) (ClientCore, error)
type Input ¶
type Input struct { PrevOut PreviousOut `json:"prev_out"` Script string `json:"script"` }
type LatestBlock ¶
type ListReceivedByAddressObj ¶
type ListReceivedByAddressObj struct {
TxIDs []string `json:"txids"`
}
type ListReceivedByAddressResponse ¶
type ListReceivedByAddressResponse []ListReceivedByAddressObj
type ListTransansactionsObj ¶
type ListTransansactionsResponse ¶
type ListTransansactionsResponse []ListTransansactionsObj
type MercuryError ¶
type MercuryError struct {
Error string `json:"error"`
}
type MultiAddress ¶
type MultiAddress struct { Addresses []Address `json:"addresses"` Transactions []Transaction `json:"txs"` }
type PreviousOut ¶
type RPCCLient ¶
type RPCCLient interface { ListTransansactions() (ListTransansactionsResponse, error) ListReceivedByAddress(address string) (ListReceivedByAddressResponse, error) }
func NewRPCClient ¶
type Response ¶
type Response struct {
Result json.RawMessage `json:"result"`
}
type SingleAddress ¶
type SingleAddress struct { Address string `json:"address"` Received int64 `json:"total_received"` Sent int64 `json:"total_sent"` Balance int64 `json:"final_balance"` Transactions []Transaction `json:"txs"` }
type Transaction ¶
type Transaction struct { TransactionHash string `json:"hash"` Version uint8 `json:"ver"` VinSize uint32 `json:"vin_sz"` VoutSize uint32 `json:"vout_sz"` Size int64 `json:"size"` RelayedBy string `json:"relayed_by"` BlockHeight int64 `json:"block_height"` TransactionIndex uint64 `json:"tx_index"` Inputs []Input `json:"inputs"` Outputs []Output `json:"out"` }
type Unspent ¶
type Unspent struct {
Outputs []UnspentOutput `json:"unspent_outputs"`
}
Click to show internal directories.
Click to hide internal directories.