Warning: breaking change in the read smart contract function, you must now put the value in nanoMASSA.
Note: I can't convert the coins parameter in the call smart contract function because ICallData.coins is bigint, so the value in MASSA with a coma won't work. This is why I convert to MASSA in the read smart contract function. We can change the type of ICallData.coins to string or BigNumber if we don't want this breaking change.
Here is what we can do:
try {
const previousCoins = callData.coins;
callData.coins = BigInt(toMAS(callData.coins).toString()); // error here, can't create a BigInt for a string with decimal part
const response = await this.readSmartContract(callData)
callData.maxGas = BigInt(response.info.gas_cost)
callData.coins = previousCoins;
} catch (error) {
throw new Error(
`Operation failed: Max gas unspecified and auto-estimation failed. Error details: ${error.message}`
)
}
Warning: breaking change in the read smart contract function, you must now put the value in nanoMASSA.
Note: I can't convert the coins parameter in the call smart contract function because
ICallData.coins
isbigint
, so the value in MASSA with a coma won't work. This is why I convert to MASSA in the read smart contract function. We can change the type ofICallData.coins
to string or BigNumber if we don't want this breaking change.Here is what we can do: