types

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 25 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeRegistry     map[string]interface{}
	TypeRegistryLock = &sync.RWMutex{}

	V14Types     = make(map[string]source.TypeStruct)
	V14TypesLock = &sync.RWMutex{}
)
View Source
var KnownOrigins = map[string]string{
	"Council":            "CollectiveOrigin",
	"System":             "SystemOrigin",
	"TechnicalCommittee": "CollectiveOrigin",

	"Xcm":       "XcmOrigin",
	"XcmPallet": "XcmOrigin",

	"Authority":      "AuthorityOrigin",
	"GeneralCouncil": "CollectiveOrigin",
}

https://github.com/polkadot-js/api/blob/ddf6f574f616d28cc0c59354baaf58208a776274/packages/metadata/src/v13/toLatest.ts#L14

Functions

func BigIntToIntBytes added in v1.3.3

func BigIntToIntBytes(i *big.Int, bytelen int) ([]byte, error)

BigIntToIntBytes ref https://github.com/centrifuge/go-substrate-rpc-client/blob/master/types/int.go#L218

func Clean added in v1.7.1

func Clean()

Clean all type registry

func Encode added in v1.1.45

func Encode(typeString string, data interface{}) string

func EncodeWithOpt added in v1.4.9

func EncodeWithOpt(typeString string, data interface{}, opt *ScaleDecoderOption) string

func Eq added in v1.4.5

func Eq(typeString, destTypeString string) bool

Eq check type string is equal

func EqTypeStringWithTypeStruct added in v1.5.14

func EqTypeStringWithTypeStruct(typeString string, dest *source.TypeStruct) bool

func HasReg added in v1.1.44

func HasReg(typeName string) bool

func RegCustomTypes

func RegCustomTypes(registry map[string]source.TypeStruct)

func Reverse added in v1.4.7

func Reverse(b []byte)

func TupleDisassemble added in v1.1.1

func TupleDisassemble(typeString string) []string

Types

type AccountId

type AccountId struct {
	ScaleDecoder
}

func (*AccountId) Encode added in v1.5.0

func (s *AccountId) Encode(value string) string

func (*AccountId) Process

func (s *AccountId) Process()

func (*AccountId) TypeStructString added in v1.5.14

func (s *AccountId) TypeStructString() string

type AdditionalSigned added in v1.1.29

type AdditionalSigned struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type Address

type Address struct {
	ScaleDecoder
	AccountLength string `json:"account_length"`
}

func (*Address) Process

func (a *Address) Process()

type AuthoritiesChange

type AuthoritiesChange struct{ Vec }

func (*AuthoritiesChange) Init

type BTreeMap added in v0.7.7

type BTreeMap struct{ ScaleDecoder }

func (*BTreeMap) Process added in v0.7.7

func (b *BTreeMap) Process()

func (*BTreeMap) TypeStructString added in v1.5.14

func (b *BTreeMap) TypeStructString() string

type BTreeSet added in v1.0.34

type BTreeSet struct{ Vec }

type Balance

type Balance struct {
	U128
	Reader io.Reader
}

func (*Balance) Process

func (b *Balance) Process()

type BitVec

type BitVec struct {
	Compact
}

func (*BitVec) Process

func (b *BitVec) Process()

func (*BitVec) TypeStructString added in v1.5.14

func (b *BitVec) TypeStructString() string

type BlockNumber

type BlockNumber struct {
	U32
}

type Bool

type Bool struct {
	ScaleDecoder
}

func (*Bool) Encode added in v1.3.3

func (b *Bool) Encode(value bool) string

func (*Bool) Process

func (b *Bool) Process()

func (*Bool) TypeStructString added in v1.5.14

func (b *Bool) TypeStructString() string

type BoundedVec added in v1.0.26

type BoundedVec struct {
	Vec
}

func (*BoundedVec) Init added in v1.0.26

func (v *BoundedVec) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

Init BoundedVec<Type, Size> to Vec<Type> https://github.com/paritytech/substrate/pull/8556

type Box added in v1.0.32

type Box struct{ ScaleDecoder }

func (*Box) Process added in v1.0.32

func (b *Box) Process()

type BoxCall added in v1.4.7

type BoxCall struct {
	CallIndex string           `json:"call_Index"`
	Params    []ExtrinsicParam `json:"params"`
}

type BoxProposal

type BoxProposal struct {
	Call
}

type Bytes

type Bytes struct{ ScaleDecoder }

func (*Bytes) Encode added in v1.3.3

func (b *Bytes) Encode(value string) string

func (*Bytes) Process

func (b *Bytes) Process()

func (*Bytes) TypeStructString added in v1.5.14

func (b *Bytes) TypeStructString() string

type Call

type Call struct {
	ScaleDecoder
}

func (*Call) Encode added in v1.4.7

func (s *Call) Encode(value interface{}) string

func (*Call) Process

func (s *Call) Process()

func (*Call) TypeStructString added in v1.5.14

func (s *Call) TypeStructString() string

type CallIndex

type CallIndex struct {
	Module MetadataModules `json:"module"`
	Call   MetadataCalls   `json:"call"`
}

type ChangesList added in v1.5.14

type ChangesList struct {
	New     []string         `json:"new,omitempty"`
	Changes []CompareChanges `json:"changes,omitempty"`
}

type ChangesTrieRoot

type ChangesTrieRoot struct{ HexBytes }

type Compact

type Compact struct {
	ScaleDecoder
	CompactLength int    `json:"compact_length"`
	CompactBytes  []byte `json:"compact_bytes"`
}

func (*Compact) Encode added in v1.4.7

func (c *Compact) Encode(value interface{}) string

func (*Compact) Process

func (c *Compact) Process()

func (*Compact) ProcessCompactBytes

func (c *Compact) ProcessCompactBytes()

func (*Compact) TypeStructString added in v1.5.14

func (c *Compact) TypeStructString() string

type CompactMoment added in v1.0.67

type CompactMoment struct {
	CompactU32
}

func (*CompactMoment) Process added in v1.0.67

func (m *CompactMoment) Process()

type CompactU32

type CompactU32 struct {
	Compact
	Reader io.Reader
}

func (*CompactU32) Encode

func (c *CompactU32) Encode(value interface{}) string

func (*CompactU32) Init

func (c *CompactU32) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

func (*CompactU32) Process

func (c *CompactU32) Process()

func (*CompactU32) TypeStructString added in v1.5.14

func (c *CompactU32) TypeStructString() string

type CompareChanges added in v1.5.14

type CompareChanges struct {
	Prev    string `json:"prev"`
	Current string `json:"next"`
}

type Consensus

type Consensus struct{ Struct }

func (*Consensus) Init

func (s *Consensus) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

type CustomMetadata added in v1.7.4

type CustomMetadata struct {
	Map []map[string]CustomValueMetadata `json:"map"`
}

type CustomMetadataV15 added in v1.7.4

type CustomMetadataV15 struct{ ScaleDecoder }

func (*CustomMetadataV15) Process added in v1.7.4

func (c *CustomMetadataV15) Process()

type CustomValueMetadata added in v1.7.4

type CustomValueMetadata struct {
	Value string `json:"value"`
	Type  int    `json:"type"`
}

type Data

type Data struct {
	Enum
}

func (*Data) Encode added in v1.3.3

func (d *Data) Encode(v map[string]interface{}) string

func (*Data) Init

func (d *Data) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

func (*Data) Process

func (d *Data) Process()

type EcdsaSignature

type EcdsaSignature struct {
	ScaleDecoder
}

func (*EcdsaSignature) Process

func (e *EcdsaSignature) Process()

type Empty added in v1.4.2

type Empty struct{ ScaleDecoder }

func (*Empty) Process added in v1.4.2

func (e *Empty) Process()

type Enum

type Enum struct {
	ScaleDecoder
	ValueList []string `json:"value_list"`
	Index     int      `json:"index"`
}

func (*Enum) Encode added in v1.1.45

func (e *Enum) Encode(data interface{}) string

func (*Enum) Init

func (e *Enum) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

func (*Enum) Process

func (e *Enum) Process()

func (*Enum) TypeStructString added in v1.5.14

func (e *Enum) TypeStructString() string

func (*Enum) WithValueList added in v1.3.3

func (e *Enum) WithValueList(valueList []string) *Enum

type Era

type Era struct {
	ScaleDecoder
}

func (*Era) Encode added in v1.6.0

func (e *Era) Encode(era string) string

func (*Era) Process

func (e *Era) Process()

type EraExtrinsic

type EraExtrinsic struct{ Era }

type EthereumAddress

type EthereumAddress struct {
	ScaleDecoder
}

func (*EthereumAddress) Process

func (e *EthereumAddress) Process()

type EventIndex

type EventIndex struct {
	Module MetadataModules `json:"module"`
	Call   MetadataEvents  `json:"call"`
}

type Exposure

type Exposure struct{ Struct }

func (*Exposure) Init

func (s *Exposure) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

type ExtrinsicMetadata added in v1.0.11

type ExtrinsicMetadata struct {
	Type             int                `json:"type,omitempty"`
	Version          int                `json:"version"`
	AddressType      int                `json:"addressType,omitempty"`
	CallType         int                `json:"callType,omitempty"`
	SignatureType    int                `json:"signatureType,omitempty"`
	ExtraType        int                `json:"extraType,omitempty"`
	SignedExtensions []SignedExtensions `json:"signedExtensions"`
	SignedIdentifier []string           `json:"signed_identifier"`
}

type ExtrinsicMetadataV12 added in v1.1.1

type ExtrinsicMetadataV12 struct {
	SignedExtensions []string `json:"signedExtensions"`
}

type ExtrinsicParam

type ExtrinsicParam struct {
	Name  string      `json:"name"`
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

type FixedArray added in v1.3.3

type FixedArray struct {
	ScaleDecoder
	FixedLength int
	SubType     string
}

func (*FixedArray) Encode added in v1.3.3

func (f *FixedArray) Encode(value interface{}) string

func (*FixedArray) Init added in v1.3.3

func (f *FixedArray) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

func (*FixedArray) Process added in v1.3.3

func (f *FixedArray) Process()

func (*FixedArray) TypeStructString added in v1.5.14

func (f *FixedArray) TypeStructString() string

type FixedU8 added in v1.3.3

type FixedU8 struct {
	ScaleDecoder
	FixedLength int
}

func (*FixedU8) Encode added in v1.3.3

func (s *FixedU8) Encode(value interface{}) string

func (*FixedU8) Process added in v1.3.3

func (s *FixedU8) Process()

func (*FixedU8) TypeStructString added in v1.5.14

func (s *FixedU8) TypeStructString() string

type Float added in v1.3.3

type Float struct {
	ScaleDecoder
}

type Float32 added in v1.3.3

type Float32 struct {
	Float
}

func (*Float32) Init added in v1.3.3

func (f *Float32) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

func (*Float32) Process added in v1.3.3

func (f *Float32) Process()

func (*Float32) TypeStructString added in v1.5.14

func (f *Float32) TypeStructString() string

type Float64 added in v1.3.3

type Float64 struct {
	Float
}

func (*Float64) Init added in v1.3.3

func (f *Float64) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

func (*Float64) Process added in v1.3.3

func (f *Float64) Process()

func (*Float64) TypeStructString added in v1.5.14

func (f *Float64) TypeStructString() string

type GenericAddress

type GenericAddress struct {
	ScaleDecoder
	AccountLength string `json:"account_length"`
}

func (*GenericAddress) Process

func (a *GenericAddress) Process()

type GenericLookupSource added in v0.7.5

type GenericLookupSource struct {
	ScaleDecoder
}

func (*GenericLookupSource) Process added in v0.7.5

func (g *GenericLookupSource) Process()

type H160

type H160 struct{ ScaleDecoder }

func (*H160) Encode added in v1.2.5

func (h *H160) Encode(value string) string

func (*H160) Process

func (h *H160) Process()

func (*H160) TypeStructString added in v1.5.14

func (h *H160) TypeStructString() string

type H256

type H256 struct {
	ScaleDecoder
}

func (*H256) Encode added in v1.3.3

func (h *H256) Encode(value string) string

func (*H256) Process

func (h *H256) Process()

func (*H256) TypeStructString added in v1.5.14

func (h *H256) TypeStructString() string

type H512

type H512 struct {
	ScaleDecoder
}

func (*H512) Encode added in v1.3.3

func (h *H512) Encode(value string) string

func (*H512) Process

func (h *H512) Process()

func (*H512) TypeStructString added in v1.5.14

func (h *H512) TypeStructString() string

type HexBytes

type HexBytes struct{ ScaleDecoder }

func (*HexBytes) Encode added in v1.3.3

func (h *HexBytes) Encode(value string) string

func (*HexBytes) Process

func (h *HexBytes) Process()

func (*HexBytes) TypeStructString added in v1.5.14

func (h *HexBytes) TypeStructString() string

type IScaleDecoder

type IScaleDecoder interface {
	Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)
	Process()
	Encode(interface{}) string

	TypeStructString() string
}

type IndividualExposure

type IndividualExposure struct{ Struct }

func (*IndividualExposure) Init

type IntFixed

type IntFixed struct {
	ScaleDecoder
	FixedLength int
	Reader      io.Reader
}

func (*IntFixed) Encode added in v1.3.3

func (f *IntFixed) Encode(value interface{}) string

func (*IntFixed) Init

func (f *IntFixed) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

func (*IntFixed) Process

func (f *IntFixed) Process()

func (*IntFixed) TypeStructString added in v1.5.14

func (f *IntFixed) TypeStructString() string

type LockIdentifier

type LockIdentifier struct {
	ScaleDecoder
}

func (*LockIdentifier) Process

func (l *LockIdentifier) Process()

type LogDigest

type LogDigest struct{ Enum }

func (*LogDigest) Init

func (l *LogDigest) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

func (*LogDigest) Process

func (l *LogDigest) Process()

type MapType

type MapType struct {
	Key        string `json:"key"`
	Key2       string `json:"key2,omitempty"`
	Hasher     string `json:"hasher"`
	Key2Hasher string `json:"key2Hasher,omitempty"`
	Value      string `json:"value"`
	IsLinked   bool   `json:"isLinked"`
}

type MapTypeValue added in v1.1.1

type MapTypeValue struct {
	Key        int    `json:"key"`
	Key2       int    `json:"key2,omitempty"`
	Hasher     string `json:"hasher"`
	Key2Hasher string `json:"key2Hasher,omitempty"`
	Value      int    `json:"value"`
}

type MetadataCalls

type MetadataCalls struct {
	Lookup      string                       `json:"lookup"`
	Name        string                       `json:"name"`
	Docs        []string                     `json:"docs"`
	Args        []MetadataModuleCallArgument `json:"args"`
	LookupIndex int                          `json:"-"`
}

type MetadataCompareResult added in v1.5.14

type MetadataCompareResult struct {
	NewModules    []string                 `json:"new_modules,omitempty"`
	ModuleChanges map[string]ModuleChanges `json:"module_changes"`
}

type MetadataConstants

type MetadataConstants struct {
	Name           string   `json:"name"`
	Type           string   `json:"type"`
	TypeValue      int      `json:"type_value"`
	ConstantsValue string   `json:"constants_value"`
	Docs           []string `json:"docs"`
}

type MetadataEvents

type MetadataEvents struct {
	Lookup       string   `json:"lookup"`
	Name         string   `json:"name"`
	Docs         []string `json:"docs"`
	Args         []string `json:"args"`
	ArgsName     []string `json:"args_name,omitempty"`
	ArgsTypeName []string `json:"args_type_name,omitempty"`
}

type MetadataModuleCall

type MetadataModuleCall struct {
	ScaleDecoder
	Name string                       `json:"name"`
	Args []MetadataModuleCallArgument `json:"args"`
	Docs []string                     `json:"docs"`
}

func (*MetadataModuleCall) Process

func (m *MetadataModuleCall) Process()

type MetadataModuleCallArgument

type MetadataModuleCallArgument struct {
	ScaleDecoder
	Name     string `json:"name"`
	Type     string `json:"type"`
	TypeName string `json:"type_name,omitempty"`
}

func (*MetadataModuleCallArgument) Process

func (m *MetadataModuleCallArgument) Process()

type MetadataModuleError

type MetadataModuleError struct {
	ScaleDecoder `json:"-"`
	Name         string             `json:"name"`
	Doc          []string           `json:"doc"`
	Fields       []ModuleErrorField `json:"fields,omitempty"`
}

func (*MetadataModuleError) Init

func (*MetadataModuleError) Process

func (m *MetadataModuleError) Process()

type MetadataModuleEvent

type MetadataModuleEvent struct {
	ScaleDecoder
	Name string   `json:"name"`
	Docs []string `json:"docs"`
	Args []string `json:"args"`
}

func (*MetadataModuleEvent) Process

func (m *MetadataModuleEvent) Process()

type MetadataModules

type MetadataModules struct {
	Name        string                `json:"name"`
	Prefix      string                `json:"prefix"`
	Storage     []MetadataStorage     `json:"storage"`
	Calls       []MetadataCalls       `json:"calls,omitempty"`
	CallsValue  *PalletLookUp         `json:"calls_value,omitempty"`
	Events      []MetadataEvents      `json:"events,omitempty"`
	EventsValue *PalletLookUp         `json:"events_value,omitempty"`
	Constants   []MetadataConstants   `json:"constants,omitempty"`
	Errors      []MetadataModuleError `json:"errors"`
	ErrorsValue *PalletLookUp         `json:"errors_value"`
	Index       int                   `json:"index"`
}

type MetadataStorage

type MetadataStorage struct {
	Name     string      `json:"name"`
	Modifier string      `json:"modifier"`
	Type     StorageType `json:"type"`
	Fallback string      `json:"fallback"`
	Docs     []string    `json:"docs"`
	Hasher   string      `json:"hasher,omitempty"`
}

type MetadataStruct

type MetadataStruct struct {
	MetadataVersion int                   `json:"metadata_version"`
	Metadata        MetadataTag           `json:"metadata"`
	CallIndex       map[string]CallIndex  `json:"call_index"`
	EventIndex      map[string]EventIndex `json:"event_index"`
	Extrinsic       *ExtrinsicMetadata    `json:"extrinsic"`
	Type            *int                  `json:"type,omitempty"`
	Apis            []RuntimeApiMetadata  `json:"apis,omitempty"`
	OuterEnums      *OuterEnumsMetadata   `json:"outer_enums,omitempty"`
	Customer        *CustomMetadata       `json:"customer,omitempty"`
}

type MetadataTag

type MetadataTag struct {
	Modules []MetadataModules `json:"modules"`
}

func (*MetadataTag) Compare added in v1.5.14

func (m *MetadataTag) Compare(dest *MetadataTag) *MetadataCompareResult

type MetadataV10Decoder

type MetadataV10Decoder struct {
	ScaleDecoder
}

func (*MetadataV10Decoder) Init

func (*MetadataV10Decoder) Process

func (m *MetadataV10Decoder) Process()

type MetadataV11Decoder

type MetadataV11Decoder struct {
	ScaleDecoder
}

func (*MetadataV11Decoder) Init

func (*MetadataV11Decoder) Process

func (m *MetadataV11Decoder) Process()

type MetadataV12Decoder added in v0.6.0

type MetadataV12Decoder struct {
	ScaleDecoder
}

func (*MetadataV12Decoder) Init added in v0.6.0

func (*MetadataV12Decoder) Process added in v0.6.0

func (m *MetadataV12Decoder) Process()

type MetadataV12Module added in v0.6.0

type MetadataV12Module struct {
	ScaleDecoder
	Name       string                   `json:"name"`
	Prefix     string                   `json:"prefix"`
	CallIndex  string                   `json:"call_index"`
	HasStorage bool                     `json:"has_storage"`
	Storage    []MetadataStorage        `json:"storage"`
	HasCalls   bool                     `json:"has_calls"`
	Calls      []MetadataModuleCall     `json:"calls"`
	HasEvents  bool                     `json:"has_events"`
	Events     []MetadataEvents         `json:"events"`
	Constants  []map[string]interface{} `json:"constants"`
	Errors     []MetadataModuleError    `json:"errors"`
	Index      int                      `json:"index"`
}

func (*MetadataV12Module) Process added in v0.6.0

func (m *MetadataV12Module) Process()

type MetadataV13Decoder added in v1.0.28

type MetadataV13Decoder struct {
	ScaleDecoder
}

func (*MetadataV13Decoder) Init added in v1.0.28

func (*MetadataV13Decoder) Process added in v1.0.28

func (m *MetadataV13Decoder) Process()

type MetadataV13Module added in v1.0.28

type MetadataV13Module struct {
	ScaleDecoder
	Name       string                   `json:"name"`
	Prefix     string                   `json:"prefix"`
	CallIndex  string                   `json:"call_index"`
	HasStorage bool                     `json:"has_storage"`
	Storage    []MetadataStorage        `json:"storage"`
	HasCalls   bool                     `json:"has_calls"`
	Calls      []MetadataModuleCall     `json:"calls"`
	HasEvents  bool                     `json:"has_events"`
	Events     []MetadataEvents         `json:"events"`
	Constants  []map[string]interface{} `json:"constants"`
	Errors     []MetadataModuleError    `json:"errors"`
	Index      int                      `json:"index"`
}

func (*MetadataV13Module) Process added in v1.0.28

func (m *MetadataV13Module) Process()

type MetadataV13ModuleStorage added in v1.0.28

type MetadataV13ModuleStorage struct {
	MetadataV6ModuleStorage
	Prefix string            `json:"prefix"`
	Items  []MetadataStorage `json:"items"`
}

func (*MetadataV13ModuleStorage) Process added in v1.0.28

func (m *MetadataV13ModuleStorage) Process()

type MetadataV13ModuleStorageEntry added in v1.0.28

type MetadataV13ModuleStorageEntry struct {
	ScaleDecoder
	Name     string      `json:"name"`
	Modifier string      `json:"modifier"`
	Type     StorageType `json:"type"`
	Fallback string      `json:"fallback"`
	Docs     []string    `json:"docs"`
	Hasher   string      `json:"hasher"`
}

func (*MetadataV13ModuleStorageEntry) Init added in v1.0.28

func (*MetadataV13ModuleStorageEntry) Process added in v1.0.28

func (m *MetadataV13ModuleStorageEntry) Process()

type MetadataV14Decoder added in v1.1.1

type MetadataV14Decoder struct {
	ScaleDecoder
}

func (*MetadataV14Decoder) Process added in v1.1.1

func (m *MetadataV14Decoder) Process()

type MetadataV14Module added in v1.1.1

type MetadataV14Module struct {
	ScaleDecoder
	Name        string                 `json:"name"`
	Prefix      string                 `json:"prefix"`
	CallIndex   string                 `json:"call_index"`
	HasStorage  bool                   `json:"has_storage"`
	Storage     []MetadataStorage      `json:"storage"`
	HasCalls    bool                   `json:"has_calls"`
	Calls       []MetadataModuleCall   `json:"calls"`
	CallsValue  map[string]interface{} `json:"calls_value"`
	HasEvents   bool                   `json:"has_events"`
	Events      []MetadataEvents       `json:"events"`
	EventsValue map[string]interface{} `json:"events_value"`
	Constants   []MetadataConstants    `json:"constants"`
	Errors      []MetadataModuleError  `json:"errors"`
	ErrorsValue map[string]interface{} `json:"errors_value"`
	Index       int                    `json:"index"`
}

func (*MetadataV14Module) Process added in v1.1.1

func (m *MetadataV14Module) Process()

type MetadataV14ModuleStorage added in v1.1.1

type MetadataV14ModuleStorage struct {
	ScaleDecoder
	Prefix string            `json:"prefix"`
	Items  []MetadataStorage `json:"items"`
}

func (*MetadataV14ModuleStorage) Process added in v1.1.1

func (m *MetadataV14ModuleStorage) Process()

type MetadataV14ModuleStorageEntry added in v1.1.1

type MetadataV14ModuleStorageEntry struct {
	ScaleDecoder
	Name     string      `json:"name"`
	Modifier string      `json:"modifier"`
	Type     StorageType `json:"type"`
	Fallback string      `json:"fallback"`
	Docs     []string    `json:"docs"`
	Hasher   string      `json:"hasher"`
}

func (*MetadataV14ModuleStorageEntry) Process added in v1.1.1

func (m *MetadataV14ModuleStorageEntry) Process()

type MetadataV15Decoder added in v1.7.0

type MetadataV15Decoder struct {
	ScaleDecoder
}

func (*MetadataV15Decoder) Process added in v1.7.0

func (m *MetadataV15Decoder) Process()

type MetadataV15Module added in v1.7.0

type MetadataV15Module struct {
	MetadataV14Module
	Docs []string `json:"docs"`
}

func (*MetadataV15Module) Process added in v1.7.0

func (m *MetadataV15Module) Process()

type MetadataV6Decoder

type MetadataV6Decoder struct {
	ScaleDecoder
}

func (*MetadataV6Decoder) Init

func (*MetadataV6Decoder) Process

func (m *MetadataV6Decoder) Process()

type MetadataV6Module

type MetadataV6Module struct {
	ScaleDecoder
	Name       string                   `json:"name"`
	Prefix     string                   `json:"prefix"`
	CallIndex  string                   `json:"call_index"`
	HasStorage bool                     `json:"has_storage"`
	Storage    []MetadataStorage        `json:"storage"`
	HasCalls   bool                     `json:"has_calls"`
	Calls      []MetadataModuleCall     `json:"calls"`
	HasEvents  bool                     `json:"has_events"`
	Events     []MetadataEvents         `json:"events"`
	Constants  []map[string]interface{} `json:"constants"`
}

func (*MetadataV6Module) GetIdentifier

func (m *MetadataV6Module) GetIdentifier() string

func (*MetadataV6Module) Process

func (m *MetadataV6Module) Process()

type MetadataV6ModuleConstants

type MetadataV6ModuleConstants struct {
	ScaleDecoder
	Name           string   `json:"name"`
	Type           string   `json:"type"`
	ConstantsValue string   `json:"constants_value"`
	Docs           []string `json:"docs"`
}

func (*MetadataV6ModuleConstants) Process

func (m *MetadataV6ModuleConstants) Process()

type MetadataV6ModuleStorage

type MetadataV6ModuleStorage struct {
	ScaleDecoder
	Name     string                 `json:"name"`
	Modifier string                 `json:"modifier"`
	Type     map[string]interface{} `json:"type"`
	Fallback string                 `json:"fallback"`
	Docs     []string               `json:"docs"`
	Hasher   string                 `json:"hasher"`
}

func (*MetadataV6ModuleStorage) Init

func (*MetadataV6ModuleStorage) Process

func (m *MetadataV6ModuleStorage) Process()

type MetadataV7Decoder

type MetadataV7Decoder struct {
	ScaleDecoder
}

func (*MetadataV7Decoder) Init

func (*MetadataV7Decoder) Process

func (m *MetadataV7Decoder) Process()

type MetadataV7Module

type MetadataV7Module struct {
	ScaleDecoder
	Name       string                   `json:"name"`
	Prefix     string                   `json:"prefix"`
	CallIndex  string                   `json:"call_index"`
	HasStorage bool                     `json:"has_storage"`
	Storage    []MetadataStorage        `json:"storage"`
	HasCalls   bool                     `json:"has_calls"`
	Calls      []MetadataModuleCall     `json:"calls"`
	HasEvents  bool                     `json:"has_events"`
	Events     []MetadataEvents         `json:"events"`
	Constants  []map[string]interface{} `json:"constants"`
}

func (*MetadataV7Module) Process

func (m *MetadataV7Module) Process()

type MetadataV7ModuleConstants

type MetadataV7ModuleConstants struct {
	MetadataV6ModuleConstants
}

type MetadataV7ModuleStorage

type MetadataV7ModuleStorage struct {
	MetadataV6ModuleStorage
	Prefix string            `json:"prefix"`
	Items  []MetadataStorage `json:"items"`
}

func (*MetadataV7ModuleStorage) Process

func (m *MetadataV7ModuleStorage) Process()

type MetadataV7ModuleStorageEntry

type MetadataV7ModuleStorageEntry struct {
	ScaleDecoder
	Name     string      `json:"name"`
	Modifier string      `json:"modifier"`
	Type     StorageType `json:"type"`
	Fallback string      `json:"fallback"`
	Docs     []string    `json:"docs"`
	Hasher   string      `json:"hasher"`
}

func (*MetadataV7ModuleStorageEntry) Init

func (*MetadataV7ModuleStorageEntry) Process

func (m *MetadataV7ModuleStorageEntry) Process()

type MetadataV8Decoder

type MetadataV8Decoder struct {
	ScaleDecoder
}

func (*MetadataV8Decoder) Init

func (*MetadataV8Decoder) Process

func (m *MetadataV8Decoder) Process()

type MetadataV8Module

type MetadataV8Module struct {
	ScaleDecoder
	Name       string                   `json:"name"`
	Prefix     string                   `json:"prefix"`
	CallIndex  string                   `json:"call_index"`
	HasStorage bool                     `json:"has_storage"`
	Storage    []MetadataStorage        `json:"storage"`
	HasCalls   bool                     `json:"has_calls"`
	Calls      []MetadataModuleCall     `json:"calls"`
	HasEvents  bool                     `json:"has_events"`
	Events     []MetadataEvents         `json:"events"`
	Constants  []map[string]interface{} `json:"constants"`
	Errors     []MetadataModuleError    `json:"errors"`
}

func (*MetadataV8Module) GetIdentifier

func (m *MetadataV8Module) GetIdentifier() string

func (*MetadataV8Module) Process

func (m *MetadataV8Module) Process()

type MetadataV9Decoder

type MetadataV9Decoder struct {
	ScaleDecoder
}

func (*MetadataV9Decoder) Init

func (*MetadataV9Decoder) Process

func (m *MetadataV9Decoder) Process()

type ModuleChanges added in v1.5.14

type ModuleChanges struct {
	Calls  *ChangesList `json:"calls,omitempty"`
	Events *ChangesList `json:"events,omitempty"`
}

type ModuleErrorField added in v1.7.0

type ModuleErrorField struct {
	Type     string   `json:"type"`
	TypeName string   `json:"type_name"`
	Doc      []string `json:"doc"`
}

type Moment

type Moment struct {
	U64
}

func (*Moment) Process

func (m *Moment) Process()

type NMapType added in v1.0.28

type NMapType struct {
	Hashers []string `json:"hashers"`
	KeyVec  []string `json:"key_vec"`
	Value   string   `json:"value"`
	KeysId  int      `json:"keys_id"`
	ValueId int      `json:"value_id"`
}

type Null

type Null struct{ ScaleDecoder }

func (*Null) TypeStructString added in v1.5.14

func (*Null) TypeStructString() string

type OpaqueCall

type OpaqueCall struct {
	Bytes
}

func (*OpaqueCall) Process

func (f *OpaqueCall) Process()

type Option

type Option struct {
	ScaleDecoder
}

func (*Option) Encode added in v1.3.3

func (o *Option) Encode(value interface{}) string

func (*Option) Process

func (o *Option) Process()

func (*Option) TypeStructString added in v1.5.14

func (o *Option) TypeStructString() string

type OriginCaller added in v1.0.57

type OriginCaller struct {
	Name  string
	Index int
}

type Other

type Other struct{ HexBytes }

type OuterEnumsMetadata added in v1.7.4

type OuterEnumsMetadata struct {
	CallType  int `json:"callType"`
	EventType int `json:"eventType"`
	ErrorType int `json:"errorType"`
}

type OuterEnumsMetadataV15 added in v1.7.4

type OuterEnumsMetadataV15 struct{ ScaleDecoder }

func (*OuterEnumsMetadataV15) Process added in v1.7.4

func (o *OuterEnumsMetadataV15) Process()

type PalletConstantMetadataV14 added in v1.1.1

type PalletConstantMetadataV14 struct {
	ScaleDecoder
	Name           string   `json:"name"`
	Type           string   `json:"type"`
	ConstantsValue string   `json:"constants_value"`
	Docs           []string `json:"docs"`
}

func (*PalletConstantMetadataV14) Process added in v1.1.1

func (m *PalletConstantMetadataV14) Process()

type PalletLookUp added in v1.1.1

type PalletLookUp struct {
	Type int `json:"type"`
}

type PortableType added in v1.1.1

type PortableType struct {
	Id   int    `json:"id"`
	Type SiType `json:"type"`
}

type PreRuntime

type PreRuntime struct{ Struct }

func (*PreRuntime) Init

func (s *PreRuntime) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

type Range added in v1.1.27

type Range struct{ ScaleDecoder }

func (*Range) Process added in v1.1.27

func (r *Range) Process()

type RangeInclusive added in v1.1.27

type RangeInclusive struct{ Range }

type RawAuraPreDigest

type RawAuraPreDigest struct{ Struct }

func (*RawAuraPreDigest) Init

type RawBabePreDigestPrimary

type RawBabePreDigestPrimary struct{ Struct }

func (*RawBabePreDigestPrimary) Init

type RawBabePreDigestSecondary

type RawBabePreDigestSecondary struct{ Struct }

func (*RawBabePreDigestSecondary) Init

type RawBabePreDigestSecondaryVRF

type RawBabePreDigestSecondaryVRF struct{ Struct }

func (*RawBabePreDigestSecondaryVRF) Init

type Result added in v1.3.3

type Result struct {
	ScaleDecoder
}

func (*Result) Encode added in v1.3.3

func (b *Result) Encode(value map[string]interface{}) string

func (*Result) Process added in v1.3.3

func (b *Result) Process()

func (*Result) TypeStructString added in v1.5.14

func (b *Result) TypeStructString() string

type RuntimeApiMetadata added in v1.7.0

type RuntimeApiMetadata struct {
	Name    string                     `json:"name"`
	Methods []RuntimeApiMethodMetadata `json:"methods"`
	Docs    []string                   `json:"docs"`
}

type RuntimeApiMetadataV15 added in v1.7.0

type RuntimeApiMetadataV15 struct {
	ScaleDecoder
}

func (*RuntimeApiMetadataV15) Process added in v1.7.0

func (m *RuntimeApiMetadataV15) Process()

Process

"RuntimeApiMetadataV15": {
   "name": "Text",
   "methods": "Vec<RuntimeApiMethodMetadataV15>",
   "docs": "Vec<Text>"
 }

type RuntimeApiMethodMetadata added in v1.7.0

type RuntimeApiMethodMetadata struct {
	Name      string                          `json:"name"`
	Inputs    []RuntimeApiMethodParamMetadata `json:"inputs"`
	OutputsId int                             `json:"outputsId"`
	Outputs   string                          `json:"outputs"`
	Docs      []string                        `json:"docs"`
}

type RuntimeApiMethodMetadataV15 added in v1.7.0

type RuntimeApiMethodMetadataV15 struct {
	ScaleDecoder
}

func (*RuntimeApiMethodMetadataV15) Process added in v1.7.0

func (r *RuntimeApiMethodMetadataV15) Process()

type RuntimeApiMethodParamMetadata added in v1.7.0

type RuntimeApiMethodParamMetadata struct {
	Name   string `json:"name"`
	TypeId int    `json:"typeId"`
	Type   string `json:"type"`
}

type RuntimeApiMethodParamMetadataV15 added in v1.7.0

type RuntimeApiMethodParamMetadataV15 struct {
	ScaleDecoder
}

func (*RuntimeApiMethodParamMetadataV15) Process added in v1.7.0

func (r *RuntimeApiMethodParamMetadataV15) Process()

Process

"RuntimeApiMethodParamMetadataV15": {
   "name": "Text",
   "type": "SiLookupTypeId"
 },

type RuntimeEnvironmentUpdated added in v1.1.10

type RuntimeEnvironmentUpdated struct{ Null }

type RuntimeType

type RuntimeType struct {
	Module string
}

func (*RuntimeType) GetCodecClass added in v1.3.3

func (r *RuntimeType) GetCodecClass(typeString string, spec int) (reflect.Type, reflect.Value, string)

type ScaleDecoder

type ScaleDecoder struct {
	Data             scaleBytes.ScaleBytes `json:"-"`
	TypeString       string                `json:"-"`
	SubType          string                `json:"-"`
	Value            interface{}           `json:"-"`
	RawValue         string                `json:"-"`
	TypeMapping      *TypeMapping          `json:"-"`
	Metadata         *MetadataStruct       `json:"-"`
	Spec             int                   `json:"-"`
	Module           string                `json:"-"`
	DuplicateName    map[string]int        `json:"-"`
	TypeName         string                `json:"-"`
	RegisteredSiType map[int]string        `json:"-"`
	InternalCall     []string              `json:"-"`
	RecursiveTime    int                   `json:"-"`
}

func (*ScaleDecoder) Encode added in v1.1.45

func (s *ScaleDecoder) Encode(interface{}) string

func (*ScaleDecoder) GetNextU8

func (s *ScaleDecoder) GetNextU8() int

func (*ScaleDecoder) Init

func (s *ScaleDecoder) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

func (*ScaleDecoder) NextBytes

func (s *ScaleDecoder) NextBytes(length int) []byte

func (*ScaleDecoder) Process

func (s *ScaleDecoder) Process()

func (*ScaleDecoder) ProcessAndUpdateData

func (s *ScaleDecoder) ProcessAndUpdateData(typeString string) interface{}

func (*ScaleDecoder) TypeStructString added in v1.5.14

func (s *ScaleDecoder) TypeStructString() string

TypeStructString Type Struct string

type ScaleDecoderOption

type ScaleDecoderOption struct {
	Spec             int
	SubType          string
	Module           string
	ValueList        []string
	Metadata         *MetadataStruct
	FixedLength      int
	SignedExtensions []SignedExtension `json:"signed_extensions"`
	AdditionalCheck  []string
	TypeName         string
	// contains filtered or unexported fields
}

type ScaleInfo added in v1.5.9

type ScaleInfo struct {
	*ScaleDecoder
	PathPrefix string
	V14        bool
}

func (*ScaleInfo) ProcessSiType added in v1.5.9

func (s *ScaleInfo) ProcessSiType(id2Portable map[int]SiType)

type Seal

type Seal struct{ Struct }

func (*Seal) Init

func (s *Seal) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

type SealV0

type SealV0 struct{ Struct }

func (*SealV0) Init

func (s *SealV0) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

type Set

type Set struct {
	ScaleDecoder
	SetValue  int
	ValueList []string
	BitLength int
}

func (*Set) Init

func (s *Set) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

func (*Set) Process

func (s *Set) Process()

type SiField added in v1.1.1

type SiField struct {
	Name     string   `json:"name,omitempty"`
	Type     int      `json:"type"`
	TypeName string   `json:"typeName"`
	Docs     []string `json:"docs"`
}

type SiType added in v1.1.1

type SiType struct {
	Path   []string          `json:"path"`
	Params []SiTypeParameter `json:"params,omitempty"`
	Def    SiTypeDef         `json:"def"`
	Docs   []string          `json:"docs"`
}

func (*SiType) FindParameter added in v1.1.42

func (s *SiType) FindParameter(name string) *SiTypeParameter

type SiTypeDef added in v1.1.1

type SiTypeDef struct {
	Composite      *SiTypeDefComposite   `json:"Composite,omitempty"`
	Variant        *SiTypeDefVariant     `json:"Variant,omitempty"`
	Sequence       *SiTypeDefSequence    `json:"Sequence,omitempty"`
	Array          *SiTypeDefArray       `json:"Array,omitempty"`
	Tuple          *SiTypeDefTuple       `json:"Tuple,omitempty"`
	Primitive      *SiTypeDefPrimitive   `json:"Primitive,omitempty"`
	Compact        *SiTypeDefCompact     `json:"Compact,omitempty"`
	BitSequence    *SiTypeDefBitSequence `json:"BitSequence,omitempty"`
	SiTypeDefRange *SiTypeDefRange       `json:"Range,omitempty"`
	// HistoricMetaCompat compatibility
	HistoricMetaCompat string `json:"HistoricMetaCompat,omitempty"`
}

type SiTypeDefArray added in v1.1.1

type SiTypeDefArray struct {
	Len  int `json:"len"`
	Type int `json:"type"`
}

type SiTypeDefBitSequence added in v1.1.1

type SiTypeDefBitSequence struct {
	BitStoreType int `json:"bitStoreType"`
	BitOrderType int `json:"bitOrderType"`
}

type SiTypeDefCompact added in v1.1.1

type SiTypeDefCompact struct {
	Type int `json:"type"`
}

type SiTypeDefComposite added in v1.1.1

type SiTypeDefComposite struct {
	Fields []SiField `json:"fields"`
}

type SiTypeDefPrimitive added in v1.1.1

type SiTypeDefPrimitive string

type SiTypeDefRange added in v1.1.1

