subscan

package
v0.0.0-...-15c384e Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetParam

func GetParam[T any](ev *Event, name string) (T, error)

func GetParamAccountId

func GetParamAccountId(ev *Event, name string) ([]byte, error)

func GetParamInt

func GetParamInt(ev *Event, name string) (xc.AmountBlockchain, error)

func Post

func Post(ctx context.Context, url string, inputJson []byte, outputData any, args *ClientArgs) error

Types

type AccountDisplay

type AccountDisplay struct {
	Address string `json:"address"`
}

type ClientArgs

type ClientArgs struct {
	ApiKey  string
	Limiter *rate.Limiter
}

type Error

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

type Event

type Event struct {
	EventIndex     string `json:"event_index"`
	BlockNum       int64  `json:"block_num"`
	ExtrinsicIdx   int    `json:"extrinsic_idx"`
	ModuleID       string `json:"module_id"`
	EventID        string `json:"event_id"`
	Params         string `json:"params"`
	Phase          int    `json:"phase"`
	EventIdx       int    `json:"event_idx"`
	ExtrinsicHash  string `json:"extrinsic_hash"`
	Finalized      bool   `json:"finalized"`
	BlockTimestamp int64  `json:"block_timestamp"`
	// contains filtered or unexported fields
}

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)

func (*Event) ParseParams

func (ev *Event) ParseParams() ([]*Param, error)

type Param

type Param struct {
	Name     string      `json:"name"`
	Type     string      `json:"type"`
	TypeName string      `json:"type_name"`
	Value    interface{} `json:"value"`
}

type SubscanExtrinsicData

type SubscanExtrinsicData struct {
	BlockTimestamp     int64          `json:"block_timestamp"`
	BlockNum           int64          `json:"block_num"`
	ExtrinsicIndex     string         `json:"extrinsic_index"`
	CallModuleFunction string         `json:"call_module_function"`
	CallModule         string         `json:"call_module"`
	AccountID          string         `json:"account_id"`
	Signature          string         `json:"signature"`
	Nonce              int            `json:"nonce"`
	ExtrinsicHash      string         `json:"extrinsic_hash"`
	Success            bool           `json:"success"`
	Params             []Param        `json:"params"`
	Transfer           interface{}    `json:"transfer"` // Assuming it can be null
	Event              []*Event       `json:"event"`
	EventCount         int            `json:"event_count"`
	Fee                string         `json:"fee"`
	FeeUsed            string         `json:"fee_used"`
	Error              interface{}    `json:"error"` // Assuming it can be null
	Finalized          bool           `json:"finalized"`
	Lifetime           interface{}    `json:"lifetime"` // Assuming it can be null
	Tip                string         `json:"tip"`
	AccountDisplay     AccountDisplay `json:"account_display"`
	BlockHash          string         `json:"block_hash"`
	Pending            bool           `json:"pending"`
	SubCalls           interface{}    `json:"sub_calls"` // Assuming it can be null
}

type SubscanExtrinsicResponse

type SubscanExtrinsicResponse struct {
	Code        int                  `json:"code"`
	Message     string               `json:"message"`
	GeneratedAt int64                `json:"generated_at"`
	Data        SubscanExtrinsicData `json:"data"`
}

Jump to

Keyboard shortcuts

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