{"modulePath":"github.com/parallelcointeam/exploder","version":"v2.1.3+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\n## Constants\n\n```go\nconst APIVersion = 1\n```\nAPIVersion is an integer value, incremented for breaking changes\n\n## Variables\n\n```go\nvar CommitHash string\n```\nCommitHash may be set on the build command line: go build -ldflags \"-X main.CommitHash=\\`git rev-parse --short HEAD\\`\"\n\n## Functions\n\n```go\nfunc DisableLog()\n```\nDisableLog disables all library log output.  Logging output is disabled by default until UseLogger is called.\n\n```go\nfunc NewAPIRouter(app *appContext, userRealIP bool) apiMux\n```\n\n```go\nfunc NewContext(client *rpcclient.Client, params *chaincfg.Params, dataSource DataSourceLite, auxDataSource DataSourceAux, JSONIndent string) *appContext\n```\nNewContext constructs a new appContext from the RPC client, primary and auxiliary data sources, and JSON indentation string.\n\n```go\nfunc UseLogger(logger slog.Logger)\n```\nUseLogger uses a specified Logger to output package logging info.\n\n## Types\n\n```go\ntype DataSourceAux interface {\n\tSpendingTransaction(fundingTx string, vout uint32) (string, uint32, int8, error)\n\tSpendingTransactions(fundingTxID string) ([]string, []uint32, []uint32, error)\n\tAddressHistory(address string, N, offset int64, txnType dbtypes.AddrTxnType) ([]*dbtypes.AddressRow, *explorer.AddressBalance, error)\n\tFillAddressTransactions(addrInfo *explorer.AddressInfo) error\n\tAddressTransactionDetails(addr string, count, skip int64,\n\t\ttxnType dbtypes.AddrTxnType) (*apitypes.Address, error)\n\tAddressTotals(address string) (*apitypes.AddressTotals, error)\n\tVotesInBlock(hash string) (int16, error)\n}\n```\nDataSourceAux specifies an interface for advanced data collection using the auxiliary DB (e.g. PostgreSQL).\n\n```go\ntype DataSourceLite interface {\n\tCoinSupply() *apitypes.CoinSupply\n\tGetHeight() int\n\tGetBestBlockHash() (string, error)\n\tGetBlockHash(idx int64) (string, error)\n\tGetBlockHeight(hash string) (int64, error)\n\t//Get(idx int) *blockdata.BlockData\n\tGetHeader(idx int) *dcrjson.GetBlockHeaderVerboseResult\n\tGetBlockVerbose(idx int, verboseTx bool) *dcrjson.GetBlockVerboseResult\n\tGetBlockVerboseByHash(hash string, verboseTx bool) *dcrjson.GetBlockVerboseResult\n\tGetRawTransaction(txid string) *apitypes.Tx\n\tGetTransactionHex(txid string) string\n\tGetTrimmedTransaction(txid string) *apitypes.TrimmedTx\n\tGetRawTransactionWithPrevOutAddresses(txid string) (*apitypes.Tx, [][]string)\n\tGetVoteInfo(txid string) (*apitypes.VoteInfo, error)\n\tGetVoteVersionInfo(ver uint32) (*dcrjson.GetVoteInfoResult, error)\n\tGetStakeVersions(txHash string, count int32) (*dcrjson.GetStakeVersionsResult, error)\n\tGetStakeVersionsLatest() (*dcrjson.StakeVersions, error)\n\tGetAllTxIn(txid string) []*apitypes.TxIn\n\tGetAllTxOut(txid string) []*apitypes.TxOut\n\tGetTransactionsForBlock(idx int64) *apitypes.BlockTransactions\n\tGetTransactionsForBlockByHash(hash string) *apitypes.BlockTransactions\n\tGetFeeInfo(idx int) *dcrjson.FeeInfoBlock\n\t//GetStakeDiffEstimate(idx int) *dcrjson.EstimateStakeDiffResult\n\tGetStakeInfoExtended(idx int) *apitypes.StakeInfoExtended\n\t//needs db update: GetStakeInfoExtendedByHash(hash string) *apitypes.StakeInfoExtended\n\tGetStakeDiffEstimates() *apitypes.StakeDiff\n\t//GetBestBlock() *blockdata.BlockData\n\tGetSummary(idx int) *apitypes.BlockDataBasic\n\tGetSummaryByHash(hash string) *apitypes.BlockDataBasic\n\tGetBestBlockSummary() *apitypes.BlockDataBasic\n\tGetBlockSize(idx int) (int32, error)\n\tGetBlockSizeRange(idx0, idx1 int) ([]int32, error)\n\tGetPoolInfo(idx int) *apitypes.TicketPoolInfo\n\tGetPoolInfoByHash(hash string) *apitypes.TicketPoolInfo\n\tGetPoolInfoRange(idx0, idx1 int) []apitypes.TicketPoolInfo\n\tGetPool(idx int64) ([]string, error)\n\tGetPoolByHash(hash string) ([]string, error)\n\tGetPoolValAndSizeRange(idx0, idx1 int) ([]float64, []float64)\n\tGetSDiff(idx int) float64\n\tGetSDiffRange(idx0, idx1 int) []float64\n\tGetMempoolSSTxSummary() *apitypes.MempoolTicketFeeInfo\n\tGetMempoolSSTxFeeRates(N int) *apitypes.MempoolTicketFees\n\tGetMempoolSSTxDetails(N int) *apitypes.MempoolTicketDetails\n\tGetAddressTransactions(addr string, count int) *apitypes.Address\n\tGetAddressTransactionsRaw(addr string, count int) []*apitypes.AddressTxRaw\n\tGetAddressTransactionsWithSkip(addr string, count, skip int) *apitypes.Address\n\tGetAddressTransactionsRawWithSkip(addr string, count, skip int) []*apitypes.AddressTxRaw\n\tSendRawTransaction(txhex string) (string, error)\n\tGetExplorerAddress(address string, count, offset int64) *explorer.AddressInfo\n}\n```\nDataSourceLite specifies an interface for collecting data from the built-in databases (i.e. SQLite, badger, ffldb)\n\n","path":"github.com/parallelcointeam/exploder/api","name":"api","synopsis":"","isRedistributable":true}
