planetdecred / dcrlibwallet

24 stars 41 forks source link

Backend sync services #255

Closed crux25 closed 2 years ago

crux25 commented 2 years ago

This PR provides the capability to fetch data from backend services. closes #248

USAGE

The External Service is called from an instance of dcrlibwallet. For Example to get the best best block height from external service use: multiwallet.ExternalService.GetBestBlock()

Supported Function List

Function Description
GetBestBlock() Fetch the best block height (int32).
GetBestBlockTimeStamp() Best block time, as unix timestamp.
GetCurrentAgendaStatus() The current agenda and its status.
GetAgendas() List of all agendas and their high level details
GetAgendaDetails(agendaId string) The details for agenda whose ID is {agendaId}
GetTreasuryBalance() Fetch the current treasury balance
GetTreasuryDetails() Get extra details about the treasury.
E.g balance, spent amount, added amount,tx
GetExchangeRate() Fetch exchange rate data summary
GetExchanges() Fetch the current state data of all known exchanges
GetTicketFeeRateSummary() The ticket fee rate summary
GetTicketFeeRate() Top 25 ticket fees
GetNHighestTicketFeeRate(nHighest int) Get the {nHighest} ticket fees
GetTicketDetails() All ticket details
GetNHighestTicketDetails(nHighest int) Get Top N {nHighest} ticket details
GetAddress(address string) returns the balances and transactions of an address
GetXpub(xPub string) Returns balances and transactions of an xpub
GetTicker(exch Exchange, market string) Returns market ticker data for supported exchanges.
The market pair should be in the format: DCR-BTC or dcr-btc. e.g To fetch dcr-btc ticker information from Binance use ExternalService.Getticker(dcrlibwallet.ext.Binance, "dcr-btc")