Skip to content

Commit b8cde46

Browse files
saledjenicjrainville
authored andcommitted
fix(wallet): enhance route fetching and fee estimation logic for gasless Status chain
1 parent c7fa6da commit b8cde46

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

ui/app/mainui/SendModalHandler.qml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,24 @@ QtObject {
729729
}
730730

731731
readonly property var totalFeesAggregator: FunctionAggregator {
732-
model: !!handler.fetchedPathModel ?
733-
handler.fetchedPathModel: null
732+
model: {
733+
let noFees = true
734+
for (let i = 0; i < handler.fetchedPathModel.ModelCount.count; i++) {
735+
const item = SQUtils.ModelUtils.get(handler.fetchedPathModel, i)
736+
noFees = noFees && item["fromChainNoBaseFee"] && item["fromChainNoPriorityFee"]
737+
if (!noFees) {
738+
break
739+
}
740+
}
741+
742+
if (noFees) {
743+
const nativeTokenSymbol = Utils.getNativeTokenSymbol(simpleSendModal.selectedChainId)
744+
simpleSendModal.estimatedCryptoFees = root.fnFormatCurrencyAmount("0", nativeTokenSymbol)
745+
simpleSendModal.estimatedFiatFees = root.fnFormatCurrencyAmount("0", root.currentCurrency)
746+
}
747+
748+
return !!handler.fetchedPathModel? handler.fetchedPathModel: null
749+
}
734750
initialValue: "0"
735751
roleName: "txTotalFee"
736752

0 commit comments

Comments
 (0)