Versions in this module Expand all Collapse all v1 v1.3.1 Jan 14, 2020 v1.2.0 Oct 11, 2019 Changes in this version + const HashTypeBlockIDStr + const HashTypeBlockStakeOutputIDStr + const HashTypeCoinOutputIDStr + const HashTypeTransactionIDStr + const HashTypeUnlockHashStr + var ErrInvalidIDLength = errors.New("ID does not have the right length") + var ErrNotFound = errors.New("transaction not found") + var ErrStatusNotFound = errors.New("expecting a response, but API returned status code 204 No Content") + func BuildTransactionSet(explorer modules.Explorer, txids []types.TransactionID, ...) (txns []ExplorerTransaction, blocks []ExplorerBlock) + func DecodeError(resp *http.Response) error + func GetTransactionByLongID(cs modules.ConsensusSet, longid string) (types.Transaction, types.TransactionShortID, error) + func GetTransactionByShortID(cs modules.ConsensusSet, shortID string) (types.Transaction, error) + func HTTPGETAuthenticated(url, userAgent, password string) (resp *http.Response, err error) + func HTTPGet(url, userAgent string) (resp *http.Response, err error) + func HTTPPost(url, data, userAgent string) (resp *http.Response, err error) + func HTTPPostAuthenticated(url, data, userAgent, password string) (resp *http.Response, err error) + func NewConsensusGetTransactionHandler(cs modules.ConsensusSet) httprouter.Handle + func NewConsensusGetUnspentBlockstakeOutputHandler(cs modules.ConsensusSet) httprouter.Handle + func NewConsensusGetUnspentCoinOutputHandler(cs modules.ConsensusSet) httprouter.Handle + func NewConsensusRootHandler(cs modules.ConsensusSet) httprouter.Handle + func NewExplorerBlocksHandler(cs modules.ConsensusSet, explorer modules.Explorer) httprouter.Handle + func NewExplorerConstantsHandler(explorer modules.Explorer) httprouter.Handle + func NewExplorerHashHandler(explorer modules.Explorer, tpool modules.TransactionPool) httprouter.Handle + func NewExplorerHistoryStatsHandler(explorer modules.Explorer) httprouter.Handle + func NewExplorerRangeStatsHandler(explorer modules.Explorer) httprouter.Handle + func NewExplorerRootHandler(explorer modules.Explorer) httprouter.Handle + func NewGatewayConnectHandler(gateway modules.Gateway) httprouter.Handle + func NewGatewayDisconnectHandler(gateway modules.Gateway) httprouter.Handle + func NewGatewayRootHandler(gateway modules.Gateway) httprouter.Handle + func NewTransactionPoolGetTransactionsHandler(cs modules.ConsensusSet, tpool modules.TransactionPool) httprouter.Handle + func NewTransactionPoolOptionsTransactionHandler() httprouter.Handle + func NewTransactionPoolPostTransactionHandler(tpool modules.TransactionPool) httprouter.Handle + func NewWalletAddressHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletAddressesHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletBackupHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletBlockStakeStatsHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletBlockStakesHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletCoinsHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletCreateTransactionHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletFundCoinsHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletGetPublicKeyHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletInitHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletKeyHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletListLockedHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletListUnlockedHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletLockHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletRootHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletSeedHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletSeedsHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletSignHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletTransactionCreateHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletTransactionHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletTransactionsAddrHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletTransactionsHandler(wallet modules.Wallet) httprouter.Handle + func NewWalletUnlockHandler(wallet modules.Wallet) httprouter.Handle + func Non2xx(code int) bool + func RegisterConsensusHTTPHandlers(router Router, cs modules.ConsensusSet) + func RegisterExplorerHTTPHandlers(router Router, cs modules.ConsensusSet, explorer modules.Explorer, ...) + func RegisterGatewayHTTPHandlers(router Router, gateway modules.Gateway, requiredPassword string) + func RegisterTransactionPoolHTTPHandlers(router Router, cs modules.ConsensusSet, tpool modules.TransactionPool, ...) + func RegisterWalletHTTPHandlers(router Router, wallet modules.Wallet, requiredPassword string) + func RequirePasswordHandler(h httprouter.Handle, password string) httprouter.Handle + func RequireUserAgentHandler(h http.Handler, userAgent string) http.Handler + func ScanAddress(addrStr string) (addr types.UnlockHash, err error) + func ScanAmount(amount string) (types.Currency, bool) + func ScanHash(s string) (h crypto.Hash, err error) + func UnrecognizedCallHandler(w http.ResponseWriter, req *http.Request) + func WriteError(w http.ResponseWriter, err Error, code int) + func WriteJSON(w http.ResponseWriter, obj interface{}) + func WriteSuccess(w http.ResponseWriter) + type ConsensusGET struct + CurrentBlock types.BlockID + Height types.BlockHeight + Synced bool + Target types.Target + type ConsensusGetTransaction struct + TxShortID types.TransactionShortID + type ConsensusGetUnspentBlockstakeOutput struct + Output types.BlockStakeOutput + type ConsensusGetUnspentCoinOutput struct + Output types.CoinOutput + type Error struct + Message string + func (err Error) Error() string + type ExplorerBlock struct + MinerPayoutIDs []types.CoinOutputID + RawBlock types.Block + Transactions []ExplorerTransaction + func BuildExplorerBlock(explorer modules.Explorer, height types.BlockHeight, block types.Block) ExplorerBlock + type ExplorerBlockGET struct + Block ExplorerBlock + type ExplorerBlockStakeOutput struct + UnlockHash types.UnlockHash + type ExplorerCoinOutput struct + UnlockHash types.UnlockHash + type ExplorerGET struct + type ExplorerHashGET struct + Block ExplorerBlock + Blocks []ExplorerBlock + HashType string + MultiSigAddresses []types.UnlockHash + Transaction ExplorerTransaction + Transactions []ExplorerTransaction + Unconfirmed bool + type ExplorerMinerPayout struct + MinerPayoutID types.CoinOutputID + RawMinerPayout types.MinerPayout + type ExplorerTransaction struct + BlockStakeInputOutputs []ExplorerBlockStakeOutput + BlockStakeOutputIDs []types.BlockStakeOutputID + BlockStakeOutputUnlockHashes []types.UnlockHash + CoinInputOutputs []ExplorerCoinOutput + CoinOutputIDs []types.CoinOutputID + CoinOutputUnlockHashes []types.UnlockHash + Height types.BlockHeight + ID types.TransactionID + MinerPayouts []ExplorerMinerPayout + Order int + Parent types.BlockID + RawTransaction types.Transaction + Timestamp types.Timestamp + Unconfirmed bool + func BuildExplorerTransaction(explorer modules.Explorer, height types.BlockHeight, block types.Block, ...) (et ExplorerTransaction) + type GatewayGET struct + NetAddress modules.NetAddress + Peers []modules.Peer + type HTTPClient struct + Password string + RootURL string + UserAgent string + func (c *HTTPClient) Get(call string) error + func (c *HTTPClient) GetWithResponse(call string, obj interface{}) error + func (c *HTTPClient) Post(call, data string) error + func (c *HTTPClient) PostWithResponse(call, data string, reply interface{}) error + type HTTPError struct + func (e *HTTPError) Error() string + func (e *HTTPError) HTTPStatusCode() int + type Router interface + GET func(path string, handle httprouter.Handle) + OPTIONS func(path string, handle httprouter.Handle) + POST func(path string, handle httprouter.Handle) + type TransactionPoolGET struct + Transactions []types.Transaction + type TransactionPoolPOST struct + TransactionID types.TransactionID + type TransactionSetFilters struct + MinBlockHeight types.BlockHeight + type UnspentBlockstakeOutput struct + ID types.BlockStakeOutputID + Output types.BlockStakeOutput + type UnspentCoinOutput struct + ID types.CoinOutputID + Output types.CoinOutput + type WalletAddressGET struct + Address types.UnlockHash + type WalletAddressesGET struct + Addresses []types.UnlockHash + type WalletBlockStakeStatsGET struct + BlockCount uint64 + BlockStakeNumOf []types.Currency + BlockStakeState []uint64 + BlockStakeUTXOAddress []types.BlockStakeOutputID + TotalActiveBlockStake types.Currency + TotalBCLast1000 uint64 + TotalBCLast1000t uint64 + TotalBlockStake types.Currency + TotalFeeLast1000 types.Currency + type WalletBlockStakesPOST struct + BlockStakeOutputs []types.BlockStakeOutput + Data []byte + GenerateRefundAddress bool + RefundAddress *types.UnlockHash + type WalletBlockStakesPOSTResp struct + TransactionID types.TransactionID + type WalletCoinsPOST struct + CoinOutputs []types.CoinOutput + Data []byte + GenerateRefundAddress bool + RefundAddress *types.UnlockHash + type WalletCoinsPOSTResp struct + TransactionID types.TransactionID + type WalletCreateTransactionPOST struct + BlockStakeInputs []types.BlockStakeOutputID + BlockStakeOutputs []types.BlockStakeOutput + CoinInputs []types.CoinOutputID + CoinOutputs []types.CoinOutput + type WalletCreateTransactionRESP struct + Transaction types.Transaction + type WalletFundCoins struct + CoinInputs []types.CoinInput + RefundCoinOutput *types.CoinOutput + type WalletGET struct + BlockStakeBalance types.Currency + ConfirmedCoinBalance types.Currency + ConfirmedLockedCoinBalance types.Currency + Encrypted bool + LockedBlockStakeBalance types.Currency + MultiSigWallets []modules.MultiSigWallet + UnconfirmedIncomingCoins types.Currency + UnconfirmedOutgoingCoins types.Currency + Unlocked bool + type WalletInitPOST struct + PrimarySeed string + type WalletKeyGet struct + AlgorithmSpecifier types.Specifier + PublicKey types.ByteSlice + SecretKey types.ByteSlice + type WalletListLockedGET struct + LockedBlockstakeOutputs []UnspentBlockstakeOutput + LockedCoinOutputs []UnspentCoinOutput + type WalletListUnlockedGET struct + UnlockedBlockstakeOutputs []UnspentBlockstakeOutput + UnlockedCoinOutputs []UnspentCoinOutput + type WalletPublicKeyGET struct + PublicKey types.PublicKey + type WalletSeedsGET struct + AddressesRemaining int + AllSeeds []string + PrimarySeed string + type WalletTransactionGETid struct + Transaction modules.ProcessedTransaction + type WalletTransactionPOST struct + Amount types.Currency + Condition types.UnlockConditionProxy + Data string + type WalletTransactionPOSTResponse struct + Transaction types.Transaction + type WalletTransactionsGET struct + ConfirmedTransactions []modules.ProcessedTransaction + UnconfirmedTransactions []modules.ProcessedTransaction + type WalletTransactionsGETaddr struct + ConfirmedTransactions []modules.ProcessedTransaction + UnconfirmedTransactions []modules.ProcessedTransaction