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: UnorderedSet<DataType>
  • Type Parameters
  • Constructors
  • Properties
  • Accessors
  • Methods
  1. collections
  2. unordered-set
  3. classes

UnorderedSet

PreviousclassesNextvector

Last updated 7 months ago

• Docs


/ / UnorderedSet

Class: UnorderedSet<DataType>

An unordered set that stores data in NEAR storage.

Type Parameters

• DataType

Constructors

new UnorderedSet()

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

Parameters

• prefix: string

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

Returns

<DataType>

Defined in

Properties

_elements

Defined in


elementIndexPrefix

readonly elementIndexPrefix: string

Defined in


prefix

readonly prefix: string

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

Defined in

Accessors

length

get length(): number

The number of elements stored in the collection.

Returns

number

Defined in

Methods

[iterator]()

Returns

Defined in


clear()

clear(options?): void

Remove all of the elements stored within the collection.

Parameters

Returns

void

Defined in


contains()

contains(element, options?): boolean

Checks whether the collection contains the value.

Parameters

• element: DataType

The value for which to check the presence.

Options for storing data.

Returns

boolean

Defined in


elements()

elements(__namedParameters): DataType[]

Parameters

• __namedParameters

• __namedParameters.limit?: number

• __namedParameters.start?: number

Returns

DataType[]

Defined in


extend()

extend(elements): void

Extends the current collection with the passed in array of elements.

Parameters

• elements: DataType[]

The elements to extend the collection with.

Returns

void

Defined in


isEmpty()

isEmpty(): boolean

Checks whether the collection is empty.

Returns

boolean

Defined in


remove()

remove(element, options?): boolean

Returns true if the element was present in the set.

Parameters

• element: DataType

The entry to remove.

Options for retrieving and storing data.

Returns

boolean

Defined in


serialize()

serialize(options?): Uint8Array

Serialize the collection.

Parameters

Options for storing the data.

Returns

Uint8Array

Defined in


set()

set(element, options?): boolean

If the set did not have this value present, true is returned. If the set did have this value present, false is returned.

Parameters

• element: DataType

The value to store in the collection.

Options for storing the data.

Returns

boolean

Defined in


toArray()

toArray(options?): DataType[]

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

Parameters

Options for retrieving and storing the data.

Returns

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

readonly _elements: <DataType>

[iterator](): <DataType>

<DataType>

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

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

• __namedParameters.options?: <DataType>

• options?: <DataType>

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

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

• options?: <DataType>

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

• data: <DataType>

<DataType>

collections/unordered-set
near-sdk-js v2.0.0
collections/unordered-set
UnorderedSet
UnorderedSet
packages/near-sdk-js/src/collections/unordered-set.ts:35
Vector
packages/near-sdk-js/src/collections/unordered-set.ts:30
packages/near-sdk-js/src/collections/unordered-set.ts:29
packages/near-sdk-js/src/collections/unordered-set.ts:35
packages/near-sdk-js/src/collections/unordered-set.ts:43
VectorIterator
VectorIterator
packages/near-sdk-js/src/collections/unordered-set.ts:157
GetOptions
packages/near-sdk-js/src/collections/unordered-set.ts:147
GetOptions
packages/near-sdk-js/src/collections/unordered-set.ts:60
GetOptions
packages/near-sdk-js/src/collections/unordered-set.ts:230
packages/near-sdk-js/src/collections/unordered-set.ts:196
packages/near-sdk-js/src/collections/unordered-set.ts:50
GetOptions
packages/near-sdk-js/src/collections/unordered-set.ts:101
GetOptions
packages/near-sdk-js/src/collections/unordered-set.ts:207
GetOptions
packages/near-sdk-js/src/collections/unordered-set.ts:76
GetOptions
packages/near-sdk-js/src/collections/unordered-set.ts:179
UnorderedSet
UnorderedSet
UnorderedSet
packages/near-sdk-js/src/collections/unordered-set.ts:216