Class: BatchTokenDetailsArray<T>
T extends NumberType
Defined in: packages/bitbadgesjs-sdk/src/core/batch-utils.ts:90
Extends
BaseTypedArray<BatchTokenDetailsArray<T>,BatchTokenDetails<T>>
Type Parameters
T
T extends NumberType
Indexable
[
n:number]:BatchTokenDetails<T>
Constructors
Constructor
new BatchTokenDetailsArray<
T>(arrayLength):BatchTokenDetailsArray<T>
Defined in: site/node_modules/typescript/lib/lib.es5.d.ts:1513
Parameters
arrayLength
number
Returns
BatchTokenDetailsArray<T>
Inherited from
BaseTypedArray<BatchTokenDetailsArray<T>, BatchTokenDetails<T>>.constructor
Constructor
new BatchTokenDetailsArray<
T>(...items):BatchTokenDetailsArray<T>
Defined in: site/node_modules/typescript/lib/lib.es5.d.ts:1514
Parameters
items
...BatchTokenDetails<T>[]
Returns
BatchTokenDetailsArray<T>
Inherited from
BaseTypedArray<BatchTokenDetailsArray<T>, BatchTokenDetails<T>>.constructor
Methods
add()
add(
other):void
Defined in: packages/bitbadgesjs-sdk/src/core/batch-utils.ts:131
Adds token details to the batch details array. If the collectionId already exists, it will merge the tokenIds.
Parameters
other
BatchTokenDetailsArray<T> | iBatchTokenDetails<T> | iBatchTokenDetails<T>[]
Returns
void
convert()
convert<
U>(convertFunction,options?):BatchTokenDetailsArray<U>
Defined in: packages/bitbadgesjs-sdk/src/core/batch-utils.ts:124
Type Parameters
U
U extends NumberType
Parameters
convertFunction
(item) => U
options?
Returns
BatchTokenDetailsArray<U>
every()
every(
predicate,thisArg?):boolean
Defined in: packages/bitbadgesjs-sdk/src/common/typed-arrays.ts:108
Determines whether all the members of an array satisfy the specified test.
Parameters
predicate
(value, index, array) => unknown
A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.
thisArg?
any
An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
Returns
boolean
Inherited from
BaseTypedArray.every
getPage()
getPage(
_pageNumber,_pageSize,sortBy?):BatchTokenDetailsArray<T>
Defined in: packages/bitbadgesjs-sdk/src/core/batch-utils.ts:199
Get specific tokens for the batch details. Useful for displaying tokens on a page.
Assums that tokenIds are sorted, merged, and non-overlapping.
Parameters
_pageNumber
number
_pageSize
number
sortBy?
"newest" | "oldest"
Returns
BatchTokenDetailsArray<T>
isSubsetOf()
isSubsetOf(
other):boolean
Defined in: packages/bitbadgesjs-sdk/src/core/batch-utils.ts:179
Checks if the token details completely overlap with another set of token details (i.e. all tokenIds are in the other set).
Parameters
other
BatchTokenDetailsArray<T> | iBatchTokenDetails<T> | iBatchTokenDetails<T>[]
Returns
boolean
noneIn()
noneIn(
other):boolean
Defined in: packages/bitbadgesjs-sdk/src/core/batch-utils.ts:188
Checks if the token details do not overlap with another set of token details (i.e. none of the token IDs are in the other set).
Parameters
other
BatchTokenDetailsArray<T> | iBatchTokenDetails<T> | iBatchTokenDetails<T>[]
Returns
boolean
remove()
remove(
other):void
Defined in: packages/bitbadgesjs-sdk/src/core/batch-utils.ts:158
Removes token details from the batch details array. If the collectionId already exists, it will remove the tokenIds.
Parameters
other
BatchTokenDetailsArray<T> | iBatchTokenDetails<T> | iBatchTokenDetails<T>[]
Returns
void
From()
staticFrom<T>(arr):BatchTokenDetailsArray<T>
Defined in: packages/bitbadgesjs-sdk/src/core/batch-utils.ts:91
Type Parameters
T
T extends NumberType
Parameters
arr
iBatchTokenDetails<T> | iBatchTokenDetails<T>[] | BatchTokenDetailsArray<T>
Returns
BatchTokenDetailsArray<T>