Skip to content

@aldea/sdk / Exports / Pointer

Class: Pointer

Aldea Pointer

A consists of a 32 byte ID and an index integer which points to the location of an object within a larger data structure.

A Pointer is encoded as a string by concatentating the hex encoded ID with the index.

Example:

3b2af88dad7f1847f5b333852b71ac6fd2ae519ba2d359e8ce07b071aad30e80_1

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Pointer(id, idx): Pointer

Parameters

NameType
idstring | Uint8Array
idxnumber

Returns

Pointer

Defined in

packages/core/dist/pointer.d.ts:18

Properties

idBuf

idBuf: Uint8Array

Defined in

packages/core/dist/pointer.d.ts:16


idx

idx: number

Defined in

packages/core/dist/pointer.d.ts:17

Accessors

id

get id(): string

Returns

string

Defined in

packages/core/dist/pointer.d.ts:21

Methods

equals

equals(ptr): boolean

Parameters

NameType
ptrPointer

Returns

boolean

Defined in

packages/core/dist/pointer.d.ts:22


toBytes

toBytes(): Uint8Array

Returns

Uint8Array

Defined in

packages/core/dist/pointer.d.ts:23


toString

toString(): string

Returns

string

Defined in

packages/core/dist/pointer.d.ts:24


fromBytes

fromBytes(bytes): Pointer

Parameters

NameType
bytesUint8Array

Returns

Pointer

Defined in

packages/core/dist/pointer.d.ts:19


fromString

fromString(str): Pointer

Parameters

NameType
strstring

Returns

Pointer

Defined in

packages/core/dist/pointer.d.ts:20