+ The migration request has now been accepted on chain. We will
+ process the request in the background. Receiving your DUSK might
+ take some time. Check your wallet balance again later.
+
+
{/if}
-
+
{/if}
{#if !walletState.isConnected}
@@ -410,12 +406,25 @@
gap: var(--default-gap);
padding: 1.25em;
+ &__wizard {
+ margin-top: var(--default-gap);
+ gap: 1.25em;
+ display: flex;
+ flex-direction: column;
+ }
+
&__execute {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--default-gap);
- padding: 2.25em 0;
+
+ &-approval {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: var(--default-gap);
+ }
}
&__header {
@@ -445,12 +454,6 @@
align-items: center;
}
- &__progress-notice {
- padding: 1em 1.375em;
- border-radius: 1.5em;
- border: 1px solid var(--primary-color);
- }
-
&__token-header {
font-weight: 500;
}
diff --git a/web-wallet/src/lib/contracts/contract-descriptors.js b/web-wallet/src/lib/contracts/contract-descriptors.js
index fc1eca8a1..3cf391d91 100644
--- a/web-wallet/src/lib/contracts/contract-descriptors.js
+++ b/web-wallet/src/lib/contracts/contract-descriptors.js
@@ -57,7 +57,9 @@ export default [
],
},
{
- enabled: import.meta.env.VITE_FEATURE_MIGRATE === "true",
+ enabled:
+ import.meta.env.VITE_FEATURE_MIGRATE === "true" &&
+ import.meta.env.VITE_REOWN_PROJECT_ID !== "",
id: "migrate",
label: "Migrate",
operations: [
diff --git a/web-wallet/src/lib/migration/walletConnection.js b/web-wallet/src/lib/migration/walletConnection.js
index 8eeae9397..de61b7b27 100644
--- a/web-wallet/src/lib/migration/walletConnection.js
+++ b/web-wallet/src/lib/migration/walletConnection.js
@@ -5,14 +5,25 @@ import { bsc, mainnet, sepolia } from "@reown/appkit/networks";
import { disconnect, getAccount, getBalance, watchAccount } from "@wagmi/core";
import { readable } from "svelte/store";
-// Required project metadata
-const projectId = "b5303e1c8374b100fbb7f181884fef28";
-const metadata = {
- description: "Dusk Web-Wallet",
- icons: [],
- name: "Dusk Migration",
- url: "https://127.0.0.1:5173/dashboard/",
-};
+/**
+ * @constant {string} projectId - The ID of the project, sourced from an environment variable.
+ *
+ * @description
+ * This constant retrieves the project ID from the environment variable `VITE_REOWN_PROJECT_ID`.
+ * If the environment variable is not set, it defaults to an empty string. This behavior is not ideal
+ * because an empty `projectId` will cause the modal initialization to fail.
+ *
+ * While this issue typically arises due to a developer error (e.g., forgetting to set the environment variable),
+ * resolving it properly requires a broader refactor of the codebase to better handle missing or invalid `projectId` values.
+ *
+ * Additionally, when the `projectId` is missing, the "migrate" functionality will not be accessible in the UI,
+ * effectively hiding the "broken" flow. Therefore, while the error can occur, users are unlikely to encounter it.
+ *
+ * **To improve:**
+ * Consider implementing a mechanism to ensure `VITE_REOWN_PROJECT_ID` is always defined during the build or
+ * runtime processes, potentially throwing a clear error during startup if it is missing.
+ */
+const projectId = import.meta.env.VITE_REOWN_PROJECT_ID || "";
/** @typedef {import("@reown/appkit/networks").AppKitNetwork} AppKitNetwork */
/** @type {[AppKitNetwork, ...AppKitNetwork[]]} */
@@ -33,7 +44,6 @@ export const modal = createAppKit({
onramp: false,
swaps: false,
},
- metadata,
networks,
projectId,
themeMode: "dark",
diff --git a/web-wallet/vite.config.js b/web-wallet/vite.config.js
index 6057f5941..f7e515fdf 100644
--- a/web-wallet/vite.config.js
+++ b/web-wallet/vite.config.js
@@ -50,6 +50,7 @@ export default defineConfig(({ mode }) => {
VITE_GAS_PRICE_LOWER: env.VITE_GAS_PRICE_LOWER,
VITE_GAS_PRICE_UPPER: env.VITE_GAS_PRICE_UPPER,
VITE_NODE_URL: env.VITE_NODE_URL,
+ VITE_REOWN_PROJECT_ID: env.VITE_REOWN_PROJECT_ID,
},
},
plugins: