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
In this example, the attached amount should be a string, however, if I send a number instead (by using a parseInt) the explorer will tell that attached amount is zero.
I would expect that near-api-js tells me something like
method_name attachedDeposit type error expecting string
await contract.method_name(
{
arg_name: "value", // argument name and value - pass empty object if no args required
},
"300000000000000", // attached GAS (optional)
parseInt("1000000000000000000000000") // attached deposit in yoctoNEAR (optional)
);
Expected behavior
Error: method_name attachedDeposit type error expecting string
Actual behavior
Transaction runs a successfultx but the explorer shows attached amount as zero.
Your environment
NEAR JavaScript API version used: 1.0
Frontend framework (if applicable):
Relevant dependencies (if applicable):
Self-service
I'd be willing to fix this bug myself.
The text was updated successfully, but these errors were encountered:
Prerequisites
near-api-js
.Description
Take this snippet as an example
https://docs.near.org/tools/near-api-js/contract#call-contract
In this example, the attached amount should be a string, however, if I send a number instead (by using a parseInt) the explorer will tell that attached amount is zero.
I would expect that near-api-js tells me something like
Reproducible demo
No response
Steps to reproduce
Run this snippet
https://docs.near.org/tools/near-api-js/contract#call-contract
Expected behavior
Actual behavior
Transaction runs a successfultx but the explorer shows attached amount as zero.
Your environment
Self-service
The text was updated successfully, but these errors were encountered: