Pass treatAsGrossAmount if set to False in create_transaction #196
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: Despite the docs currently suggesting False is the default, it is not always the case as explained by Ricky Chen, Fireblocks Platinum Support Engineer, in Fireblocks support ticket 183501.
Excerpt from the thread:
[Jozef Knaperek]
Citing the docs:
Ref: https://developers.fireblocks.com/reference/create-transactions#treatasgrossamount
We do not set anything explicitly in the Python SDK when calling the
create_transaction
method, where thetreat_as_gross_amount
parameter isNone
by default. Looking at the SDK code, it is obvious that the parameter does not get sent unless it's set to True, so it wouldn't make any difference even if we set it to False explicitly when calling thecreate_transaction
method.I'm thinking, and this is where I'd like your input to confirm or correct my hypothesis, maybe the default behavior of Fireblocks is to NOT treat the transactions as gross UNLESS the whole vault account balance is about to be spent. In that special case Fireblocks defaults to treating the transaction as gross (despite the docs not mentioning this edge case). Can you please confirm if this statement is factually correct?
Now, second question is whether Fireblocks ALWAYS respects the
treatAsGrossAmount
request parameter, if provided explicitly (no matter if true or false). If so, will it respect the parameter value even if set to false while attempting to spend the whole Vault Account balance? What is the behavior in that case?If the answer is YES for both questions, then I suggest fixing the SDK code to pass the treatAsGrossAmount parameter at all times (even if it's False). I can send a pull request fixing this as long as my hypothesis is correct.
Thank you Ricky, it's been a huge mystery but I feel we're coming closer to the resolution finally :-)
[Ricky Chen]