client

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

A Client provides methods for interacting with the API server.

func NewClient added in v0.11.0

func NewClient() *Client

NewClient returns a client that communicates with the API server listening on the specified address.

func (*Client) Client added in v0.11.0

func (c *Client) Client() *jape.Client

Client returns the underlying jape.Client.

func (*Client) ConsensusNetwork added in v0.11.0

func (c *Client) ConsensusNetwork() (resp *consensus.Network, err error)

ConsensusNetwork returns the node's network metadata.

func (*Client) ConsensusTip added in v0.11.0

func (c *Client) ConsensusTip() (resp api.ConsensusTipResponse, err error)

ConsensusTip returns the current tip index.

func (*Client) ConsensusTipState added in v0.11.0

func (c *Client) ConsensusTipState() (resp consensus.State, err error)

ConsensusTipState returns the current tip state.

func (*Client) DaemonVersion added in v0.11.0

func (c *Client) DaemonVersion() (resp api.DaemonVersion, err error)

DaemonVersion returns the current version of satd.

func (*Client) HostDb added in v0.11.0

func (c *Client) HostDb() (hdg api.HostdbGET, err error)

HostDb requests the /hostdb endpoint's resources.

func (*Client) HostDbActiveHosts added in v0.11.0

func (c *Client) HostDbActiveHosts() (hdag api.HostdbHostsGET, err error)

HostDbActiveHosts requests the /hostdb/active endpoint's resources.

func (*Client) HostDbAllHosts added in v0.11.0

func (c *Client) HostDbAllHosts() (hdag api.HostdbHostsGET, err error)

HostDbAllHosts requests the /hostdb/all endpoint's resources.

func (*Client) HostDbFilterMode added in v0.11.0

func (c *Client) HostDbFilterMode() (hdfmg api.HostdbFilterModeGET, err error)

HostDbFilterMode requests the /hostdb/filtermode GET endpoint.

func (*Client) HostDbHost added in v0.11.0

func (c *Client) HostDbHost(pk types.PublicKey) (hhg api.HostdbHostGET, err error)

HostDbHost request the /hostdb/host/:publickey endpoint's resources.

func (*Client) HostDbSetFilterMode added in v0.11.0

func (c *Client) HostDbSetFilterMode(fm modules.FilterMode, hosts []types.PublicKey, netAddresses []string) (err error)

HostDbSetFilterMode requests the /hostdb/filtermode POST endpoint.

func (*Client) ManagerAverages added in v0.11.0

func (c *Client) ManagerAverages(currency string) (ha api.HostAverages, err error)

ManagerAverages requests the /manager/averages resource.

func (*Client) ManagerBalance added in v0.11.0

func (c *Client) ManagerBalance(key string) (ub modules.UserBalance, err error)

ManagerBalance requests the /manager/balance resource.

func (*Client) ManagerContracts added in v0.11.0

func (c *Client) ManagerContracts(key string) (rc api.RenterContracts, err error)

ManagerContracts requests the /manager/contracts resource.

func (*Client) ManagerMaintenance added in v0.11.0

func (c *Client) ManagerMaintenance() (maintenance bool, err error)

ManagerMaintenance requests the /manager/maintenance resource.

func (*Client) ManagerPreferences added in v0.11.0

func (c *Client) ManagerPreferences() (ep api.EmailPreferences, err error)

ManagerPreferences requests the /manager/preferences resource.

func (*Client) ManagerPrices added in v0.11.0

func (c *Client) ManagerPrices() (prices modules.Pricing, err error)

ManagerPrices requests the /manager/prices resource.

func (*Client) ManagerRenter added in v0.11.0

func (c *Client) ManagerRenter(key string) (r modules.Renter, err error)

ManagerRenter requests the /manager/renter resource.

func (*Client) ManagerRenters added in v0.11.0

func (c *Client) ManagerRenters() (rg api.RentersGET, err error)

ManagerRenters requests the /manager/renters resource.

func (*Client) ManagerSetMaintenance added in v0.11.0

func (c *Client) ManagerSetMaintenance(start bool) error

ManagerSetMaintenance uses the /manager/maintenance resource to set or clear the maintenance flag.

func (*Client) ManagerUpdatePreferences added in v0.11.0

func (c *Client) ManagerUpdatePreferences(ep api.EmailPreferences) error

ManagerUpdatePreferences uses the /manager/preferences resource to change the email preferences.

func (*Client) ManagerUpdatePrices added in v0.11.0

func (c *Client) ManagerUpdatePrices(prices modules.Pricing) error

ManagerUpdatePrices uses the /manager/prices resource to change the current prices.

func (*Client) PortalAnnouncement added in v0.11.0

func (c *Client) PortalAnnouncement() (string, uint64, error)

PortalAnnouncement requests the /portal/announcement resource.

func (*Client) PortalCredits added in v0.11.0

func (c *Client) PortalCredits() (credits modules.CreditData, err error)

PortalCredits requests the /portal/credits resource.

func (*Client) PortalSetAnnouncement added in v0.11.0

func (c *Client) PortalSetAnnouncement(text string, expires uint64) (err error)

PortalSetAnnouncement requests the /portal/announcement resource.

func (*Client) PortalSetCredits added in v0.11.0

func (c *Client) PortalSetCredits(credits modules.CreditData) (err error)

PortalSetCredits requests the /portal/credits resource.

func (*Client) SyncerBroadcastBlock added in v0.11.0

func (c *Client) SyncerBroadcastBlock(b types.Block) (err error)

SyncerBroadcastBlock broadcasts a block to all peers.

func (*Client) SyncerConnect added in v0.11.0

func (c *Client) SyncerConnect(addr string) (err error)

SyncerConnect adds the address as a peer of the syncer.

func (*Client) SyncerPeers added in v0.11.0

func (c *Client) SyncerPeers() (resp []api.SyncerPeer, err error)

SyncerPeers returns the current peers of the syncer.

func (*Client) TxpoolFee added in v0.11.0

func (c *Client) TxpoolFee() (resp types.Currency, err error)

TxpoolFee returns the recommended fee (per weight unit) to ensure a high probability of inclusion in the next block.

func (*Client) TxpoolTransactions added in v0.11.0

func (c *Client) TxpoolTransactions() (txns []types.Transaction, v2txns []types.V2Transaction, err error)

TxpoolTransactions returns all transactions in the transaction pool.

func (*Client) WalletAddWatch added in v0.11.0

func (c *Client) WalletAddWatch(addr types.Address) (err error)

WalletAddWatch adds the specified watch address.

func (*Client) WalletAddress added in v0.11.0

func (c *Client) WalletAddress() (addr types.Address, err error)

WalletAddress returns a newly-generated address.

func (*Client) WalletAddresses added in v0.11.0

func (c *Client) WalletAddresses() (addrs []types.Address, err error)

WalletAddresses returns the addresses controlled by the wallet.

func (*Client) WalletBalance added in v0.11.0

func (c *Client) WalletBalance() (resp api.WalletBalanceResponse, err error)

WalletBalance returns the current wallet balance.

func (*Client) WalletOutputs added in v0.11.0

func (c *Client) WalletOutputs() (sc []types.SiacoinElement, sf []types.SiafundElement, err error)

WalletOutputs returns the set of unspent outputs controlled by the wallet.

func (*Client) WalletPoolTransactions added in v0.11.0

func (c *Client) WalletPoolTransactions() (resp []modules.PoolTransaction, err error)

WalletPoolTransactions returns all txpool transactions relevant to the wallet.

func (*Client) WalletRemoveWatch added in v0.11.0

func (c *Client) WalletRemoveWatch(addr types.Address) (err error)

WalletRemoveWatch removes the specified watch address.

func (*Client) WalletSendSiacoins added in v0.11.0

func (c *Client) WalletSendSiacoins(amount types.Currency, dest types.Address) (err error)

WalletSendSiacoins sends a specified amount of SC to the specified address.

func (*Client) WalletWatchedAddresses added in v0.11.0

func (c *Client) WalletWatchedAddresses() (addrs []types.Address, err error)

WalletWatchedAddresses returns a list of the watched addresses.

Jump to

Keyboard shortcuts

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