TimeRange uint64 `json:"time_range"`
Inputs []*query.AnnotatedInput `json:"inputs"`
Outputs []*query.AnnotatedOutput `json:"outputs"`
+ Fee uint64 `json:"fee"`
}
// POST /get-raw-transaction
tx.Outputs = append(tx.Outputs, a.wallet.BuildAnnotatedOutput(&ins.Tx, i))
}
+ totalInputBtm := uint64(0)
+ totalOutputBtm := uint64(0)
+ for _, input := range tx.Inputs {
+ if input.AssetID.String() == consensus.BTMAssetID.String() {
+ totalInputBtm += input.Amount
+ }
+ }
+
+ for _, output := range tx.Outputs {
+ if output.AssetID.String() == consensus.BTMAssetID.String() {
+ totalOutputBtm += output.Amount
+ }
+ }
+
+ tx.Fee = totalInputBtm - totalOutputBtm
return NewSuccessResponse(tx)
}