taostats

package
v0.0.0-...-78810ce Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0, MIT Imports: 9 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 {
	Kind  string `json:"__kind"`
	Value string `json:"value"`
}

type Args

type Args struct {
	DispatchInfo *DispatchInfo `json:"dispatchInfo,omitempty"`
	ActualFee    *string       `json:"actualFee,omitempty"`
	Tip          *string       `json:"tip,omitempty"`
	Who          *string       `json:"who,omitempty"`
	Amount       *string       `json:"amount,omitempty"`
	From         *string       `json:"from,omitempty"`
	To           *string       `json:"to,omitempty"`
}

type Block

type Block struct {
	BlockNumber     int       `json:"block_number"`
	Hash            string    `json:"hash"`
	ParentHash      string    `json:"parent_hash"`
	StateRoot       string    `json:"state_root"`
	ExtrinsicsRoot  string    `json:"extrinsics_root"`
	SpecName        string    `json:"spec_name"`
	SpecVersion     int       `json:"spec_version"`
	ImplName        string    `json:"impl_name"`
	ImplVersion     int       `json:"impl_version"`
	Timestamp       time.Time `json:"timestamp"`
	Validator       *string   `json:"validator"`
	EventsCount     int       `json:"events_count"`
	ExtrinsicsCount int       `json:"extrinsics_count"`
	CallsCount      int       `json:"calls_count"`
}

type CallArgs

type CallArgs struct {
	Dest  Address `json:"dest"`
	Value string  `json:"value"`
}

type CheckMetadataHash

type CheckMetadataHash struct {
	Mode MetadataMode `json:"mode"`
}

type CheckMortality

type CheckMortality struct {
	Kind string `json:"__kind"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseUrl string, apiKey string) *Client

func (*Client) Get

func (client *Client) Get(ctx context.Context, url string, outputData any) error

func (*Client) GetBlock

func (client *Client) GetBlock(ctx context.Context, height int64) (*Block, error)

func (*Client) GetEvents

func (client *Client) GetEvents(ctx context.Context, ext *Extrinsic) ([]*Event, error)

func (*Client) GetTransaction

func (client *Client) GetTransaction(ctx context.Context, txHash string) (*Extrinsic, error)

type ClientArgs

type ClientArgs struct {
	ApiKey string
}

type DispatchClass

type DispatchClass struct {
	Kind string `json:"__kind"`
}

type DispatchInfo

type DispatchInfo struct {
	Class   DispatchClass `json:"class"`
	PaysFee PaysFee       `json:"paysFee"`
	Weight  Weight        `json:"weight"`
}

type Error

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

type Event

type Event struct {
	ID             string                 `json:"id"`
	ExtrinsicIndex int                    `json:"extrinsic_index"`
	Index          int                    `json:"index"`
	Phase          string                 `json:"phase"`
	Pallet         string                 `json:"pallet"`
	Name           string                 `json:"name"`
	FullName       string                 `json:"full_name"`
	Args           map[string]interface{} `json:"args"`
	BlockNumber    int                    `json:"block_number"`
	ExtrinsicID    string                 `json:"extrinsic_id"`
	CallID         *string                `json:"call_id"`
	Timestamp      time.Time              `json:"timestamp"`
}

func (*Event) GetEvent

func (ev *Event) GetEvent() string

func (*Event) GetModule

func (ev *Event) GetModule() string

func (*Event) GetParam

func (ev *Event) GetParam(name string, index int) (interface{}, bool)

type Extrinsic

type Extrinsic struct {
	Timestamp     time.Time `json:"timestamp"`
	BlockNumber   int64     `json:"block_number"`
	Hash          string    `json:"hash"`
	ID            string    `json:"id"`
	Index         int       `json:"index"`
	Version       int       `json:"version"`
	Signature     Signature `json:"signature"`
	SignerAddress string    `json:"signer_address"`
	Tip           string    `json:"tip"`
	Fee           string    `json:"fee"`
	Success       bool      `json:"success"`
	Error         *string   `json:"error"`
	CallID        string    `json:"call_id"`
	FullName      string    `json:"full_name"`
	CallArgs      CallArgs  `json:"call_args"`
}

type GetBlocksResponse

type GetBlocksResponse struct {
	Pagination Pagination `json:"pagination"`
	Data       []Block    `json:"data"`
}

type GetEventsResponse

type GetEventsResponse struct {
	Pagination Pagination `json:"pagination"`
	Data       []*Event   `json:"data"`
}

type GetExtrinicResponse

type GetExtrinicResponse struct {
	Pagination Pagination  `json:"pagination"`
	Data       []Extrinsic `json:"data"`
}

type InnerSignature

type InnerSignature struct {
	Kind  string `json:"__kind"`
	Value string `json:"value"`
}

type MetadataMode

type MetadataMode struct {
	Kind string `json:"__kind"`
}

type Pagination

type Pagination struct {
	CurrentPage int  `json:"current_page"`
	PerPage     int  `json:"per_page"`
	TotalItems  int  `json:"total_items"`
	TotalPages  int  `json:"total_pages"`
	NextPage    *int `json:"next_page"`
	PrevPage    *int `json:"prev_page"`
}

type PaysFee

type PaysFee struct {
	Kind string `json:"__kind"`
}

type Signature

type Signature struct {
	Address          Address          `json:"address"`
	Signature        InnerSignature   `json:"signature"`
	SignedExtensions SignedExtensions `json:"signedExtensions"`
}

type SignedExtensions

type SignedExtensions struct {
	ChargeTransactionPayment string            `json:"chargeTransactionPayment"`
	CheckMetadataHash        CheckMetadataHash `json:"checkMetadataHash"`
	CheckMortality           CheckMortality    `json:"checkMortality"`
	CheckNonce               int               `json:"checkNonce"`
}

type Weight

type Weight struct {
	ProofSize string `json:"proofSize"`
	RefTime   string `json:"refTime"`
}

Jump to

Keyboard shortcuts

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