Documentation ¶
Index ¶
- Constants
- func AddressParam(r *http.Request, inQuery bool, key string) (string, error)
- func BadRequest(w http.ResponseWriter, reason string)
- func BadRequestErr(w http.ResponseWriter, err error)
- func HashParam(r *http.Request, inQuery bool, key string) (string, error)
- func InitRouter(chains map[uint32]*rt.ChainRTO, cfg APIConfig) http.Handler
- func Int64Param(r *http.Request, inQuery bool, key string) (int64, error)
- func NotFound(w http.ResponseWriter)
- func PageParams(r *http.Request, defaultLimit uint32) (limit, offset uint32, err error)
- func ServerError(w http.ResponseWriter)
- func SetNetParams(params *chaincfg.Params)
- func StringArrayParam(r *http.Request, inQuery bool, key string) []string
- func StringParam(r *http.Request, inQuery bool, key string) string
- func Success(w http.ResponseWriter, data interface{})
- func SuccessAny(w http.ResponseWriter, data interface{})
- func Uint32Param(r *http.Request, inQuery bool, key string) (uint32, error)
- func Uint64Param(r *http.Request, inQuery bool, key string) (uint64, error)
- func UseLogger(logger zerolog.Logger)
- func WriteResponse(w http.ResponseWriter, status int, data ResponseData)
- type APIConfig
- type AddressSummaryResponse
- type BalanceResponse
- type BlockShortInfo
- type NearestDatesIndexResponse
- type ResponseData
- type SearchResponse
- type ShardInfo
- type TxOperation
- type TxRecord
- type TxShortInfo
- type TxSubmit
- type UTXO
Constants ¶
View Source
const ( SearchResultTypeUnknown = -1 SearchResultTypeAddress = 0 SearchResultTypeTransaction = 1 SearchResultTypeBlock = 2 SearchResultTypeEAD = 3 )
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, reason string)
func BadRequestErr ¶
func BadRequestErr(w http.ResponseWriter, err error)
func NotFound ¶
func NotFound(w http.ResponseWriter)
func PageParams ¶
func ServerError ¶
func ServerError(w http.ResponseWriter)
func SetNetParams ¶
func Success ¶
func Success(w http.ResponseWriter, data interface{})
func SuccessAny ¶ added in v0.4.11
func SuccessAny(w http.ResponseWriter, data interface{})
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, status int, data ResponseData)
Types ¶
type AddressSummaryResponse ¶
type AddressSummaryResponse struct {
Shards []BalanceResponse `json:"shards"`
}
type BalanceResponse ¶
type BlockShortInfo ¶
type NearestDatesIndexResponse ¶ added in v0.4.11
type ResponseData ¶
type SearchResponse ¶
type ShardInfo ¶
type ShardInfo struct { ID uint32 `json:"id"` GenesisHeight int64 `json:"genesisHeight"` GenesisHash string `json:"genesisHash"` Blocks int64 `json:"blocks"` CurrentBlockSize uint64 `json:"currentBlockSize"` CurrentBlockWeight uint64 `json:"currentBlockWeight"` Difficulty float64 `json:"difficulty"` HashPS int64 `json:"hashPS"` }
type TxOperation ¶
type TxRecord ¶
type TxRecord struct { ID string `json:"id"` // TxHash Hash string `json:"hash"` // TxWitnessHash BlockNumber int64 `json:"blockNumber"` CrossShardTx bool `json:"crossShardTx"` PairedShardID uint32 `json:"pairedShardID,omitempty"` // present only if cross-shard. Timestamp int64 `json:"timestamp"` Confirmations int64 `json:"confirmations"` // 0 for mempool Amount int64 `json:"amount"` // Balance delta by the caller's address perspective. SentAmount int64 `json:"sentAmount"` // Sent amount by the caller's address perspective. ReceivedAmount int64 `json:"receivedAmount"` // Received amount by the caller's address perspective. Fee int64 `json:"fee"` // Transaction fee TotalIn int64 `json:"totalIn"` TotalOut int64 `json:"totalOut"` Senders []TxOperation `json:"senders"` Receivers []TxOperation `json:"receivers"` // contains filtered or unexported fields }
type TxShortInfo ¶
type UTXO ¶
type UTXO struct { TxHash string `json:"hash"` TxOutput uint16 `json:"output"` Amount int64 `json:"amount"` PKScript string `json:"pkScript"` UnlockingBlock int64 `json:"unlockingBlock,omitempty"` Spent bool `json:"spent"` Timestamp int64 `json:"timestamp,omitempty"` // час орієнтовного розлоку Locked bool `json:"locked"` LockPeriod int64 `json:"lockPeriod"` BlockHash string `json:"blockHash"` BlockTime int64 `json:"blockTime"` }
Click to show internal directories.
Click to hide internal directories.