DynamicArray
Defined in: arc4/encoded-types.ts:359
A dynamic sized array of arc4 items
Extends
Section titled “Extends”Arc4ArrayBase<TItem>
Type Parameters
Section titled “Type Parameters”TItem extends ARC4Encoded
The type of a single item in the array
Indexable
Section titled “Indexable”[index: uint64]: TItem
Get or set the item at the specified index. Negative indexes are not supported
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DynamicArray<
TItem>(…items):DynamicArray<TItem>
Defined in: arc4/encoded-types.ts:367
Create a new DynamicArray with the specified items
Parameters
Section titled “Parameters”…TItem[]
The initial items for the array
Returns
Section titled “Returns”DynamicArray<TItem>
Overrides
Section titled “Overrides”Arc4ArrayBase<TItem>.constructor
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get bytes():
bytes
Defined in: arc4/encoded-types.ts:102
Retrieve the encoded bytes for this type
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Arc4ArrayBase.bytes
length
Section titled “length”Get Signature
Section titled “Get Signature”get length():
uint64
Defined in: arc4/encoded-types.ts:245
Returns the current length of this array
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Arc4ArrayBase.length
Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
IterableIterator<TItem>
Defined in: arc4/encoded-types.ts:292
Returns an iterator for the items in this array
Returns
Section titled “Returns”IterableIterator<TItem>
Inherited from
Section titled “Inherited from”Arc4ArrayBase.[iterator]
at(
index):TItem
Defined in: arc4/encoded-types.ts:254
Returns the item at the given index. Negative indexes are taken from the end.
Parameters
Section titled “Parameters”The index of the item to retrieve
Returns
Section titled “Returns”TItem
Inherited from
Section titled “Inherited from”Arc4ArrayBase.at
concat()
Section titled “concat()”concat(
other):DynamicArray<TItem>
Defined in: arc4/encoded-types.ts:390
Returns a new array containing all items from this array, and other array
Parameters
Section titled “Parameters”Arc4ArrayBase<TItem>
Another array to concat with this one
Returns
Section titled “Returns”DynamicArray<TItem>
entries()
Section titled “entries()”entries():
IterableIterator<readonly [uint64,TItem]>
Defined in: arc4/encoded-types.ts:299
Returns an iterator for a tuple of the indexes and items in this array
Returns
Section titled “Returns”IterableIterator<readonly [uint64, TItem]>
Inherited from
Section titled “Inherited from”Arc4ArrayBase.entries
join()
Section titled “join()”join(
separator?):string
Defined in: arc4/encoded-types.ts:285
Creates a string by concatenating all the items in the array delimited by the specified separator (or ’,’ by default)
Parameters
Section titled “Parameters”separator?
Section titled “separator?”string
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”Arc4ArrayBase.join
keys()
Section titled “keys()”keys():
IterableIterator<uint64>
Defined in: arc4/encoded-types.ts:306
Returns an iterator for the indexes in this array
Returns
Section titled “Returns”IterableIterator<uint64>
Inherited from
Section titled “Inherited from”Arc4ArrayBase.keys
pop():
TItem
Defined in: arc4/encoded-types.ts:382
Pop a single item from this array
Returns
Section titled “Returns”TItem
push()
Section titled “push()”push(…
items):void
Defined in: arc4/encoded-types.ts:375
Push a number of items into this array
Parameters
Section titled “Parameters”…TItem[]
The items to be added to this array
Returns
Section titled “Returns”void
slice()
Section titled “slice()”Call Signature
Section titled “Call Signature”slice():
TItem[]
Defined in: arc4/encoded-types.ts:261
Returns
Section titled “Returns”TItem[]
Inherited from
Section titled “Inherited from”Arc4ArrayBase.slice
Call Signature
Section titled “Call Signature”slice(
end):TItem[]
Defined in: arc4/encoded-types.ts:267
Parameters
Section titled “Parameters”An index in which to stop copying items.
Returns
Section titled “Returns”TItem[]
Inherited from
Section titled “Inherited from”Arc4ArrayBase.slice
Call Signature
Section titled “Call Signature”slice(
start,end):TItem[]
Defined in: arc4/encoded-types.ts:274
Parameters
Section titled “Parameters”An index in which to start copying items.
An index in which to stop copying items
Returns
Section titled “Returns”TItem[]
Inherited from
Section titled “Inherited from”Arc4ArrayBase.slice