models

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFromHexToInt added in v1.0.0

func ConvertFromHexToInt(h string) (*int, error)

func GetFieldFromAny added in v1.0.0

func GetFieldFromAny(name string, src any) (any, error)

func GetMessageByIndex added in v1.0.0

func GetMessageByIndex(moduleIdx, errorIdx int, meta *types.MetadataStruct) string

func IsFinalized added in v1.0.2

func IsFinalized(resp *SubscriptionResponse) bool

func VoucherParamsToProto added in v1.0.0

func VoucherParamsToProto(params *VoucherParams) *proto.VoucherParams

Types

type ActiveProgram added in v1.0.2

type ActiveProgram struct {
	CodeId      any `json:"code_id"`
	State       any `json:"state"`
	Gas         any `json:"gas_reservation_map"`
	Mem         any `json:"memory_infix"`
	Block       any `json:"expiration_block"`
	Allocations any `json:"allocations_tree_len"`
}

type BalancesEvent added in v1.0.2

type BalancesEvent struct {
	// Withdraw
	// Deposit
	Who    string
	Amount string
}

type BasicParams added in v1.0.0

type BasicParams struct {
	Result       any    `json:"result"`
	Subscription string `json:"subscription"`
}

type Changes added in v1.0.2

type Changes struct {
	ChangeHash string
}

func GetChangesFromEvents added in v1.0.0

func GetChangesFromEvents(response *SubscriptionResponse) (*Changes, error)

type ChangesResponse added in v1.0.2

type ChangesResponse struct {
	Result       any    `json:"result"`
	Subscription string `json:"subscription"`
}

type Code added in v1.0.2

type Code struct {
	Success string        `json:"success,omitempty"`
	Error   *MessageError `json:"error,omitempty"`
}

type Data added in v0.1.2

type Data struct {
	Free     any `json:"free"`
	Reserved any `json:"reserved"`
	Frozen   any `json:"frozen"`
	Flags    any `json:"flags"`
}

type Details added in v1.0.2

type Details struct {
	Code *Code `json:"code"`
}

type EncodedVoucherIssue added in v1.0.0

type EncodedVoucherIssue struct {
	EncodedCall string `json:"encoded_call"`
}

func EncodedCallFromProto added in v1.0.0

func EncodedCallFromProto(pb *proto.EncodedVoucherIssue) *EncodedVoucherIssue

type Event added in v1.0.0

type Event struct {
	EventID        string                  `json:"event_id"`
	ModuleID       string                  `json:"module_id"`
	EventIndex     int                     `json:"event_idx"`
	ExtrinsicIndex int                     `json:"extrinsic_idx"`
	Params         []scalecodec.EventParam `json:"params"`
}

type ExtrinsicSuccess added in v1.0.3

type ExtrinsicSuccess struct {
	Class   string  `json:"class"`
	PaysFee string  `json:"pays_fee"`
	Weight  *Weight `json:"weight"`
}

type FinalizedResponse added in v1.0.0

type FinalizedResponse struct {
	Finalized string `json:"finalized"`
}

type FrameSystemAccountInfo added in v0.1.2

type FrameSystemAccountInfo struct {
	Nonce       any   `json:"nonce"`
	Consumers   any   `json:"consumers"`
	Provider    any   `json:"providers"`
	Sufficients any   `json:"sufficients"`
	Data        *Data `json:"data"`
}

type GasCalculateResult added in v1.0.2

type GasCalculateResult struct {
	MinLimit      int  `json:"min_limit"`
	Reserved      int  `json:"reserved"`
	Burned        int  `json:"burned"`
	MayBeReturned int  `json:"may_be_returned"`
	Waited        bool `json:"waited"`
}

type InBlockResponse added in v1.0.0

type InBlockResponse struct {
	InBlock string `json:"inBlock"`
}

type Mailbox added in v1.0.3

type Mailbox struct {
	Id          string  `json:"id,omitempty"`
	Source      string  `json:"source,omitempty"`
	Destination string  `json:"destination,omitempty"`
	Payload     string  `json:"payload,omitempty"`
	Value       string  `json:"value,omitempty"`
	Start       float64 `json:"start,omitempty"`
	Finish      float64 `json:"finish,omitempty"`
}

type Message added in v1.0.2

type Message struct {
	Destination string   `json:"destination"`
	Details     *Details `json:"details"`
	To          string   `json:"to"`
	Id          string   `json:"id"`
	Payload     string   `json:"payload"`
	Source      string   `json:"source"`
	Value       any      `json:"value"`
	Exp         any      `json:"exp"`
}

type MessageError added in v1.0.2

type MessageError struct {
	Execution string `json:"execution"`
}

type Program added in v1.0.2

type Program struct {
	Status     string
	Terminated string
	Active     *ActiveProgram `json:"active,omitempty"`
	ProgramId  string
}

func NewProgram added in v1.0.2

func NewProgram(status, programId, terminated string, program *ActiveProgram) *Program

type ResponseError added in v1.0.0

type ResponseError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data"`
}

type Result added in v1.0.2

type Result struct {
	Block  string  `json:"block"`
	Change [][]any `json:"changes"`
}

type RpcGenericRequest

type RpcGenericRequest struct {
	Jsonrpc any    `json:"jsonrpc"`
	Id      any    `json:"id"`
	Method  string `json:"method"`
	Params  any    `json:"params,omitempty"`
}

func (*RpcGenericRequest) MarshalBody

func (rpc *RpcGenericRequest) MarshalBody() ([]byte, error)

type RpcGenericResponse

type RpcGenericResponse struct {
	Jsonrpc string         `json:"jsonrpc"`
	Id      any            `json:"id"`
	Result  any            `json:"result,omitempty"`
	Method  string         `json:"method"`
	Error   map[string]any `json:"error,omitempty"`
}

type SubscriptionResponse added in v1.0.0

type SubscriptionResponse struct {
	Jsonrpc string `json:"jsonrpc"`
	Method  string `json:"method"`
	Params  any    `json:"params,omitempty"`

	Result           any            `json:"result,omitempty"`
	Error            *ResponseError `json:"error,omitempty"`
	SubscriptionHash string
}

type TransactionPaymentEvent added in v1.0.2

type TransactionPaymentEvent struct {
	// TransactionFeePaid
	Who       string
	ActualFee string
	Tip       string
}

type TreasuryEvent added in v1.0.2

type TreasuryEvent struct {
	// UpdatedInactive
	Reactivated string
	Deactivated string

	// Deposit
	Value string
}

type VoucherParams added in v1.0.0

type VoucherParams struct {
	Spender       string `json:"spender"`
	Balance       string `json:"balance"`
	CodeUploading bool   `json:"code_uploading"`
	Duration      int32  `json:"duration"`
}

type Weight added in v1.0.3

type Weight struct {
	ProofSize int `json:"proof_size"`
	RefTime   int `json:"ref_time"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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