Collections

near-runtime-ts > "near" > collections

Module: collections

A namespace with classes and functions for persistent collections on the blockchain.

Index

Classes

Variables

  • _KEY_BACK_INDEX_SUFFIX

  • _KEY_ELEMENT_SUFFIX

  • _KEY_FRONT_INDEX_SUFFIX

  • _KEY_LENGTH_SUFFIX

Functions

  • deque

  • map

  • vector

Variables

<Const> _KEY_BACK_INDEX_SUFFIX

● _KEY_BACK_INDEX_SUFFIX: ":back" = ":back"

Defined in near.ts:228

<Const> _KEY_ELEMENT_SUFFIX

● _KEY_ELEMENT_SUFFIX: "::" = "::"

Defined in near.ts:229

<Const> _KEY_FRONT_INDEX_SUFFIX

● _KEY_FRONT_INDEX_SUFFIX: ":front" = ":front"

Defined in near.ts:227

<Const> _KEY_LENGTH_SUFFIX

● _KEY_LENGTH_SUFFIX: ":len" = ":len"

Defined in near.ts:226

Functions

deque

deque<T>(prefix: string): Deque<T>

Defined in near.ts:721

Creates or restores a persistent deque with a given storage prefix. Always use a unique storage prefix for different collections.

Type parameters:

T

Parameters:

Name

Type

Description

prefix

string

A prefix to use for every key of this deque.

Returns: Deque<T>

map

map<K,V>(prefix: string): Map<K, V>

Defined in near.ts:730

Creates or restores a persistent map with a given storage prefix. Always use a unique storage prefix for different collections.

Type parameters:

K

V

Parameters:

Name

Type

Description

prefix

string

A prefix to use for every key of this map.

Returns: Map<K, V>

vector

vector<T>(prefix: string): Vector<T>

Defined in near.ts:712

Creates or restores a persistent vector with a given storage prefix. Always use a unique storage prefix for different collections.

Type parameters:

T

Parameters:

Name

Type

Description

prefix

string

A prefix to use for every key of this vector.

Returns: Vector<T>