You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.
Looking at collections.Vector there is no way to return the values in the vector to the outside world. In order to return the whole vector from the contract, I have something like
However outside of the nearlib, I can't use generic types, and instead of patching the vector class myself, wanted to see if it could be added to the lib.
Another note: The type of the class can have [key: number]: T; added to it, and then x[0] is typed correctly (right now there is a typescript warning).
The text was updated successfully, but these errors were encountered:
Instead of casting entire vector to array, we should instead expose a getRange (or getSubarray) function, that takes (index, length) and returns an array of [index,index+length) elements. By default it can take index=0 and length=-1, which would return full vector.
Because a persistent vector may grow beyond smart contract ram, toArray may not fit into allocated memory.
Looking at
collections.Vector
there is no way to return the values in the vector to the outside world. In order to return the whole vector from the contract, I have something likeHowever outside of the nearlib, I can't use generic types, and instead of patching the vector class myself, wanted to see if it could be added to the lib.
Another note: The type of the class can have
[key: number]: T;
added to it, and thenx[0]
is typed correctly (right now there is a typescript warning).The text was updated successfully, but these errors were encountered: