near-sdk-js
  • README
  • packages
  • api
    • functions
      • accountBalance
      • accountLockedBalance
      • altBn128G1Multiexp
      • altBn128G1Sum
      • altBn128PairingCheck
      • attachedDeposit
      • blockHeight
      • blockIndex
      • blockTimestamp
      • currentAccountId
      • ecrecover
      • epochHeight
      • input
      • inputRaw
      • keccak256
      • keccak512
      • log
      • logUtf16
      • logUtf8
      • panicUtf8
      • predecessorAccountId
      • prepaidGas
      • promiseAnd
      • promiseBatchActionAddKeyWithFullAccess
      • promiseBatchActionAddKeyWithFunctionCall
      • promiseBatchActionCreateAccount
      • promiseBatchActionDeleteAccount
      • promiseBatchActionDeleteKey
      • promiseBatchActionDeployContract
      • promiseBatchActionFunctionCall
      • promiseBatchActionFunctionCallRaw
      • promiseBatchActionFunctionCallWeight
      • promiseBatchActionFunctionCallWeightRaw
      • promiseBatchActionStake
      • promiseBatchActionTransfer
      • promiseBatchCreate
      • promiseBatchThen
      • promiseCreate
      • promiseCreateRaw
      • promiseResult
      • promiseResultRaw
      • promiseResultsCount
      • promiseReturn
      • promiseThen
      • promiseThenRaw
      • randomSeed
      • ripemd160
      • sha256
      • signerAccountId
      • signerAccountPk
      • storageByteCost
      • storageGetEvicted
      • storageGetEvictedRaw
      • storageHasKey
      • storageHasKeyRaw
      • storageRead
      • storageReadRaw
      • storageRemove
      • storageRemoveRaw
      • storageUsage
      • storageWrite
      • storageWriteRaw
      • usedGas
      • validatorStake
      • validatorTotalStake
      • valueReturn
      • valueReturnRaw
  • collections
    • lookup-map
      • classes
        • LookupMap
    • lookup-set
      • classes
        • LookupSet
    • subtype
      • classes
        • SubType
    • unordered-map
      • classes
        • UnorderedMap
    • unordered-set
      • classes
        • UnorderedSet
    • vector
      • classes
        • Vector
        • VectorIterator
  • index
    • functions
      • includeBytes
  • near-bindgen
    • functions
      • NearBindgen
      • call
      • initialize
      • middleware
      • migrate
      • view
  • promise
    • classes
      • AddAccessKey
      • AddFullAccessKey
      • CreateAccount
      • DeleteAccount
      • DeleteKey
      • DeployContract
      • FunctionCall
      • FunctionCallRaw
      • FunctionCallWeight
      • FunctionCallWeightRaw
      • NearPromise
      • PromiseAction
      • PromiseJoint
      • Stake
      • Transfer
    • type-aliases
      • PromiseOrValue
  • types
    • account_id
      • type-aliases
        • AccountId
    • collections
      • interfaces
        • GetOptions
    • gas
      • type-aliases
        • Gas
      • variables
        • ONE_TERA_GAS
    • primitives
      • type-aliases
        • Balance
        • BlockHeight
        • EpochHeight
        • GasWeight
        • Nonce
        • StorageUsage
      • variables
        • ONE_NEAR
        • ONE_YOCTO
    • public_key
      • classes
        • Base58Error
        • InvalidLengthError
        • ParsePublicKeyError
        • PublicKey
        • UnknownCurve
      • enumerations
        • CurveType
      • functions
        • curveTypeFromStr
    • vm_types
      • enumerations
        • PromiseError
        • PromiseResult
      • type-aliases
        • IteratorIndex
        • ReceiptIndex
  • utils
    • classes
      • TextDecoder
      • TextEncoder
    • functions
      • assert
      • bytes
      • concat
      • decode
      • decodeObj2class
      • deserialize
      • encode
      • getValueWithOptions
      • serialize
      • serializeValueWithOptions
      • str
      • validateAccountId
    • interfaces
      • Env
      • IntoStorageKey
    • type-aliases
      • Mutable
      • NearAmount
      • PromiseIndex
      • Register
    • variables
      • ERR_INCONSISTENT_STATE
      • ERR_INDEX_OUT_OF_BOUNDS
  • version
    • variables
      • LIB_VERSION
  • cli
    • abi
      • functions
        • runAbiCompilerPlugin
    • cli
      • functions
        • buildCom
        • checkTypescriptCom
        • createJsFileWithRollupCom
        • generateAbi
        • transpileJsAndBuildWasmCom
        • validateCom
    • post-install
    • utils
      • functions
        • download
        • executeCommand
        • validateContract
    • build-tools
      • include-bytes
        • functions
          • default
      • near-bindgen-exporter
        • functions
          • default
Powered by GitBook
On this page
  • Class: UnorderedMap<DataType>
  • Extends
  • Type Parameters
  • Constructors
  • Properties
  • Accessors
  • Methods
  1. collections
  2. unordered-map
  3. classes

UnorderedMap

PreviousclassesNextunordered-set

Last updated 7 months ago

• Docs


/ / UnorderedMap

Class: UnorderedMap<DataType>

An unordered map that stores data in NEAR storage.

Extends

  • <DataType>

Type Parameters

• DataType

Constructors

new UnorderedMap()

new UnorderedMap<DataType>(prefix): <DataType>

Parameters

• prefix: string

The byte prefix to use when storing elements inside this collection.

Returns

Overrides

Defined in

Properties

_keys

Defined in


prefix

readonly prefix: string

The byte prefix to use when storing elements inside this collection.

Defined in


values

Defined in

Accessors

length

get length(): number

The number of elements stored in the collection.

Returns

number

Defined in

Methods

[iterator]()

[iterator](): UnorderedMapIterator<DataType>

Returns

UnorderedMapIterator<DataType>

Defined in


clear()

clear(): void

Remove all of the elements stored within the collection.

Returns

void

Defined in


extend()

extend(keyValuePairs): void

Extends the current collection with the passed in array of key-value pairs.

Parameters

• keyValuePairs: [string, DataType][]

The key-value pairs to extend the collection with.

Returns

void

Defined in


get()

get(key, options?): DataType

Get the data stored at the provided key.

Parameters

• key: string

The key at which to look for the data.

Options for retrieving the data.

Returns

DataType

Defined in


isEmpty()

isEmpty(): boolean

Checks whether the collection is empty.

Returns

boolean

Defined in


keys()

keys(__namedParameters): string[]

Parameters

• __namedParameters

• __namedParameters.limit: any

• __namedParameters.start: any

Returns

string[]

Defined in


remove()

remove(key, options?): DataType

Removes and retrieves the element with the provided key.

Parameters

• key: string

The key at which to remove data.

Options for retrieving the data.

Returns

DataType

Defined in


serialize()

serialize(options?): Uint8Array

Serialize the collection.

Parameters

Options for storing the data.

Returns

Uint8Array

Defined in


set()

set(key, value, options?): DataType

Store a new value at the provided key.

Parameters

• key: string

The key at which to store in the collection.

• value: DataType

The value to store in the collection.

Options for retrieving and storing the data.

Returns

DataType

Defined in


set_reconstructor()

Parameters

Returns

Inherited from

Defined in


subtype()

subtype(): any

Returns

any

Inherited from

Defined in


toArray()

toArray(options?): [string, DataType][]

Return a JavaScript array of the data stored within the collection.

Parameters

Options for retrieving and storing the data.

Returns

[string, DataType][]

Defined in


reconstruct()

Converts the deserialized data from storage to a JavaScript instance of the collection.

Type Parameters

• DataType

Parameters

The deserialized data to create an instance from.

Returns

Defined in

<DataType>

.

readonly _keys: <string>

readonly values: <ValueAndIndex>

• options?: Omit<<DataType>, "serializer">

• options?: Omit<<DataType>, "serializer">

• options?: Pick<<DataType>, "serializer">

• options?: <DataType>

set_reconstructor(options?): Omit<<DataType>, "serializer">

• options?: Omit<<DataType>, "serializer">

Omit<<DataType>, "serializer">

.

.

• options?: <DataType>

static reconstruct<DataType>(data): <DataType>

• data: <DataType>

<DataType>

collections/unordered-map
near-sdk-js v2.0.0
collections/unordered-map
SubType
UnorderedMap
UnorderedMap
packages/near-sdk-js/src/collections/unordered-map.ts:27
Vector
packages/near-sdk-js/src/collections/unordered-map.ts:21
packages/near-sdk-js/src/collections/unordered-map.ts:27
LookupMap
packages/near-sdk-js/src/collections/unordered-map.ts:22
packages/near-sdk-js/src/collections/unordered-map.ts:36
packages/near-sdk-js/src/collections/unordered-map.ts:145
packages/near-sdk-js/src/collections/unordered-map.ts:136
packages/near-sdk-js/src/collections/unordered-map.ts:184
GetOptions
packages/near-sdk-js/src/collections/unordered-map.ts:53
packages/near-sdk-js/src/collections/unordered-map.ts:43
packages/near-sdk-js/src/collections/unordered-map.ts:220
GetOptions
packages/near-sdk-js/src/collections/unordered-map.ts:105
GetOptions
packages/near-sdk-js/src/collections/unordered-map.ts:195
GetOptions
packages/near-sdk-js/src/collections/unordered-map.ts:76
GetOptions
GetOptions
GetOptions
packages/near-sdk-js/src/collections/subtype.ts:8
packages/near-sdk-js/src/collections/subtype.ts:6
GetOptions
packages/near-sdk-js/src/collections/unordered-map.ts:167
UnorderedMap
UnorderedMap
UnorderedMap
packages/near-sdk-js/src/collections/unordered-map.ts:204
SubType
SubType
SubType
constructor
set_reconstructor
subtype