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've noticed that some queries (e.g., TransactionRecordQuery) charge the operator account a fee. For example, on localnet, after executing the following query:
by comparing the balance of the operator account before and after execution, there's a difference of 83,997 tinybars.
Is there an efficient way to determine this fee without comparing the operator's balance before and after execution?? Currently, I'm comparing the account balance before and after the query execution to determine the charged amount. To do this, I have to wait 200ms for each balance query for the balances to properly updated to get the accurate balance—totaling 400ms for one request (before and after). Depending on the size of the callData, a single client call (eth_sendRawTransaction) can involve multiple requests (10+ or even 20+), which significantly increases the total wait time just to calculate the balance difference. I'm hoping there's a better and more performance-oriented method to figure out this cost
I've tried the <query>.getCost() method, but it always returns 9 tinybars, and I'm not sure what that amount is for.
Solution
Add an API in the query class to expose this charged fee natively.
Alternatives
No response
The text was updated successfully, but these errors were encountered:
I think this feature you offer would be a good addition. We did some research and we think this would not be handled on SDK level but we are considering other options that can solve your issue. Will keep you updated on any news that can help you.
Problem
I've noticed that some queries (e.g.,
TransactionRecordQuery
) charge the operator account a fee. For example, on localnet, after executing the following query:by comparing the balance of the operator account before and after execution, there's a difference of 83,997 tinybars.
Is there an efficient way to determine this fee without comparing the operator's balance before and after execution?? Currently, I'm comparing the account balance before and after the query execution to determine the charged amount. To do this, I have to wait 200ms for each balance query for the balances to properly updated to get the accurate balance—totaling 400ms for one request (before and after). Depending on the size of the callData, a single client call (eth_sendRawTransaction) can involve multiple requests (10+ or even 20+), which significantly increases the total wait time just to calculate the balance difference. I'm hoping there's a better and more performance-oriented method to figure out this cost
I've tried the
<query>.getCost()
method, but it always returns 9 tinybars, and I'm not sure what that amount is for.Solution
Add an API in the query class to expose this charged fee natively.
Alternatives
No response
The text was updated successfully, but these errors were encountered: