name: Codec
description: The base Codec interface. All types implement the interface provided here. Additionally implementors can add their own specific interfaces and helpres with getters and functions. The Codec Base is however required for operating as an encoding/decoding layer
Hierarchy
Codec
Implemented by
- AccountId
- AccountIdOf
- AccountIndex
- Address
- Amount
- ApiId
- ApplyExtrinsic
- AssetOf
- AttestedCandidate
- AuthoritiesChange
- AuthorityId
- AvailabilityVote
- Balance
- BalanceOf
- BalanceUpload
- BftAtReport
- BftAuthoritySignature
- BftDoubleCommit
- BftDoublePrepare
- BftDoublePropose
- BftHashSignature
- BftProposeOutOfTurn
- Block
- BlockNumber
- Bool
- Broadcast
- Bytes
- CallMetadata
- CandidateReceipt
- CandidateSignature
- ChainProperties
- ChangesTrieRoot
- CodeHash
- Compact
- Data
- Default
- Digest
- DigestItem
- Dropped
- Ed25519Signature
- EgressQueueRoot
- Enum
- EnumType
- Event
- EventData
- EventIndex
- EventMetadata
- EventRecord
- ExplicitCandidateSignature
- Extrinsic
- ExtrinsicEra
- ExtrinsicSignature
- ExtrinsicStatus
- Extrinsics
- Finalised
- Finalization
- FunctionArgumentMetadata
- FunctionMetadata
- Future
- Gas
- H160
- H256
- H512
- Hash
- HeadData
- Header
- HeaderExtended
- Health
- I128
- I16
- I256
- I32
- I64
- I8
- ImplicitCandidateSignature
- InherentOfflineReport
- Int
- Invalid
- Justification
- KeyValue
- KeyValueOption
- LocKPeriods
- MagicNumber
- MapType
- MapType
- Metadata
- MetadataCall
- MetadataCallArg
- MetadataEvent
- MetadataModule
- MetadataStorage
- MetadataStorageModifier
- MetadataStorageType
- MetadataV0
- MetadataV1
- MetadataVersioned
- Method
- MethodIndex
- MisbehaviorKind
- MisbehaviorReport
- ModuleMetadata
- Moment
- MomentOf
- NewAccountOutcome
- NextAuthority
- Nonce
- NonceCompact
- Null
- Option
- Optional
- Origin
- Other
- OuterDispatchCall
- OuterDispatchMetadata
- OuterEventMetadata
- OuterEventMetadataEvent
- ParaId
- PeerInfo
- PendingExtrinsics
- Perbill
- Permill
- Phase
- PlainType
- PrefabWasmModule
- PropIndex
- Proposal
- ProposalIndex
- Ready
- ReferendumIndex
- ReferendumInfo
- RhdJustification
- RuntimeModuleMetadata
- RuntimeVersion
- RuntimeVersionApi
- Schedule
- Seal
- SeedOf
- SessionKey
- Set
- Signature
- SignaturePayload
- SignedBlock
- Sr25519Signature
- StorageChangeSet
- StorageData
- StorageFunctionMetadata
- StorageFunctionModifier
- StorageFunctionType
- StorageKey
- StorageMetadata
- StoredPendingChange
- Struct
- Text
- Tuple
- Type
- U128
- U16
- U256
- U32
- U64
- U8
- U8a
- U8aFixed
- UInt
- USize
- Usurped
- ValidatorPrefs
- ValidityAttestation
- ValidityVote
- Vector
- VestingSchedule
- Vote
- VoteIndex
- VoteThreshold
Properties
encodedLength
● encodedLength: number
Defined in types.ts:34
description: The length of the value when encoded as a Uint8Array
isEmpty
● isEmpty: boolean
Defined in types.ts:39
description: Checks if the value is an empty value
Methods
eq
▸ eq(other?: any): boolean
Defined in types.ts:44
description: Compares the value of the input to see if there is a match
Parameters:
| Name | Type |
|---|---|
Optional other | any |
Returns: boolean
toHex
▸ toHex(): string
Defined in types.ts:49
description: Returns a hex string representation of the value
Returns: string
toJSON
▸ toJSON(): any
Defined in types.ts:54
description: Converts the Object to JSON, typically used for RPC transfers
Returns: any
toString
▸ toString(): string
Defined in types.ts:59
description: Returns the string representation of the value
Returns: string
toU8a
▸ toU8a(isBare?: undefined | false | true): Uint8Array
Defined in types.ts:65
description: Encodes the value as a Uint8Array as per the parity-codec specifications
Parameters:
| Name | Type | Description |
|---|---|---|
Optional isBare | undefined | false | true | true when the value has none of the type-specific prefixes (internal) |
Returns: Uint8Array