Polkadot JS APIGlobals"codec/Raw"Raw

# Class: Raw

name Raw

description A basic wrapper around Uint8Array, with no frills and no fuss. It does differ from other implementations where it will consume the full Uint8Array as passed to it. As such it is meant to be subclassed where the wrapper takes care of the actual lengths instead of used directly.

# Hierarchy

# Implements

# Indexable

  • [ index: number]: number

name Raw

description A basic wrapper around Uint8Array, with no frills and no fuss. It does differ from other implementations where it will consume the full Uint8Array as passed to it. As such it is meant to be subclassed where the wrapper takes care of the actual lengths instead of used directly.

# Index

# Constructors

# Properties

# Accessors

# Methods

# Constructors

# constructor

+ new Raw(registry: Registry, value?: AnyU8a): Raw

Defined in packages/types/src/codec/Raw.ts:30

Parameters:

Name Type
registry Registry
value? AnyU8a

Returns: Raw

# Properties

# Readonly registry

registry: Registry

Implementation of IU8a.registry

Defined in packages/types/src/codec/Raw.ts:30


# Static Uint8Array

Uint8Array: Uint8ArrayConstructor

Defined in node_modules/typescript/lib/lib.es5.d.ts:2263

# Accessors

# encodedLength

get encodedLength(): number

Defined in packages/types/src/codec/Raw.ts:41

description The length of the value when encoded as a Uint8Array

Returns: number


# hash

get hash(): H256

Defined in packages/types/src/codec/Raw.ts:48

description returns a hash of the contents

Returns: H256


# isEmpty

get isEmpty(): boolean

Defined in packages/types/src/codec/Raw.ts:55

description Returns true if the type wraps an empty/default all-0 value

Returns: boolean


# length

get length(): number

Overrides IU8a.length

Defined in packages/types/src/codec/Raw.ts:62

description The length of the value

Returns: number

# Methods

# bitLength

bitLength(): number

Implementation of IU8a

Defined in packages/types/src/codec/Raw.ts:70

description Returns the number of bits in the value

Returns: number


# eq

eq(other?: unknown): boolean

Implementation of IU8a

Defined in packages/types/src/codec/Raw.ts:77

description Compares the value of the input to see if there is a match

Parameters:

Name Type
other? unknown

Returns: boolean


# subarray

subarray(begin: number, end?: undefined | number): Uint8Array

Overrides IU8a.subarray

Defined in packages/types/src/codec/Raw.ts:91

description Create a new subarray from the actual buffer. This is needed for compat reasons since a new Uint8Array gets returned here

Parameters:

Name Type Description
begin number The position to start at
end? undefined | number The position to end at

Returns: Uint8Array


# toHex

toHex(): string

Defined in packages/types/src/codec/Raw.ts:98

description Returns a hex string representation of the value

Returns: string


# toHuman

toHuman(): AnyJson

Defined in packages/types/src/codec/Raw.ts:105

description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information

Returns: AnyJson


# toJSON

toJSON(): string

Implementation of IU8a

Defined in packages/types/src/codec/Raw.ts:112

description Converts the Object to JSON, typically used for RPC transfers

Returns: string


# toRawType

toRawType(): string

Implementation of IU8a

Defined in packages/types/src/codec/Raw.ts:119

description Returns the base runtime type name for this instance

Returns: string


# toString

toString(): string

Implementation of IU8a

Overrides IU8a.toString

Defined in packages/types/src/codec/Raw.ts:126

description Returns the string representation of the value

Returns: string


# toU8a

toU8a(isBare?: undefined | false | true): Uint8Array

Defined in packages/types/src/codec/Raw.ts:135

description Encodes the value as a Uint8Array as per the SCALE specifications

Parameters:

Name Type Description
isBare? undefined | false | true true when the value has none of the type-specific prefixes (internal)

Returns: Uint8Array