responses

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Id         uint64         `example:"321"                                             json:"id"           swaggertype:"integer"`
	Height     pkgTypes.Level `example:"100"                                             json:"first_height" swaggertype:"integer"`
	LastHeight pkgTypes.Level `example:"100"                                             json:"last_height"  swaggertype:"integer"`
	Hash       string         `example:"celestia1jc92qdnty48pafummfr8ava2tjtuhfdw774w60" json:"hash"         swaggertype:"string"`
	Balance    Balance        `json:"balance"`
}

Address model info

@Description	Celestia address information

func NewAddress

func NewAddress(addr storage.Address) Address

func (Address) SearchType

func (Address) SearchType() string

type Balance

type Balance struct {
	Currency string `example:"utia"        json:"currency" swaggertype:"string"`
	Value    string `example:"10000000000" json:"value"    swaggertype:"string"`
}

Balance info

@Description	Balance of address information

type Blob

type Blob struct {
	Namespace    string `example:"AAAAAAAAAAAAAAAAAAAAAAAAAAAAs2bWWU6FOB0="     format:"base64"  json:"namespace"     swaggertype:"string"`
	Data         string `example:"b2sgZGVtbyBkYQ=="                             format:"base64"  json:"data"          swaggertype:"string"`
	ShareVersion int    `example:"0"                                            format:"integer" json:"share_version" swaggertype:"integer"`
	Commitment   string `example:"vbGakK59+Non81TE3ULg5Ve5ufT9SFm/bCyY+WLR3gg=" format:"base64"  json:"commitment"    swaggertype:"string"`
	ContentType  string `example:"image/png"                                    format:"string"  json:"content_type"  swaggertype:"string"`
}

func NewBlob added in v1.1.0

func NewBlob(blob types.Blob) (Blob, error)

type BlobLog added in v1.2.0

type BlobLog struct {
	Commitment string         `example:"vbGakK59+Non81TE3ULg5Ve5ufT9SFm/bCyY+WLR3gg="    format:"base64"    json:"commitment"       swaggertype:"string"`
	Size       int64          `example:"10"                                              format:"integer"   json:"size"             swaggertype:"integer"`
	Height     pkgTypes.Level `example:"100"                                             format:"integer"   json:"height"           swaggertype:"integer"`
	Time       time.Time      `example:"2023-07-04T03:10:57+00:00"                       format:"date-time" json:"time"             swaggertype:"string"`
	Signer     string         `example:"celestia1jc92qdnty48pafummfr8ava2tjtuhfdw774w60" format:"string"    json:"signer,omitempty" swaggertype:"string"`

	Namespace *Namespace `json:"namespace,omitempty"`
	Tx        *Tx        `json:"tx,omitempty"`
}

func NewBlobLog added in v1.2.0

func NewBlobLog(blob storage.BlobLog) BlobLog

type Block

type Block struct {
	Id                 uint64       `example:"321"                                                              json:"id"                   swaggertype:"integer"`
	Height             uint64       `example:"100"                                                              json:"height"               swaggertype:"integer"`
	Time               time.Time    `example:"2023-07-04T03:10:57+00:00"                                        json:"time"                 swaggertype:"string"`
	VersionBlock       string       `example:"11"                                                               json:"version_block"        swaggertype:"string"`
	VersionApp         string       `example:"1"                                                                json:"version_app"          swaggertype:"string"`
	Hash               pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"hash"                 swaggertype:"string"`
	ParentHash         pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"parent_hash"          swaggertype:"string"`
	LastCommitHash     pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"last_commit_hash"     swaggertype:"string"`
	DataHash           pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"data_hash"            swaggertype:"string"`
	ValidatorsHash     pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"validators_hash"      swaggertype:"string"`
	NextValidatorsHash pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"next_validators_hash" swaggertype:"string"`
	ConsensusHash      pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"consensus_hash"       swaggertype:"string"`
	AppHash            pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"app_hash"             swaggertype:"string"`
	LastResultsHash    pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"last_results_hash"    swaggertype:"string"`
	EvidenceHash       pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"evidence_hash"        swaggertype:"string"`

	Proposer *ShortValidator `json:"proposer,omitempty"`

	MessageTypes []types.MsgType `example:"MsgSend,MsgUnjail" json:"message_types" swaggertype:"array,string"`

	Stats *BlockStats `json:"stats,omitempty"`
}

func NewBlock

func NewBlock(block storage.Block, withStats bool) Block

func (Block) SearchType

func (Block) SearchType() string

