Skip to content
New issue

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

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

Already on GitHub? # to your account

How can i calculate the transaction size or fee ? #37

Closed
bajian opened this issue Feb 16, 2022 · 1 comment
Closed

How can i calculate the transaction size or fee ? #37

bajian opened this issue Feb 16, 2022 · 1 comment

Comments

@bajian
Copy link

bajian commented Feb 16, 2022

As i known ,fees are constructed around two constants (a and b). The formula for calculating minimal fees for a transaction (tx) is a * size(tx) + b, where:
a/b are protocol parameters
size(tx) is the transaction size in bytes

Here,i want to get the size of the tx.So that ,i can estimate the fee.

I searched the dev docs and found the cli cammand below

cardano-cli transaction calculate-min-fee \
--tx-body-file tx.draft \
--tx-in-count 1 \
--tx-out-count 1 \
--witness-count 1 \
--byron-witness-count 0 \
--testnet-magic 1097911063 \
--protocol-params-file protocol.json

This is what i need, and i want to know is there any method can implement the similar function with this js framework?

@bajian
Copy link
Author

bajian commented Feb 16, 2022

@bajian bajian closed this as completed Feb 16, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant