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

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


Last Updated: 2/25/2019, 4:39:16 PM