type BlockStats

type BlockStats struct {
	TxCount        int64                   `example:"12"                              json:"tx_count"        swaggertype:"integer"`
	EventsCount    int64                   `example:"18"                              json:"events_count"    swaggertype:"integer"`
	BlobsSize      int64                   `example:"12354"                           json:"blobs_size"      swaggertype:"integer"`
	Fee            string                  `example:"28347628346"                     json:"fee"             swaggertype:"string"`
	SupplyChange   string                  `example:"8635234"                         json:"supply_change"   swaggertype:"string"`
	InflationRate  string                  `example:"0.0800000"                       json:"inflation_rate"  swaggertype:"string"`
	FillRate       string                  `example:"0.0800"                          json:"fill_rate"       swaggertype:"string"`
	BlockTime      uint64                  `example:"12354"                           json:"block_time"      swaggertype:"integer"`
	GasLimit       int64                   `example:"1234"                            json:"gas_limit"       swaggertype:"integer"`
	GasUsed        int64                   `example:"1234"                            json:"gas_used"        swaggertype:"integer"`
	BytesInBlock   int64                   `example:"1234"                            json:"bytes_in_block"  swaggertype:"integer"`
	MessagesCounts map[types.MsgType]int64 `example:"{MsgPayForBlobs:10,MsgUnjail:1}" json:"messages_counts" swaggertype:"string"`
}

func NewBlockStats

func NewBlockStats(stats storage.BlockStats) *BlockStats

type Constants

type Constants struct {
	Module        map[string]Params `json:"module"`
	DenomMetadata []DenomMetadata   `json:"denom_metadata"`
}

func NewConstants

func NewConstants(consts []storage.Constant, denomMetadata []storage.DenomMetadata) Constants

type DenomMetadata

type DenomMetadata struct {
	Description string `example:"Some description"    json:"description" swaggertype:"string"`
	Base        string `example:"utia"                json:"base"        swaggertype:"string"`
	Display     string `example:"TIA"                 json:"display"     swaggertype:"string"`
	Name        string `example:"TIA"                 json:"name"        swaggertype:"string"`
	Symbol      string `example:"TIA"                 json:"symbol"      swaggertype:"string"`
	Uri         string `example:"https://example.com" json:"uri"         swaggertype:"string"`

	Units json.RawMessage `json:"units"`
}

type Enums added in v1.1.3

type Enums struct {
	Status      []string `json:"status"`
	MessageType []string `json:"message_type"`
	EventType   []string `json:"event_type"`
}

func NewEnums added in v1.1.3

func NewEnums() Enums

type Event

type Event struct {
	Id       uint64         `example:"321"                       format:"int64"     json:"id"              swaggertype:"integer"`
	Height   pkgTypes.Level `example:"100"                       format:"int64"     json:"height"          swaggertype:"integer"`
	Time     time.Time      `example:"2023-07-04T03:10:57+00:00" format:"date-time" json:"time"            swaggertype:"string"`
	Position int64          `example:"1"                         format:"int64"     json:"position"        swaggertype:"integer"`
	TxId     uint64         `example:"11"                        format:"int64"     json:"tx_id,omitempty" swaggertype:"integer"`

	Type types.EventType `example:"commission" json:"type"`

	Data map[string]any `json:"data"`
}

func NewEvent

func NewEvent(event storage.Event) Event

type GasPrice added in v1.1.0

type GasPrice struct {
	Slow   string `example:"0.1234" format:"string" json:"slow"   swaggertype:"string"`
	Median string `example:"0.1234" format:"string" json:"median" swaggertype:"string"`
	Fast   string `example:"0.1234" format:"string" json:"fast"   swaggertype:"string"`
}

type HistogramItem

type HistogramItem struct {
	Time  time.Time `example:"2023-07-04T03:10:57+00:00" format:"date-time" json:"time"  swaggertype:"string"`
	Value string    `example:"2223424"                   format:"string"    json:"value" swaggertype:"string"`
}

func NewHistogramItem

func NewHistogramItem(item storage.HistogramItem) HistogramItem

type Message

type Message struct {
	Id       uint64         `example:"321"                       format:"int64"     json:"id"              swaggertype:"integer"`
	Height   pkgTypes.Level `example:"100"                       format:"int64"     json:"height"          swaggertype:"integer"`
	Time     time.Time      `example:"2023-07-04T03:10:57+00:00" format:"date-time" json:"time"            swaggertype:"string"`
	Position int64          `example:"2"                         format:"int64"     json:"position"        swaggertype:"integer"`
	TxId     uint64         `example:"11"                        format:"int64"     json:"tx_id,omitempty" swaggertype:"integer"`

	Type types.MsgType `example:"MsgCreatePeriodicVestingAccount" json:"type"`

	Data map[string]any `json:"data"`

	Tx *Tx `json:"tx,omitempty"`
}

