diff --git a/next.config.js b/next.config.js
index 24d18788a..5a34efd5a 100644
--- a/next.config.js
+++ b/next.config.js
@@ -258,6 +258,11 @@ const nextConfig = {
destination: "/transaction/build",
permanent: true,
},
+ {
+ source: "/transaction/sign",
+ destination: "/transaction/import",
+ permanent: true,
+ },
];
},
};
diff --git a/src/app/(sidebar)/transaction/cli-sign/page.tsx b/src/app/(sidebar)/transaction/cli-sign/page.tsx
index 1f8a6edb7..48e59a790 100644
--- a/src/app/(sidebar)/transaction/cli-sign/page.tsx
+++ b/src/app/(sidebar)/transaction/cli-sign/page.tsx
@@ -8,17 +8,26 @@ import { Routes } from "@/constants/routes";
import { NetworkOptions } from "@/constants/settings";
import { useStore } from "@/store/useStore";
import { trackEvent, TrackingEvent } from "@/metrics/tracking";
-
+import { useImportFlowStore } from "@/store/createTransactionFlowStore";
+import { delayedAction } from "@/helpers/delayedAction";
+
+/**
+ * Deep-link adapter for the Stellar CLI sign flow.
+ *
+ * The CLI opens `/transaction/cli-sign?xdr=...&networkPassphrase=...`. We
+ * select the matching network, hand the XDR off to the import flow store, and
+ * redirect to the import page — which parses the envelope and renders the
+ * transaction overview.
+ */
export default function CliSignTransaction() {
- const { network, updateIsDynamicNetworkSelect, transaction, selectNetwork } =
- useStore();
+ const { updateIsDynamicNetworkSelect, selectNetwork } = useStore();
+ const { resetAll, setImportXdr } = useImportFlowStore();
const searchParams = useSearchParams();
-
- const getNetworkByPassphrase = (passphrase: string) => {
- return NetworkOptions.find((network) => network.passphrase === passphrase);
- };
const router = useRouter();
+ const getNetworkByPassphrase = (passphrase: string) =>
+ NetworkOptions.find((network) => network.passphrase === passphrase);
+
useEffect(() => {
const networkPassphrase = searchParams?.get("networkPassphrase");
const xdr = searchParams?.get("xdr");
@@ -32,16 +41,22 @@ export default function CliSignTransaction() {
}
if (xdr) {
- transaction.updateSignActiveView("overview");
- transaction.updateSignImportXdr(xdr);
+ resetAll();
+ setImportXdr(xdr);
}
trackEvent(TrackingEvent.TRANSACTION_CLI_SIGN);
- router.push(Routes.SIGN_TRANSACTION);
- // Not including other deps
+ delayedAction({
+ action() {
+ router.push(Routes.IMPORT_TRANSACTION);
+ },
+ delay: 0,
+ });
+
+ // Run once for the deep link's search params; the import page owns parsing.
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [transaction.sign.importXdr, network.id]);
+ }, [searchParams]);
return