name: U8a

description: A basic wrapper around Uint8Array, with no frills and no fuss. It does differ from other implementations wher 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

Uint8Array

↳ U8a

↳ U8aFixed

↳ Bytes

↳ ExtrinsicEra

↳ Data

Implements

Indexable

[index: number]: number

Constructors

constructor

⊕ new U8a(value: AnyU8a): U8a

Defined in codec/U8a.ts:18

Parameters:

Name Type
value AnyU8a

Returns: U8a


Properties

<Static> Uint8Array

● Uint8Array: Uint8ArrayConstructor

Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es5.d.ts:2205


Accessors

encodedLength

getencodedLength(): number

Defined in codec/U8a.ts:36

description: The length of the value when encoded as a Uint8Array

Returns: number


length

getlength(): number

Overrides Uint8Array.length

Defined in codec/U8a.ts:43

description: The length of the value

Returns: number


Methods

subarray

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

Overrides Uint8Array.subarray

Defined in codec/U8a.ts:53

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
Optional end undefined number The position to end at

Returns: Uint8Array


toHex

▸ toHex(): string

Implementation of Codec.toHex

Defined in codec/U8a.ts:60

description: Returns a hex string representation of the value

Returns: string


toJSON

▸ toJSON(): any

Implementation of Codec.toJSON

Defined in codec/U8a.ts:67

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

Returns: any


toString

▸ toString(): string

Implementation of Codec.toString

Overrides Uint8Array.toString

Defined in codec/U8a.ts:74

description: Returns the string representation of the value

Returns: string


toU8a

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

Defined in codec/U8a.ts:82

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


results matching ""

    No results matching ""