func NewMessage

func NewMessage(msg storage.Message) Message

func NewMessageWithTx added in v1.0.4

func NewMessageWithTx(msg storage.MessageWithTx) Message

type MessageForAddress added in v1.2.0

type MessageForAddress struct {
	Id       uint64         `example:"321"                       format:"int64"     json:"id"              swaggertype:"integer"`
	Height   pkgTypes.Level `example:"100"                       format:"int64"     json:"height"          swaggertype:"integer"`
	Time     time.Time      `example:"2023-07-04T03:10:57+00:00" format:"date-time" json:"time"            swaggertype:"string"`
	Position int64          `example:"2"                         format:"int64"     json:"position"        swaggertype:"integer"`
	TxId     uint64         `example:"11"                        format:"int64"     json:"tx_id,omitempty" swaggertype:"integer"`

	Type types.MsgType `example:"MsgCreatePeriodicVestingAccount" json:"type"`

	Data map[string]any `json:"data"`
	Tx   TxForAddress   `json:"tx"`
}

type Namespace

type Namespace struct {
	ID              uint64         `` /* 132-byte string literal not displayed */
	Size            int64          `` /* 132-byte string literal not displayed */
	Version         byte           `` /* 132-byte string literal not displayed */
	NamespaceID     string         `` /* 131-byte string literal not displayed */
	Hash            string         `` /* 131-byte string literal not displayed */
	PfbCount        int64          `` /* 132-byte string literal not displayed */
	LastHeight      pkgTypes.Level `` /* 132-byte string literal not displayed */
	LastMessageTime time.Time      `` /* 131-byte string literal not displayed */
	Name            string         `` /* 131-byte string literal not displayed */
	Reserved        bool           `example:"true"                                                     json:"reserved"`
}

func NewNamespace

func NewNamespace(ns storage.Namespace) Namespace

func (Namespace) SearchType

func (Namespace) SearchType() string

type NamespaceMessage

type NamespaceMessage struct {
	Id       uint64    `example:"321"                       format:"int64"     json:"id"       swaggertype:"integer"`
	Height   int64     `example:"100"                       format:"int64"     json:"height"   swaggertype:"integer"`
	Time     time.Time `example:"2023-07-04T03:10:57+00:00" format:"date-time" json:"time"     swaggertype:"string"`
	Position int64     `example:"2"                         format:"int64"     json:"position" swaggertype:"integer"`

	Type string `` /* 344-byte string literal not displayed */

	Data      map[string]any `json:"data"`
	Tx        Tx             `json:"tx"`
	Namespace Namespace      `json:"namespace"`
}

func NewNamespaceMessage

func NewNamespaceMessage(msg storage.NamespaceMessage) (NamespaceMessage, error)

type NamespaceUsage added in v1.1.0

type NamespaceUsage struct {
	Name        string `` /* 134-byte string literal not displayed */
	Version     *byte  `` /* 135-byte string literal not displayed */
	NamespaceID string `` /* 134-byte string literal not displayed */
	Size        int64  `` /* 134-byte string literal not displayed */
}

func NewNamespaceUsage added in v1.1.0

func NewNamespaceUsage(ns storage.Namespace) NamespaceUsage

type Params

type Params map[string]string

type Price added in v1.2.0

type Price struct {
	Time  time.Time `example:"2023-07-04T03:10:57+00:00" format:"date-time" json:"time"  swaggertype:"string"`
	Open  string    `example:"0.17632"                   format:"string"    json:"open"  swaggertype:"string"`
	High  string    `example:"0.17632"                   format:"string"    json:"high"  swaggertype:"string"`
	Low   string    `example:"0.17632"                   format:"string"    json:"low"   swaggertype:"string"`
	Close string    `example:"0.17632"                   format:"string"    json:"close" swaggertype:"string"`
}

func NewPrice added in v1.2.0

func NewPrice(price storage.Price) Price

type Rollup added in v1.2.0

