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

Create a hook to calculate the tx fee using given parameters #4716

Closed
Tracked by #4341
reyraa opened this issue Jan 13, 2023 · 1 comment
Closed
Tracked by #4341

Create a hook to calculate the tx fee using given parameters #4716

reyraa opened this issue Jan 13, 2023 · 1 comment

Comments

@reyraa
Copy link
Contributor

reyraa commented Jan 13, 2023

Description

We should be able to calculate transaction fees using on the following formula:

minimum fee + command fee + tie breaker

The fee also includes values such as

  • Account initialization fee
  • Cross chain initialization fee

A desired response should include the total fee and the components creating it:

[
 { value: 523000, type: 'total' },
 { value: 123000, type: 'minFee' },
 { value:  500000, type: 'commandFee'}
]

Minimum fee
We calculate the minimum fee based on the transaction size.

Command fee
We fetch this value from Lisk Service. This value is defined by the blockchain application developer.

Tie breaker
This is also a value to fetched. This value takes the transaction pool status into account.

Acceptance Criteria

  • Create a hook to calculate the minimum fee using computeMinFee function from Lisk Elements.
  • Use correct transaction schema for calculation of minimum fee.
  • The response should be in the explained form.
  • Secure the logic using unit tests.
@reyraa
Copy link
Contributor Author

reyraa commented Jan 24, 2023

Resolved by #4712

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants