Skip to main content

Class: FeedIndex

Defined in: core-sdk/src/bytes/feed-index.ts:9

An 8-byte, big-endian sequential feed update index.

Extends

Constructors

Constructor

new FeedIndex(bytes): FeedIndex

Defined in: core-sdk/src/bytes/feed-index.ts:14

Parameters

bytes

string | Uint8Array<ArrayBufferLike> | Bytes

Returns

FeedIndex

Overrides

Bytes.constructor

Properties

length

readonly length: number

Defined in: core-sdk/src/bytes/bytes.ts:19

Inherited from

Bytes.length


LENGTH

readonly static LENGTH: 8 = 8

Defined in: core-sdk/src/bytes/feed-index.ts:10


MINUS_ONE

readonly static MINUS_ONE: FeedIndex

Defined in: core-sdk/src/bytes/feed-index.ts:12

Sentinel index (all bits set) some feed types use to mean "no update yet".

Methods

equals()

equals(other): boolean

Defined in: core-sdk/src/bytes/bytes.ts:166

Byte-wise equality against another Bytes instance, raw bytes, or hex string.

Parameters

other

string | Uint8Array<ArrayBufferLike> | Bytes

Returns

boolean

Inherited from

Bytes.equals


next()

next(): FeedIndex

Defined in: core-sdk/src/bytes/feed-index.ts:35

Returns the next sequential index, wrapping MINUS_ONE back to 0.

Returns

FeedIndex


offset()

offset(index): Uint8Array

Defined in: core-sdk/src/bytes/bytes.ts:110

Returns a copy of the bytes from index to the end.

Parameters

index

number

Returns

Uint8Array

Inherited from

Bytes.offset


represent()

represent(): string

Defined in: core-sdk/src/bytes/bytes.ts:173

Human-readable representation, used by debuggers/loggers. Same as toHex.

Returns

string

Inherited from

Bytes.represent


toBase32()

toBase32(): string

Defined in: core-sdk/src/bytes/bytes.ts:138

Encodes as a padded base32 string.

Returns

string

Inherited from

Bytes.toBase32


toBase64()

toBase64(): string

Defined in: core-sdk/src/bytes/bytes.ts:131

Encodes as a padded base64 string.

Returns

string

Inherited from

Bytes.toBase64


toBigInt()

toBigInt(): bigint

Defined in: core-sdk/src/bytes/feed-index.ts:28

Decodes the index as a bigint.

Returns

bigint


toHex()

toHex(): string

Defined in: core-sdk/src/bytes/bytes.ts:124

Encodes as a lowercase hex string, with no 0x prefix.

Returns

string

Inherited from

Bytes.toHex


toJSON()

toJSON(): unknown

Defined in: core-sdk/src/bytes/bytes.ts:159

Decodes the bytes as UTF-8 JSON.

Returns

unknown

Inherited from

Bytes.toJSON


toString()

toString(): string

Defined in: core-sdk/src/bytes/bytes.ts:145

Same as toHex.

Returns

string

Inherited from

Bytes.toString


toUint8Array()

toUint8Array(): Uint8Array

Defined in: core-sdk/src/bytes/bytes.ts:117

Returns a copy of the underlying bytes.

Returns

Uint8Array

Inherited from

Bytes.toUint8Array


toUtf8()

toUtf8(): string

Defined in: core-sdk/src/bytes/bytes.ts:152

Decodes the bytes as UTF-8 text.

Returns

string

Inherited from

Bytes.toUtf8


concat()

static concat(...arrays): Uint8Array

Defined in: core-sdk/src/bytes/bytes.ts:75

Concatenates any number of byte arrays (or Bytes instances) into one new array.

Parameters

arrays

...(Uint8Array<ArrayBufferLike> | Bytes)[]

Returns

Uint8Array

Inherited from

Bytes.concat


fromBigInt()

static fromBigInt(value): FeedIndex

Defined in: core-sdk/src/bytes/feed-index.ts:21

Encodes a bigint index as an 8-byte, big-endian FeedIndex.

Parameters

value

bigint

Returns

FeedIndex


fromSlice()

static fromSlice(bytes, start, length?): Bytes

Defined in: core-sdk/src/bytes/bytes.ts:100

Wraps a slice of bytes starting at start, running to the end unless length is given.

Parameters

bytes

Uint8Array

start

number

length?

number

Returns

Bytes

Inherited from

Bytes.fromSlice


fromUtf8()

static fromUtf8(utf8): Bytes

Defined in: core-sdk/src/bytes/bytes.ts:92

Wraps the UTF-8 encoding of a string.

Parameters

utf8

string

Returns

Bytes

Inherited from

Bytes.fromUtf8


keccak256()

static keccak256(bytes): Bytes

Defined in: core-sdk/src/bytes/bytes.ts:68

Hashes bytes with keccak256 and wraps the 32-byte digest.

Parameters

bytes

string | ArrayBuffer | Uint8Array<ArrayBufferLike> | Bytes

Returns

Bytes

Inherited from

Bytes.keccak256

💬 Get Help