type Rollup struct {
	Id          uint64 `example:"321"                             format:"integer" json:"id"                    swaggertype:"integer"`
	Name        string `example:"Rollup name"                     format:"string"  json:"name"                  swaggertype:"string"`
	Description string `example:"Long rollup description"         format:"string"  json:"description,omitempty" swaggertype:"string"`
	Website     string `example:"https://website.com"             format:"string"  json:"website,omitempty"     swaggertype:"string"`
	Twitter     string `example:"https://x.com/account"           format:"string"  json:"twitter,omitempty"     swaggertype:"string"`
	Github      string `example:"https://github.com/account"      format:"string"  json:"github,omitempty"      swaggertype:"string"`
}

func NewRollup added in v1.2.0

func NewRollup(r *storage.Rollup) Rollup

type RollupWithStats added in v1.2.0

type RollupWithStats struct {
	Id          uint64 `example:"321"                             format:"integer" json:"id"                    swaggertype:"integer"`
	Name        string `example:"Rollup name"                     format:"string"  json:"name"                  swaggertype:"string"`
	Description string `example:"Long rollup description"         format:"string"  json:"description,omitempty" swaggertype:"string"`
	Website     string `example:"https://website.com"             format:"string"  json:"website,omitempty"     swaggertype:"string"`
	Twitter     string `example:"https://x.com/account"           format:"string"  json:"twitter,omitempty"     swaggertype:"string"`
	Github      string `example:"https://github.com/account"      format:"string"  json:"github,omitempty"      swaggertype:"string"`

	BlobsCount int64     `example:"2"                         format:"integer"   json:"blobs_count"       swaggertype:"integer"`
	Size       int64     `example:"1000"                      format:"integer"   json:"size"              swaggertype:"integer"`
	LastAction time.Time `example:"2023-07-04T03:10:57+00:00" format:"date-time" json:"last_message_time" swaggertype:"string"`
}

func NewRollupWithStats added in v1.2.0

func NewRollupWithStats(r storage.RollupWithStats) RollupWithStats

type SearchResponse

type SearchResponse[T Searchable] struct {
	// Search result. Can be one of folowwing types: Block, Address, Namespace, Tx
	Result T `json:"result" swaggertype:"object"`
	// Result type which is in the result. Can be 'block', 'address', 'namespace', 'tx'
	Type string `json:"type"`

} //	@name	SearchResponse

func NewSearchResponse

func NewSearchResponse[T Searchable](val T) SearchResponse[T]

type Searchable

type Searchable interface {
	Block | Address | Namespace | Tx

	SearchType() string
}

type SeriesItem added in v1.1.0

type SeriesItem struct {
	Time  time.Time `example:"2023-07-04T03:10:57+00:00" format:"date-time" json:"time"          swaggertype:"string"`
	Value string    `example:"0.17632"                   format:"string"    json:"value"         swaggertype:"string"`
	Max   string    `example:"0.17632"                   format:"string"    json:"max,omitempty" swaggertype:"string"`
	Min   string    `example:"0.17632"                   format:"string"    json:"min,omitempty" swaggertype:"string"`
}

func NewSeriesItem added in v1.1.0

func NewSeriesItem(item storage.SeriesItem) SeriesItem

type ShortValidator added in v1.1.0

type ShortValidator struct {
	Id          uint64 `example:"321"                                      json:"id"           swaggertype:"integer"`
	ConsAddress string `example:"E641C7A2C964833E556AEF934FBF166B712874B6" json:"cons_address" swaggertype:"string"`
	Moniker     string `example:"Easy 2 Stake"                             json:"moniker"      swaggertype:"string"`
}

func NewShortValidator added in v1.1.0

func NewShortValidator(val storage.Validator) *ShortValidator

type State

type State struct {
	Id             uint64         `` /* 139-byte string literal not displayed */
	Name           string         `` /* 138-byte string literal not displayed */
	LastHeight     pkgTypes.Level `` /* 139-byte string literal not displayed */
	LastHash       string         `` /* 138-byte string literal not displayed */
	LastTime       time.Time      `` /* 138-byte string literal not displayed */
	TotalTx        int64          `` /* 139-byte string literal not displayed */
	TotalAccounts  int64          `` /* 139-byte string literal not displayed */
	TotalFee       string         `` /* 138-byte string literal not displayed */
	TotalBlobsSize int64          `` /* 139-byte string literal not displayed */
	TotalSupply    string         `` /* 138-byte string literal not displayed */
	Synced         bool           `` /* 139-byte string literal not displayed */
}

func NewState

func NewState(state storage.State) State

type TPS added in v1.1.0

