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
I have tried to start with a fresh project and reproduce the defect with minimal code changes.
I have read the console error messages carefully (if applicable).
Description
While working on auditing the docs near/docs#1545 we found an error in the cross-contract calls written in typescript.
Currently there is an error in the type PromiseIndex. It is defined as (number | bigint) & PromiseIndexBrand. Since & is the intersection operator, and PromiseIndexBrand == -1, then the only valid value is -1.
This is a bug, since a PromiseIndex of 1, 2... etc should be valid
Reproducible demo
No response
Steps to reproduce
Create a ts contract, try to use near.promiseResult(0), you will get an error since 0 is not PromiseIndexBrand === -1
Expected behavior
near.promiseResult(0) should work.
Actual behavior
Gives a type error
Your environment
NEAR JavaScript SDK version used: 1.0.0
Self-service
I'd be willing to fix this bug myself.
The text was updated successfully, but these errors were encountered:
Prerequisites
near-sdk-js
.Description
While working on auditing the docs near/docs#1545 we found an error in the cross-contract calls written in typescript.
Currently there is an error in the type PromiseIndex. It is defined as
(number | bigint) & PromiseIndexBrand
. Since&
is the intersection operator, andPromiseIndexBrand == -1
, then the only valid value is-1
.This is a bug, since a
PromiseIndex
of 1, 2... etc should be validReproducible demo
No response
Steps to reproduce
Create a
ts
contract, try to usenear.promiseResult(0)
, you will get an error since 0 is notPromiseIndexBrand === -1
Expected behavior
near.promiseResult(0)
should work.Actual behavior
Gives a type error
Your environment
Self-service
The text was updated successfully, but these errors were encountered: