dto

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Raw        string
	Number     uint64
	ParentHash string
	Hash       string
	Extrinsics []string
}

type Event

type Event struct {
	Type         EventType   `json:"type"`
	ExtrinsicIdx int         `json:"extrinsic_idx"`
	Params       interface{} `json:"params"`
}

type EventType

type EventType struct {
	ModuleId string `json:"module_id"`
	EventId  string `json:"event_id"`
}

type Extrinsic

type Extrinsic struct {
	Payload          string `json:"raw"`
	Hash             string `json:"hash"`
	Era              string `json:"era"`
	LifetimeInBlocks uint64 `json:"lifetime"`
	FirstSeenBlockNo uint64 `json:"firstSeenBlockNo"`
}

type Mapped

type Mapped map[string]interface{}

func MustMap

func MustMap(p interface{}) Mapped

func (Mapped) Get

func (r Mapped) Get(key string) Mapped

func (Mapped) GetInterface

func (r Mapped) GetInterface(key string) interface{}

func (Mapped) GetSlice

func (r Mapped) GetSlice(key string) []Mapped

func (Mapped) MustInt

func (r Mapped) MustInt(key string) uint64

func (Mapped) MustString

func (r Mapped) MustString(key string) string

func (Mapped) MustStringMap

func (r Mapped) MustStringMap(key string) map[string]string

func (Mapped) MustStrings

func (r Mapped) MustStrings(key string) []string

type Params

type Params interface{}

type RPCBatch

type RPCBatch []RPCFrame

func (RPCBatch) Render

func (b RPCBatch) Render(w http.ResponseWriter, r *http.Request) error

type RPCError

type RPCError struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type RPCFrame

type RPCFrame struct {
	Id     int         `json:"id"`
	RPC    string      `json:"jsonrpc"`
	Method string      `json:"method,omitempty"`
	Raw    string      `json:"raw,omitempty"`
	Params Params      `json:"params,omitempty"`
	Result interface{} `json:"result,omitempty"`
	Error  *RPCError   `json:"error,omitempty"`
}

func NewFrameFrom

func NewFrameFrom(payload []byte) (*RPCFrame, error)

func (*RPCFrame) MappedResult

func (r *RPCFrame) MappedResult() Mapped

func (*RPCFrame) StringResult

func (r *RPCFrame) StringResult() string

type StoredMessage

type StoredMessage struct {
	RPCFrame          *RPCFrame  `json:"rpcFrame"`
	Extrinsic         *Extrinsic `json:"extrinsic"`
	ContainsExtrinsic bool       `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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