type SiTypeDefRange struct {
	Start     int  `json:"start"`
	End       int  `json:"end"`
	Inclusive bool `json:"inclusive"`
}

type SiTypeDefSequence added in v1.1.1

type SiTypeDefSequence struct {
	Type int `json:"type"`
}

type SiTypeDefTuple added in v1.1.1

type SiTypeDefTuple []int

type SiTypeDefVariant added in v1.1.1

type SiTypeDefVariant struct {
	Variants []SiVariant `json:"variants"`
}

type SiTypeOption added in v1.1.19

type SiTypeOption struct {
	Recursive bool
}

func RecursiveOption added in v1.1.21

func RecursiveOption() SiTypeOption

type SiTypeParameter added in v1.1.1

type SiTypeParameter struct {
	Name string `json:"name"`
	Type int    `json:"type"`
}

type SiTypeWithName added in v1.1.1

type SiTypeWithName struct {
	TypeString string
	Structure  interface{}
}

type SiVariant added in v1.1.1

type SiVariant struct {
	Name   string    `json:"name"`
	Fields []SiField `json:"fields"`
	Index  int       `json:"index"`
	Docs   []string  `json:"docs"`
}

type Signature

type Signature struct {
	ScaleDecoder
}

func (*Signature) Process

func (s *Signature) Process()

type SignedExtension added in v1.1.29

type SignedExtension struct {
	Name             string             `json:"name"`
	AdditionalSigned []AdditionalSigned `json:"additional_signed"`
}

type SignedExtensions added in v1.1.1

type SignedExtensions struct {
	Identifier       string `json:"identifier"`
	Type             int    `json:"type"`
	TypeString       string `json:"-"`
	AdditionalSigned int    `json:"additionalSigned"`
}

type SlotNumber

type SlotNumber struct{ U64 }

type Special

type Special struct {
	Version  []int
	Registry interface{}
}

type StorageType

type StorageType struct {
	Origin         string    `json:"origin"`
	PlainType      *string   `json:"plain_type,omitempty"`
	PlainTypeValue *int      `json:"PlainTypeValue,omitempty"`
	MapType        *MapType  `json:"map_type,omitempty"`
	DoubleMapType  *MapType  `json:"double_map_type,omitempty"`
	NMapType       *NMapType `json:"n_map_type,omitempty"`
}

type String

type String struct{ Bytes }

func (*String) Encode added in v1.3.3

func (s *String) Encode(value string) string

func (*String) TypeStructString added in v1.5.14

func (s *String) TypeStructString() string

type Struct

type Struct struct {
	ScaleDecoder
}

func (*Struct) Encode added in v1.3.3

func (s *Struct) Encode(value map[string]interface{}) string

func (*Struct) Process

func (s *Struct) Process()

func (*Struct) TypeStructString added in v1.5.14

func (s *Struct) TypeStructString() string

func (*Struct) WithTypeMapping added in v1.3.3

func (s *Struct) WithTypeMapping(typeMapping *TypeMapping) *Struct

type SubstrateFixedI128 added in v1.1.51

type SubstrateFixedI128 struct {
	ScaleDecoder
}

func (*SubstrateFixedI128) Process added in v1.1.51

func (s *SubstrateFixedI128) Process()

type SubstrateFixedU64 added in v1.1.48

type SubstrateFixedU64 struct {
	U64
}

SubstrateFixedU64 https://github.com/encointer/encointer-js/blob/master/packages/util/src/parserFixPoint.spec.ts#L17 substrate_fixed:FixedU64

func (*SubstrateFixedU64) Process added in v1.1.48

func (s *SubstrateFixedU64) Process()

type TypeMapping

type TypeMapping struct {
	Names []string
	Types []string
}

type U128

type U128 struct {
	ScaleDecoder
}

func (*U128) Encode added in v1.2.2

func (u *U128) Encode(value interface{}) string

func (*U128) Process

func (u *U128) Process()

func (*U128) TypeStructString added in v1.5.14

func (u *U128) TypeStructString() string

type U16

type U16 struct {
	Reader io.Reader
	ScaleDecoder
}

func (*U16) Encode added in v1.2.5

func (u *U16) Encode(value interface{}) string

func (*U16) Process

func (u *U16) Process()

func (*U16) TypeStructString added in v1.5.14

func (u *U16) TypeStructString() string

type U32

type U32 struct {
	Reader io.Reader
	ScaleDecoder
}

func (*U32) Encode

func (u *U32) Encode(value interface{}) string

func (*U32) Process

func (u *U32) Process()

func (*U32) TypeStructString added in v1.5.14

func (u *U32) TypeStructString() string

type U64

type U64 struct {
	ScaleDecoder
	Reader io.Reader
}

func (*U64) Encode added in v1.1.48

func (u *U64) Encode(value interface{}) string

func (*U64) Process

func (u *U64) Process()

func (*U64) TypeStructString added in v1.5.14

func (u *U64) TypeStructString() string

type U8

type U8 struct {
	ScaleDecoder
}

func (*U8) Encode added in v1.3.3

func (u *U8) Encode(value interface{}) string

func (*U8) Process

func (u *U8) Process()

func (*U8) TypeStructString added in v1.5.14

func (u *U8) TypeStructString() string

type Vec

type Vec struct {
	ScaleDecoder
}

func (*Vec) Encode added in v1.3.3

func (v *Vec) Encode(value interface{}) string

func (*Vec) Init

func (v *Vec) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption)

func (*Vec) Process

func (v *Vec) Process()

func (*Vec) TypeStructString added in v1.5.14

func (v *Vec) TypeStructString() string

type VoteOutcome

type VoteOutcome struct{ H256 }

type WeakBoundedVec added in v1.0.50

type WeakBoundedVec struct {
	BoundedVec
}

WeakBoundedVec https://github.com/paritytech/substrate/pull/8842

type WrapperOpaque added in v1.1.25

type WrapperOpaque struct{ ScaleDecoder }

func (*WrapperOpaque) Process added in v1.1.25

func (w *WrapperOpaque) Process()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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