Documentation ¶
Overview ¶
Simple Concatenated Aggregate Little-Endian” (SCALE) codec
Polkadot Spec - https://spec.polkadot.network/#sect-scale-codec
Substrate Ref - https://docs.substrate.io/reference/scale-codec/
Index ¶
- func Clamp(value, min, max int) int
- func DictionaryFieldEncode(field reflect.Value, buffer *bytes.Buffer)
- func EncodeEach(buffer *bytes.Buffer, encodables ...Encodable) error
- func EncodeTuple(t interface{}, buffer *bytes.Buffer)
- func EncodedBytes(e Encodable) []byte
- func FixedSequenceU8ToBytes(bytes FixedSequence[U8]) []byte
- func SequenceFieldEncode(field reflect.Value, buffer *bytes.Buffer)
- func SequenceU8ToBytes(bytes Sequence[U8]) []byte
- func TrailingZeros128(n U128) uint
- type Bool
- type Compact
- type Comparable
- type Decoder
- type Dictionary
- type Empty
- type Encodable
- type Encoder
- type FixedSequence
- type I128
- func (n I128) Add(other I128) I128
- func (n I128) Bytes() []byte
- func (n I128) Div(other I128) I128
- func (n I128) Encode(buffer *bytes.Buffer) error
- func (n I128) Eq(other I128) bool
- func (n I128) Gt(other I128) bool
- func (n I128) Gte(other I128) bool
- func (n I128) Lt(other I128) bool
- func (n I128) Lte(other I128) bool
- func (n I128) Mod(other I128) I128
- func (n I128) Mul(other I128) I128
- func (n I128) Ne(other I128) bool
- func (n I128) Sub(other I128) I128
- func (n I128) ToBigInt() *big.Int
- type I16
- type I32
- type I64
- type I8
- type Integer
- type Integer128
- type Numeric
- type Option
- type OptionBool
- type Ordered
- type Result
- type Sequence
- type SignedPrimitiveInteger
- type Str
- type Tuple
- type U128
- func CheckedAddU128(a, b U128) (U128, error)
- func CheckedSubU128(a, b U128) (U128, error)
- func DecodeU128(buffer *bytes.Buffer) (U128, error)
- func Max128(a, b U128) U128
- func MaxU128() U128
- func Min128(a, b U128) U128
- func MinU128() U128
- func NewU128[N Integer](n N) U128
- func NewU128FromString(n string) (U128, error)
- func SaturatingAddU128(a, b U128) U128
- func SaturatingSubU128(a, b U128) U128
- func (n U128) Add(other U128) U128
- func (n U128) Bytes() []byte
- func (n U128) Div(other U128) U128
- func (n U128) Encode(buffer *bytes.Buffer) error
- func (n U128) Eq(other U128) bool
- func (n U128) Gt(other U128) bool
- func (n U128) Gte(other U128) bool
- func (n U128) Lt(other U128) bool
- func (n U128) Lte(other U128) bool
- func (n U128) Mod(other U128) U128
- func (n U128) Mul(other U128) U128
- func (n U128) Ne(other U128) bool
- func (n U128) Sub(other U128) U128
- func (n U128) ToBigInt() *big.Int
- type U16
- type U32
- type U64
- func CheckedAddU64(a, b U64) (U64, error)
- func CheckedMulU64(a, b U64) (U64, error)
- func DecodeU64(buffer *bytes.Buffer) (U64, error)
- func Max64(a, b U64) U64
- func Min64(a, b U64) U64
- func NewU64(n uint64) U64
- func SaturatingAddU64(a, b U64) U64
- func SaturatingMulU64(a, b U64) U64
- func SaturatingSubU64(a, b U64) U64
- type U8
- type UnsignedPrimitiveInteger
- type VaryingData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeTuple ¶
func EncodedBytes ¶
func FixedSequenceU8ToBytes ¶
func FixedSequenceU8ToBytes(bytes FixedSequence[U8]) []byte
func SequenceU8ToBytes ¶
func TrailingZeros128 ¶
Types ¶
type Comparable ¶
type Decoder ¶
func (Decoder) DecodeByte ¶
type Dictionary ¶
type Dictionary[K Comparable, V Encodable] map[K]V
func DecodeDictionary ¶
func DecodeDictionary[K Comparable, V Encodable](buffer *bytes.Buffer) (Dictionary[K, V], error)
func (Dictionary[K, V]) Bytes ¶
func (d Dictionary[K, V]) Bytes() []byte
type Encodable ¶
func ConvertToDictionary ¶
func ConvertToDictionary[K Comparable, V Encodable](v reflect.Value) (value Encodable)
type Encoder ¶
func (Encoder) EncodeByte ¶
type FixedSequence ¶
type FixedSequence[T Encodable] []T // TODO: https://github.com/LimeChain/goscale/issues/37
func BytesToFixedSequenceU8 ¶
func BytesToFixedSequenceU8(bytes []byte) FixedSequence[U8]
func DecodeFixedSequence ¶
func NewFixedSequence ¶
func NewFixedSequence[T Encodable](size int, values ...T) FixedSequence[T]
Initializes with the specified size and provides size checks (at least at runtime)
func (FixedSequence[T]) Bytes ¶
func (fseq FixedSequence[T]) Bytes() []byte
type I128 ¶
type I128 [2]U64
little endian byte order [0] least significant bits [1] most significant bits
func NewI128FromString ¶
type Integer ¶
type Integer interface { SignedPrimitiveInteger | UnsignedPrimitiveInteger | Integer128 | *big.Int }
Signed/Unsigned integer constraint, for type safety checks
type Integer128 ¶
type Option ¶
func DecodeOptionWith ¶
type OptionBool ¶
func DecodeOptionBool ¶
func DecodeOptionBool(buffer *bytes.Buffer) (OptionBool, error)
func (OptionBool) Bytes ¶
func (o OptionBool) Bytes() []byte
type Result ¶
func DecodeResult ¶
type SignedPrimitiveInteger ¶
Signed integer constraint, for type safety checks
type U128 ¶
type U128 [2]U64
little endian byte order [0] least significant bits [1] most significant bits
func CheckedAddU128 ¶
func CheckedSubU128 ¶
func NewU128FromString ¶
func SaturatingAddU128 ¶
func SaturatingSubU128 ¶
type U64 ¶
type U64 uint64
func CheckedAddU64 ¶
func CheckedMulU64 ¶
func SaturatingAddU64 ¶
func SaturatingMulU64 ¶
func SaturatingSubU64 ¶
type UnsignedPrimitiveInteger ¶
type UnsignedPrimitiveInteger interface { uint | uint8 | uint16 | uint32 | uint64 | U8 | U16 | U32 | U64 }
Unsigned integer constraint, for type safety checks
type VaryingData ¶
type VaryingData []Encodable
func DecodeVaryingData ¶
func NewVaryingData ¶
func NewVaryingData(values ...Encodable) VaryingData
func (VaryingData) Bytes ¶
func (vd VaryingData) Bytes() []byte
Click to show internal directories.
Click to hide internal directories.