Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5303861
add initial version of displaying better minResourceFee
leofelix077 Mar 11, 2026
b015fd6
adjust ui and translations for fee details
leofelix077 Mar 11, 2026
e379415
Update extension/src/popup/locales/pt/translation.json
leofelix077 Mar 12, 2026
407a8d3
adjust ui for feesPane and add e2e tests
leofelix077 Mar 13, 2026
eb37241
Merge branch 'feature/improve-resource-fee-display-on-send' of github…
leofelix077 Mar 13, 2026
fcaa0be
Potential fix for pull request finding
leofelix077 Mar 16, 2026
3642b9d
Potential fix for pull request finding
leofelix077 Mar 16, 2026
a77b6f5
fix ui styles and padding
leofelix077 Mar 16, 2026
2e3e0a6
extract types to shard and update fees pane padding
leofelix077 Mar 16, 2026
a134d03
Merge branch 'master' into feature/improve-resource-fee-display-on-send
leofelix077 Mar 16, 2026
0e156b2
move SimulateTxData to shared types and fix FeesPane padding
leofelix077 Mar 17, 2026
cc18c3a
fix soroban rpc url for simulate transaction
leofelix077 Mar 20, 2026
deb8b32
Merge branch 'feature/improve-resource-fee-display-on-send' of https:…
leofelix077 Mar 20, 2026
5ea2d52
add initial version of displaying better minResourceFee
leofelix077 Mar 11, 2026
7b9be74
adjust ui and translations for fee details
leofelix077 Mar 11, 2026
53f89db
adjust ui for feesPane and add e2e tests
leofelix077 Mar 13, 2026
5b55348
Update extension/src/popup/locales/pt/translation.json
leofelix077 Mar 12, 2026
38e0253
Potential fix for pull request finding
leofelix077 Mar 16, 2026
92c8981
Potential fix for pull request finding
leofelix077 Mar 16, 2026
604a420
fix ui styles and padding
leofelix077 Mar 16, 2026
50ab260
extract types to shard and update fees pane padding
leofelix077 Mar 16, 2026
e433ac0
fix soroban rpc url for simulate transaction
leofelix077 Mar 20, 2026
012ea77
move SimulateTxData to shared types and fix FeesPane padding
leofelix077 Mar 17, 2026
8ee56e2
Merge branch 'master' into feature/improve-resource-fee-display-on-send
leofelix077 Apr 1, 2026
ac05652
Merge branch 'feature/improve-resource-fee-display-on-send' of https:…
leofelix077 Apr 2, 2026
32a4eea
fix manually set fee persistence inside flow and add e2e tests
leofelix077 Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions @shared/api/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2208,6 +2208,7 @@ export const simulateTransaction = async (args: {
body: JSON.stringify({
xdr,
network_passphrase: networkDetails.networkPassphrase,
network_url: networkDetails.sorobanRpcUrl,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this change needed? It's actually only used for Soroswap, which is disabled right now

Copy link
Copy Markdown
Collaborator Author

@leofelix077 leofelix077 Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was throwing an error when trying to submit a collectible, mentioning it's a required field by the backend. on my MP collectibles

}),
};
const res = await fetch(`${INDEXER_URL}/simulate-tx`, options);
Expand Down
823 changes: 823 additions & 0 deletions extension/e2e-tests/reviewTxFees.test.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Button, Card, Input } from "@stellar/design-system";
import React, { useRef } from "react";
import { Button, Card, Icon, Input } from "@stellar/design-system";
import { Field, FieldProps, Formik, Form } from "formik";
import { useTranslation } from "react-i18next";

Expand All @@ -17,7 +17,10 @@ interface EditSettingsProps {
timeout: number;
congestion: string;
title: string;
isSoroban?: boolean;
onClose: () => void;
onFeeChange?: (fee: string) => void;
onShowFeesInfo?: (currentDraftFee: string) => void;
onSubmit: (args: EditSettingsFormValue) => void;
}

Expand All @@ -26,10 +29,16 @@ export const EditSettings = ({
timeout,
congestion,
title,
isSoroban = false,
onClose,
onFeeChange,
onShowFeesInfo,
onSubmit,
}: EditSettingsProps) => {
const { t } = useTranslation();
// Tracks the current draft fee so onShowFeesInfo can pass it to the parent
// for an accurate FeesPane total without requiring a Redux save first.
const draftFeeRef = useRef<string>(fee);
const initialValues: EditSettingsFormValue = {
fee,
timeout,
Expand All @@ -38,6 +47,23 @@ export const EditSettings = ({
onSubmit(values);
};

const feeLabel = (
<span className="EditTxSettings__fee-label">
{isSoroban ? t("Inclusion Fee") : t("Transaction Fee")}
{isSoroban && onShowFeesInfo && (
<button
className="EditTxSettings__fee-info-btn"
type="button"
onClick={() => onShowFeesInfo?.(draftFeeRef.current)}
aria-label={t("Fee breakdown")}
data-testid="edit-settings-fees-info-btn"
>
<Icon.InfoCircle />
</button>
)}
</span>
);

return (
<div className="EditTxSettings">
<Card>
Expand All @@ -57,13 +83,15 @@ export const EditSettings = ({
autoComplete="off"
id="fee"
placeholder={t("Fee")}
label={t("Transaction Fee")}
label={feeLabel}
{...field}
error={errors.fee}
onChange={(e) => {
let value = e.target.value;
if (value === "") {
setFieldValue("fee", "");
draftFeeRef.current = "";
onFeeChange?.("");
return;
}

Expand All @@ -76,13 +104,19 @@ export const EditSettings = ({
}

setFieldValue("fee", value);
draftFeeRef.current = value;
onFeeChange?.(value);
}}
rightElement={
<Button
type="button"
size="md"
variant="tertiary"
onClick={() => setFieldValue("fee", fee)}
onClick={() => {
setFieldValue("fee", fee);
draftFeeRef.current = fee;
onFeeChange?.(fee);
}}
>
{t("Default")}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,31 @@
}
}

&__fee-label {
display: inline-flex;
align-items: center;
gap: pxToRem(4px);
}

&__fee-info-btn {
background: none;
border: none;
cursor: pointer;
padding: 0;
display: inline-flex;
align-items: center;
color: var(--sds-clr-gray-09);

svg {
width: pxToRem(14px);
height: pxToRem(14px);
}

&:hover {
color: var(--sds-clr-gray-12);
}
}

&__actions {
display: flex;
margin-top: pxToRem(32px);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import React from "react";
import { Icon } from "@stellar/design-system";
import { useTranslation } from "react-i18next";

import { RequestState, State } from "constants/request";
import { SimulateTxData } from "types/transactions";

import "./styles.scss";

export interface FeesPaneProps {
fee: string;
simulationState: State<SimulateTxData, string>;
isSoroban?: boolean;
onClose: () => void;
}

export const FeesPane = ({
fee,
simulationState,
isSoroban = false,
onClose,
}: FeesPaneProps) => {
const { t } = useTranslation();

const isLoading =
simulationState.state === RequestState.IDLE ||
simulationState.state === RequestState.LOADING;

return (
<div className="FeesPane" data-testid="review-tx-fees-pane">
<div className="FeesPane__Header">
<div className="FeesPane__Header__Icon">
<Icon.Route />
</div>
<button
type="button"
className="FeesPane__Header__Close"
data-testid="review-tx-fees-close-btn"
onClick={onClose}
aria-label={t("Close")}
>
<Icon.X />
</button>
</div>
<div className="FeesPane__Title">
<span>{t("Fees")}</span>
</div>
<div className="FeesPane__Card">
{!isLoading && simulationState.data?.inclusionFee && (
<div className="FeesPane__Card__Row">
<span className="FeesPane__Card__Row__Label">
{t("Inclusion Fee")}
</span>
<span
className="FeesPane__Card__Row__Value"
data-testid="review-tx-inclusion-fee"
>
{simulationState.data.inclusionFee} XLM
</span>
</div>
)}
{!isLoading && simulationState.data?.resourceFee && (
<div className="FeesPane__Card__Row">
<span className="FeesPane__Card__Row__Label">
{t("Resource Fee")}
</span>
<span
className="FeesPane__Card__Row__Value"
data-testid="review-tx-resource-fee"
>
{simulationState.data.resourceFee} XLM
</span>
</div>
)}
<div className="FeesPane__Card__Row">
<span className="FeesPane__Card__Row__Label FeesPane__Card__Row__Label--total">
{t("Total Fee")}
</span>
<span
className="FeesPane__Card__Row__Value FeesPane__Card__Row__Value--total"
data-testid="review-tx-total-fee"
>
{isLoading ? t("Calculating...") : `${fee} XLM`}
</span>
</div>
</div>
<div
className="FeesPane__Description"
data-testid="review-tx-fees-description"
>
{isSoroban
? t("Fees description soroban")
: t("Fees description classic")}
</div>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
@use "../../../styles/utils.scss" as *;

.FeesPane {
display: flex;
flex-direction: column;
width: 100%;
padding: 0 0;
gap: pxToRem(16px);

.multi-pane-slider & {
padding: 0;
}

&__Header {
display: flex;
justify-content: space-between;
align-items: center;

&__Icon {
display: flex;
width: pxToRem(32px);
height: pxToRem(32px);
justify-content: center;
align-items: center;
border-radius: pxToRem(8px);
background: var(--sds-clr-lilac-03);
border: 1px solid var(--sds-clr-lilac-06);

svg {
width: pxToRem(20px);
height: pxToRem(20px);
color: var(--sds-clr-lilac-09);
}
}

&__Close {
display: flex;
width: pxToRem(32px);
height: pxToRem(32px);
justify-content: center;
align-items: center;
border-radius: 1000px;
background: var(--sds-clr-gray-03);
color: var(--sds-clr-gray-09);
cursor: pointer;
}
}

&__Title {
display: flex;
align-items: center;
width: 100%;
font-size: pxToRem(18px);
font-weight: var(--font-weight-medium);
}

&__Card {
display: flex;
flex-direction: column;
border-radius: pxToRem(16px);
background-color: var(--sds-clr-gray-03);
padding: pxToRem(4px) pxToRem(16px);

&__Row {
display: flex;
justify-content: space-between;
align-items: center;
padding: pxToRem(12px) 0;

&:not(:last-child) {
border-bottom: 1px solid var(--sds-clr-gray-06);
}

&__Label {
font-size: pxToRem(14px);
font-weight: var(--font-weight-medium);
color: var(--sds-clr-gray-11);

&--total {
color: var(--sds-clr-lilac-11);
}
}

&__Value {
font-size: pxToRem(14px);
font-weight: var(--font-weight-medium);
color: var(--sds-clr-gray-12);

&--total {
color: var(--sds-clr-lilac-11);
}
}
}
}

&__Description {
color: var(--sds-clr-gray-11);
font-size: pxToRem(14px);
line-height: pxToRem(20px);
}
}
Loading
Loading