Documentation ¶
Index ¶
- func NewServer(cm *chain.Manager, cmZen *chain.Manager, s *syncer.Syncer, sZen *syncer.Syncer, ...) http.Handler
- type Balance
- type Client
- func (c *Client) Address(network string) (resp types.Address, err error)
- func (c *Client) Balance(network string) (resp WalletBalanceResponse, err error)
- func (c *Client) ConsensusNetwork(network string) (resp *consensus.Network, err error)
- func (c *Client) ConsensusTip(network string) (resp ConsensusTipResponse, err error)
- func (c *Client) ConsensusTipState(network string) (resp consensus.State, err error)
- func (c *Client) FinalizeUpdates(id hostdb.UpdateID) error
- func (c *Client) NodeStatus() (resp NodeStatusResponse, err error)
- func (c *Client) Outputs(network string) (sc []types.SiacoinElement, sf []types.SiafundElement, err error)
- func (c *Client) PoolTransactions(network string) (resp []wallet.PoolTransaction, err error)
- func (c *Client) SyncerPeers(network string) (resp []GatewayPeer, err error)
- func (c *Client) TxpoolFee(network string) (resp types.Currency, err error)
- func (c *Client) TxpoolTransactions(network string) (txns []types.Transaction, v2txns []types.V2Transaction, err error)
- func (c *Client) Updates() (resp hostdb.HostUpdates, err error)
- type ConsensusTipResponse
- type GatewayPeer
- type NodeStatusResponse
- type TxpoolTransactionsResponse
- type WalletBalanceResponse
- type WalletOutputsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Balance ¶
type Balance struct { Siacoins types.Currency `json:"siacoins"` ImmatureSiacoins types.Currency `json:"immatureSiacoins"` }
Balance combines mature and immature values.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client provides methods for interacting with a hsd API server.
func NewClient ¶
NewClient returns a client that communicates with a hsd server listening on the specified address.
func (*Client) Balance ¶
func (c *Client) Balance(network string) (resp WalletBalanceResponse, err error)
Balance returns the wallet balance.
func (*Client) ConsensusNetwork ¶
ConsensusNetwork returns the node's network metadata.
func (*Client) ConsensusTip ¶
func (c *Client) ConsensusTip(network string) (resp ConsensusTipResponse, err error)
ConsensusTip returns the current tip index.
func (*Client) ConsensusTipState ¶
ConsensusTipState returns the current tip state.
func (*Client) FinalizeUpdates ¶
FinalizeUpdates confirms the receipt of the HostDB updates.
func (*Client) NodeStatus ¶
func (c *Client) NodeStatus() (resp NodeStatusResponse, err error)
NodeStatus returns the status of the node.
func (*Client) Outputs ¶
func (c *Client) Outputs(network string) (sc []types.SiacoinElement, sf []types.SiafundElement, err error)
Outputs returns the set of unspent outputs controlled by the wallet.
func (*Client) PoolTransactions ¶
func (c *Client) PoolTransactions(network string) (resp []wallet.PoolTransaction, err error)
PoolTransactions returns all txpool transactions relevant to the wallet.
func (*Client) SyncerPeers ¶
func (c *Client) SyncerPeers(network string) (resp []GatewayPeer, err error)
SyncerPeers returns the current peers of the syncer.
func (*Client) TxpoolFee ¶
TxpoolFee returns the recommended fee (per weight unit) to ensure a high probability of inclusion in the next block.
func (*Client) TxpoolTransactions ¶
func (c *Client) TxpoolTransactions(network string) (txns []types.Transaction, v2txns []types.V2Transaction, err error)
TxpoolTransactions returns all transactions in the transaction pool.
type ConsensusTipResponse ¶
type ConsensusTipResponse struct { Network string `json:"network"` Height uint64 `json:"height"` BlockID types.BlockID `json:"id"` Synced bool `json:"synced"` }
ConsensusTipResponse is the response type for /consensus/tip.
type GatewayPeer ¶
type GatewayPeer struct { Addr string `json:"addr"` Inbound bool `json:"inbound"` Version string `json:"version"` }
A GatewayPeer is a currently-connected peer.
type NodeStatusResponse ¶
type NodeStatusResponse struct { Version string `json:"version"` Height uint64 `json:"heightMainnet"` HeightZen uint64 `json:"heightZen"` Balance Balance `json:"balanceMainnet"` BalanceZen Balance `json:"balanceZen"` }
NodeStatusResponse is the response type for /node/status.
type TxpoolTransactionsResponse ¶
type TxpoolTransactionsResponse struct { Transactions []types.Transaction `json:"transactions"` V2Transactions []types.V2Transaction `json:"v2transactions"` }
TxpoolTransactionsResponse is the response type for /txpool/transactions.
type WalletBalanceResponse ¶
type WalletBalanceResponse struct { Network string `json:"network"` Siacoins types.Currency `json:"siacoins"` ImmatureSiacoins types.Currency `json:"immatureSiacoins"` Siafunds uint64 `json:"siafunds"` }
WalletBalanceResponse is the response type for /wallet/balance.
type WalletOutputsResponse ¶
type WalletOutputsResponse struct { Network string `json:"network"` SiacoinOutputs []types.SiacoinElement `json:"siacoinOutputs"` SiafundOutputs []types.SiafundElement `json:"siafundOutputs"` }
WalletOutputsResponse is the response type for /wallet/outputs.