bitcoin-sv

Typescript type not supported by scrypt


I'm trying to use an array in my smart contract, however I'm getting this error:

Type instantiation is excessively deep and possibly infinite

let tokenid: FixedArray<ByteString,1000>;

Is it possible to use such type, and if so how should I use it?


Solution

  • It is a issue.

    try to install the latest hotfix version:

    npm i scrypt-ts@beta
    

    after that, you can do this:

    let tokenid: FixedArray<ByteString,1000> = fill(toByteString(""), 1000);