Documentation
¶
Index ¶
- func JSONErr(w http.ResponseWriter, code int, errText string)
- func JSONErrs(w http.ResponseWriter, code int, errs []string)
- func JSONRedirect(w http.ResponseWriter, code int, urlStr string)
- func JSONResp(w http.ResponseWriter, code int, content interface{})
- type AccountAccountsDetailHandler
- type AccountAccountsHandler
- type AccountDomainsHandler
- type BlocksHandler
- type CashBalanceHandler
- type DefaultHandler
- type EscrowEscrowsHandler
- type GconfHandler
- type GovProposalsHandler
- type GovVotesHandler
- type InfoHandler
- type KeyValue
- type MultisigContractsHandler
- type TermdepositContractsHandler
- type TermdepositDepositsHandler
- type UsernameOwnerHandler
- type UsernameResolveHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONErr ¶
func JSONErr(w http.ResponseWriter, code int, errText string)
JSONErr write single error as JSON encoded response.
func JSONErrs ¶
func JSONErrs(w http.ResponseWriter, code int, errs []string)
JSONErrs write multiple errors as JSON encoded response.
func JSONRedirect ¶
func JSONRedirect(w http.ResponseWriter, code int, urlStr string)
JSONRedirect return redirect response, but with JSON formatted body.
func JSONResp ¶
func JSONResp(w http.ResponseWriter, code int, content interface{})
JSONResp write content as JSON encoded response.
Types ¶
type AccountAccountsDetailHandler ¶ added in v0.9.0
func (*AccountAccountsDetailHandler) ServeHTTP ¶ added in v0.9.0
func (h *AccountAccountsDetailHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
AccountAccountsDetailHandler godoc @Summary Resolve a starname (orkun*neuma) and returns a `bnsd/x/account` entity (the associated info). @Description Resolve a given starname (like orkun*neuma) and return all metadata related to this starname, @Description list of crypto-addresses (targets), expiration date and owner address of the starname. @Param starname path string true "starname ex: orkun*neuma" @Tags Starname @Success 200 {object} json.RawMessage @Failure 404 {object} json.RawMessage @Failure 500 {object} json.RawMessage @Router /account/resolve/{starname} [get]
type AccountAccountsHandler ¶ added in v0.9.0
func (*AccountAccountsHandler) ServeHTTP ¶ added in v0.9.0
func (h *AccountAccountsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
AccountAccountsDetailHandler godoc @Summary Returns a list of `bnsd/x/account` entities (like orkun*neuma). @Description The list is either the list of all the starname (orkun*neuma) for a given premium starname (*neuma), or the list of all starnames for a given owner address. @Description You need to provide exactly one argument, either the premium starname (*neuma) or the owner address. @Description @Tags Starname @Param starname query string false "Premium Starname ex: *neuma" @Param ownerAddress query string false "The owner address format is either in iov address (iov1c9eprq0gxdmwl9u25j568zj7ylqgc7ajyu8wxr) or hex (C1721181E83376EF978AA4A9A38A5E27C08C7BB2)" @Param offset query string false "Pagination offset" @Success 200 {object} json.RawMessage @Failure 404 {object} json.RawMessage @Failure 500 {object} json.RawMessage @Router /account/accounts [get]
type AccountDomainsHandler ¶ added in v0.9.0
func (*AccountDomainsHandler) ServeHTTP ¶ added in v0.9.0
func (h *AccountDomainsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
AccountDomainsHandler godoc @Summary Returns a list of `bnsd/x/domain` entities (like *neuma). @Description The list of all premium starnames for a given admin. @Description If no admin address is provided, you get the list of all premium starnames. @Param adminAddress query string false "The admin address may be in the bech32 (iov1c9eprq0gxdmwl9u25j568zj7ylqgc7ajyu8wxr) or hex (C1721181E83376EF978AA4A9A38A5E27C08C7BB2) format." @Param offset query string false "Pagination offset" @Tags Starname @Success 200 {object} json.RawMessage @Failure 404 {object} json.RawMessage @Redirect 303 @Router /account/domains/ [get]
type BlocksHandler ¶
func (*BlocksHandler) ServeHTTP ¶
func (h *BlocksHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
BlocksHandler godoc @Summary Get block details by height @Description get block detail by blockHeight @Tags Status @Param blockHeight path int true "Block Height" @Success 200 @Failure 404 @Redirect 303 @Router /blocks/{blockHeight} [get]
type CashBalanceHandler ¶
func (*CashBalanceHandler) ServeHTTP ¶
func (h *CashBalanceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
CashBalanceHandler godoc @Summary returns the list of all balances in IOV Token or the balance for the given iov address. @Description returns the list of all balances in IOV Token or the balance for the given iov address. @Tags IOV token @Param address path string false "The iov address may be in the bech32 (iov1c9eprq0gxdmwl9u25j568zj7ylqgc7ajyu8wxr) or hex (C1721181E83376EF978AA4A9A38A5E27C08C7BB2) format." @Param offset query string false "Bech32 or hex representation of an address to be used as offset" @Success 200 @Failure 404 @Failure 500 @Router /cash/balances [get]
type DefaultHandler ¶
type DefaultHandler struct{}
DefaultHandler is used to handle the request that no other handler wants.
func (*DefaultHandler) ServeHTTP ¶
func (h *DefaultHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type EscrowEscrowsHandler ¶
func (*EscrowEscrowsHandler) ServeHTTP ¶
func (h *EscrowEscrowsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
EscrowEscrowsHandler godoc @Summary Returns a list of all the smart contract Escrows. @Description If no parameters are provided, it returns the list of all escrows. @Description If either a source address or a destination address is provided, it returns the filtered on this parameter. @Description (The filter is not working on source AND destination). @Tags IOV token @Param sourcAddress query string false "Source address in bech32 (iov1c9eprq0gxdmwl9u25j568zj7ylqgc7ajyu8wxr) or hex (C1721181E83376EF978AA4A9A38A5E27C08C7BB2)" @Param destinationAddress query string false "Destination address in bech32 (iov1c9eprq0gxdmwl9u25j568zj7ylqgc7ajyu8wxr) or hex (C1721181E83376EF978AA4A9A38A5E27C08C7BB2)" @Param offset query string false "Pagination offset" @Success 200 @Failure 404 @Failure 400 @Failure 500 @Router /escrow/escrows [get]
type GconfHandler ¶
type GconfHandler struct {
Bns client.BnsClient
Confs map[string]func() gconf.Configuration
}
func (*GconfHandler) ServeHTTP ¶
func (h *GconfHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GovProposalsHandler ¶
func (*GovProposalsHandler) ServeHTTP ¶
func (h *GovProposalsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
GovProposalsHandler godoc @Summary Returns a list of x/gov Votes entities. @Description At most one of the query parameters must exist(excluding offset) @Tags Governance @Param author query string false "Author address" @Param electorate query string false "Base64 encoded electorate ID" @Param elector query string false "Base64 encoded Elector ID" @Param electorID query int false "Elector ID" @Success 200 @Failure 404 @Failure 400 @Failure 500 @Router /gov/proposals [get]
type GovVotesHandler ¶
func (*GovVotesHandler) ServeHTTP ¶
func (h *GovVotesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
GovVotesHandler godoc @Summary Returns a list of Votes made on the governance. @Description At most one of the query parameters must exist(excluding offset) @Tags Governance @Param proposal query string false "Base64 encoded Proposal ID" @Param proposalID query int false "Proposal ID" @Param elector query string false "Base64 encoded Elector ID" @Param electorID query int false "Elector ID" @Success 200 @Failure 404 @Failure 400 @Failure 500 @Router /gov/votes [get]
type InfoHandler ¶
type InfoHandler struct{}
func (*InfoHandler) ServeHTTP ¶
func (h *InfoHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
InfoHandler godoc @Summary Returns information about this instance of `bnsapi`. @Tags Status @Success 200 @Router /info/ [get]
type MultisigContractsHandler ¶
func (*MultisigContractsHandler) ServeHTTP ¶
func (h *MultisigContractsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
MultisigContractsHandler godoc @Summary Returns a list of all the multisig Contracts. @Description Returns a list of all the multisig Contracts. @Tags IOV token @Param offset query string false "Pagination offset" @Success 200 @Failure 404 @Failure 500 @Router /multisig/contracts [get]
type TermdepositContractsHandler ¶ added in v0.9.0
func (*TermdepositContractsHandler) ServeHTTP ¶ added in v0.9.0
func (h *TermdepositContractsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
TermdepositContractsHandler godoc @Summary Returns a list of bnsd/x/termdeposit entities. @Description The term deposit Contract are the contract defining the dates until which one can deposit. @Tags IOV token @Param offset query string false "Pagination offset" @Success 200 {object} json.RawMessage @Failure 404 {object} json.RawMessage @Failure 500 @Router /termdeposit/contracts [get]
type TermdepositDepositsHandler ¶ added in v0.9.0
func (*TermdepositDepositsHandler) ServeHTTP ¶ added in v0.9.0
func (h *TermdepositDepositsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
TermdepositDepositsHandler godoc @Summary Returns a list of bnsd/x/termdeposit Deposit entities (individual deposits). @Description At most one of the query parameters must exist (excluding offset). @Description The query may be filtered by Depositor, in which case it returns all the deposits from the Depositor. @Description The query may be filtered by Deposit Contract, in which case it returns all the deposits from this Contract. @Description The query may be filtered by Contract ID, in which case it returns the deposits from the Deposit Contract with this ID. @Tags IOV token @Param depositor query string false "Depositor address in bech32 (iov1c9eprq0gxdmwl9u25j568zj7ylqgc7ajyu8wxr) or hex(C1721181E83376EF978AA4A9A38A5E27C08C7BB2)" @Param contract query string false "Base64 encoded ID" @Param contract_id query int false "Contract ID as integer" @Success 200 {object} json.RawMessage @Failure 404 {object} json.RawMessage @Failure 500 @Router /termdeposit/deposits [get]
type UsernameOwnerHandler ¶
func (*UsernameOwnerHandler) ServeHTTP ¶
func (h *UsernameOwnerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type UsernameResolveHandler ¶
func (*UsernameResolveHandler) ServeHTTP ¶
func (h *UsernameResolveHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)