type TPS struct {
	High              float64 `example:"1.023" format:"float" json:"high"                 swaggertype:"number"`
	Low               float64 `example:"0.123" format:"float" json:"low"                  swaggertype:"number"`
	Current           float64 `example:"0.567" format:"float" json:"current"              swaggertype:"number"`
	ChangeLastHourPct float64 `example:"0.275" format:"float" json:"change_last_hour_pct" swaggertype:"number"`
}

func NewTPS added in v1.1.0

func NewTPS(tps storage.TPS) TPS

type Tx

type Tx struct {
	Id            uint64         `` /* 142-byte string literal not displayed */
	Height        pkgTypes.Level `` /* 142-byte string literal not displayed */
	Position      int64          `` /* 142-byte string literal not displayed */
	GasWanted     int64          `` /* 142-byte string literal not displayed */
	GasUsed       int64          `` /* 142-byte string literal not displayed */
	TimeoutHeight uint64         `` /* 142-byte string literal not displayed */
	EventsCount   int64          `` /* 142-byte string literal not displayed */
	MessagesCount int64          `` /* 142-byte string literal not displayed */
	Hash          string         `` /* 141-byte string literal not displayed */
	Fee           string         `` /* 141-byte string literal not displayed */
	Error         string         `` /* 141-byte string literal not displayed */
	Codespace     string         `` /* 141-byte string literal not displayed */
	Memo          string         `` /* 141-byte string literal not displayed */
	Time          time.Time      `` /* 141-byte string literal not displayed */

	Messages []Message `json:"messages,omitempty"`

	MessageTypes []types.MsgType `example:"MsgSend,MsgUnjail" json:"message_types"`
	Status       types.Status    `example:"success"           json:"status"`

	MsgTypeMask types.MsgTypeBits `json:"-"`
}

func NewTx

func NewTx(tx storage.Tx) Tx

func (Tx) SearchType

func (Tx) SearchType() string

type TxCountHistogramItem added in v1.1.0

type TxCountHistogramItem struct {
	Time  time.Time `example:"2023-07-04T03:10:57+00:00" format:"date-time" json:"time"  swaggertype:"string"`
	Count int64     `example:"2223424"                   format:"integer"   json:"count" swaggertype:"integer"`
	TPS   float64   `example:"0.13521"                   format:"float"     json:"tps"   swaggertype:"number"`
}

func NewTxCountHistogramItem added in v1.1.0

func NewTxCountHistogramItem(item storage.TxCountForLast24hItem) TxCountHistogramItem

type TxForAddress added in v1.2.0

type TxForAddress struct {
	MessagesCount int64  `` /* 134-byte string literal not displayed */
	Hash          string `` /* 133-byte string literal not displayed */
	Fee           string `` /* 133-byte string literal not displayed */

	MessageTypes []types.MsgType `example:"MsgSend,MsgUnjail" json:"message_types"`
	Status       types.Status    `example:"success"           json:"status"`
}

func NewTxForAddress added in v1.2.0

func NewTxForAddress(tx *storage.Tx) TxForAddress

type Validator added in v1.1.0

type Validator struct {
	Id          uint64 `example:"321"                                                    json:"id"           swaggertype:"integer"`
	Delegator   string `example:"celestia1un77nfm6axkhkupe8fk4xl6fd4adz3y5qk7ph6"        json:"delegator"    swaggertype:"string"`
	Address     string `example:"celestiavaloper1un77nfm6axkhkupe8fk4xl6fd4adz3y59fucpu" json:"address"      swaggertype:"string"`
	ConsAddress string `example:"E641C7A2C964833E556AEF934FBF166B712874B6"               json:"cons_address" swaggertype:"string"`

	Moniker  string `example:"Easy 2 Stake"                   json:"moniker"  swaggertype:"string"`
	Website  string `example:"https://www.easy2stake.com/"    json:"website"  swaggertype:"string"`
	Identity string `example:"2C877AC873132C91"               json:"identity" swaggertype:"string"`
	Contacts string `example:"security@0xfury.com"            json:"contacts" swaggertype:"string"`
	Details  string `example:"Some long text about validator" json:"details"  swaggertype:"string"`

	Rate              string `example:"0.03" json:"rate"                swaggertype:"string"`
	MaxRate           string `example:"0.1"  json:"max_rate"            swaggertype:"string"`
	MaxChangeRate     string `example:"0.01" json:"max_change_rate"     swaggertype:"string"`
	MinSelfDelegation string `example:"1"    json:"min_self_delegation" swaggertype:"string"`
}

func NewValidator added in v1.1.0

func NewValidator(val storage.Validator) *Validator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL