Calculate transaction fees

Is there an RPC or API that can tell me easily what are the transaction fees on incognito?

For now, they have been just 0.0000001 PRV, but it might change in the future, right?

I have tried using the estimatefee RPC, but it ask me for a private key and token id that I must also have some balance in the account.

1 Like

Ok, so the estimatefee RPC have just gave me an answer, but I don’t know how to interpret it:

"Result": {
  "EstimateFee": 0,
  "EstimateFeeCoinPerKb": 0,
  "EstimateTxSizeInKb": 6
},

Does the 6 has to do with the 6 0s that the 0.0000001 have? So if the EstimateTxSizeInKb is 2, would the fee be 0.001?

1 Like

default min fee is : 1 NANO PRV => 1.0e-9 PRV
fee for a tx will calculate as : TxSize * 1 Nano PRV or you can TxSize * EstimateFee

when you call to estimate fee => avg from last some tx and return to you. Only PRV and Token which has pool size with PRV > 10000 PRV can use to transaction fee.

4 Likes

How can I get the tx size? And, from the result I was given, a 6, how can multiplying 6 * 1.0e-9 give 0.0000001?

1 Like

when you create raw data to make a transaction, just get size of bytes data.

estimateFeeCoinPerKb = 1e9    
estimateTxSizeInKb = transaction.EstimateTxSize(transaction.NewEstimateTxSizeParam(len(candidateOutputCoins), len(paymentInfos), hasPrivacy, metadata, privacyCustomTokenParams, limitFee))  
    realFee = uint64(estimateFeeCoinPerKb) * uint64(estimateTxSizeInKb)`
    fmt.Println(fmt.Sprintf("default fee: %v, estimate fee: %v, estimate tx size (kb) %v, real fee %v", defaultFee, estimateFeeCoinPerKb, estimateTxSizeInKb, realFee))
3 Likes