Skip to main content

FixedArray

scrypt-ts-opcat v1.0.1


scrypt-ts-opcat / FixedArray

Type Alias: FixedArray\<T, N>

FixedArray\<T, N>: T[] & object

Defined in: packages/scrypt-ts-opcat/src/smart-contract/types/primitives.ts:208

An array is a fixed-size list of values of the same basic type. When you declare an array you have to declare it like this:

Type declaration

length

length: N

Type Parameters

T

N extends number

Onchain

Example

let aaa: FixedArray<bigint, 3> = [1n, 3n, 3n];

let abb: FixedArray<FixedArray<bigint, 2>, 3> = [[1n, 3n], [1n, 3n], [1n, 3n]];

let bbb: FixedArray<FixedArray<FixedArray<bigint, 1>, 2>, 3> = [[[1n], [1n]], [[1n], [1n]], [[1n], [1n]]];