Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass treatAsGrossAmount if set to False in create_transaction #196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

knaperek
Copy link
Contributor

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:

treatAsGrossAmount
The value is false by default. If it is set to true, the network fee is deducted from the requested amount.

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 the treat_as_gross_amount parameter is None 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 the create_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]

  1. Yes, the transaction will not be treated as gross unless the whole account vault balance is spent.
  2. If the treatAsGrossAmount is set in the transaction parameters, then the transaction will follow this field. If you send a transaction with the treatAsGrossAmount as false but the entire vault balance amount, then the transaction will fail with insufficient funds.

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:
>>> treatAsGrossAmount
>>> The value is false by default. If it is set to true, the network fee is deducted from the requested amount.

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 the `treat_as_gross_amount` parameter is `None` 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 the `create_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]
1. Yes, the transaction will not be treated as gross unless the whole account vault balance is spent.
2. If the treatAsGrossAmount is set in the transaction parameters, then the transaction will follow this field. If you send a transaction with the treatAsGrossAmount as false but the entire vault balance amount, then the transaction will fail with insufficient funds.
@knaperek
Copy link
Contributor Author

The official docs have been updated now, acknowledging this edge case.
So now it's just a matter of this SDK to handle it properly, which will be achieved by merging this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant