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
Currently, the CLI statically targets es5 for compiling contracts, but this makes certain things within the SDK hard to do like performing arithmetic on the values returned from the API (I don't know if another target fixes this) or using bigint literals (like 100n to signify a big int).
I don't even know what the recommended way to perform a simple action like:
near.prepaidGas()-5000000
The closest thing I could find would be:
Number(near.prepaidGas())-5000000
but this is absolutely horrible because on overflow it just cuts off bits and doesn't error. Casting the BigInt to any or casting the right operand to BigInt seems to throw an error
The text was updated successfully, but these errors were encountered:
It seems that we should use es2020 for compiling target, as bigint is in es2020 and quickjs support that. I'll check typescript decorator still works under that setting.
Currently, the CLI statically targets es5 for compiling contracts, but this makes certain things within the SDK hard to do like performing arithmetic on the values returned from the API (I don't know if another target fixes this) or using bigint literals (like
100n
to signify a big int).I don't even know what the recommended way to perform a simple action like:
The closest thing I could find would be:
but this is absolutely horrible because on overflow it just cuts off bits and doesn't error. Casting the BigInt to
any
or casting the right operand toBigInt
seems to throw an errorThe text was updated successfully, but these errors were encountered: