Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5,263 changes: 1,671 additions & 3,592 deletions examples/demo-app/package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions examples/demo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"preview": "vite preview"
},
"dependencies": {
"@toruslabs/base-controllers": "^8.5.2",
"@toruslabs/ethereum-controllers": "^8.5.2",
"@toruslabs/base-controllers": "^9.9.1",
"@toruslabs/ethereum-controllers": "^9.9.1",
"@toruslabs/torus-embed": "file:../../",
"@toruslabs/vue-components": "^8.0.8",
"@toruslabs/vue-components": "^9.0.1",
"ethers": "^6.13.5",
"vue": "^3.5.17"
"vue": "^3.5.33"
},
"devDependencies": {
"@vitejs/plugin-vue": "^6.0.0",
"@vitejs/plugin-vue": "^6.0.6",
"buffer": "^6.0.3",
"process": "^0.11.10",
"tailwindcss": "^3.4.10",
"vite": "^7.0.4"
"@tailwindcss/vite": "^4.2.4",
"vite": "8.0.9"
}
}
6 changes: 0 additions & 6 deletions examples/demo-app/postcss.config.cjs

This file was deleted.

28 changes: 14 additions & 14 deletions examples/demo-app/src/components/Dashboard/Dashboard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { computed, onBeforeMount, ref } from 'vue';
import { MAINNET_CHAIN_ID, POLYGON_AMOY_CHAIN_ID, SEPOLIA_CHAIN_ID, SUPPORTED_NETWORKS } from '@toruslabs/ethereum-controllers';
import { DEFAULT_SUPPORTED_NETWORKS, MAINNET_CHAIN_ID, POLYGON_AMOY_CHAIN_ID, SEPOLIA_CHAIN_ID } from '@toruslabs/ethereum-controllers';
import Torus from '@toruslabs/torus-embed';
import { Loader } from "@toruslabs/vue-components/Loader";
import Button from "../Button";
Expand All @@ -16,7 +16,7 @@ const WS_EMBED_BUILD_ENV = {

let torus = undefined;

const supportedNetworks = SUPPORTED_NETWORKS
const supportedNetworks = DEFAULT_SUPPORTED_NETWORKS

const isLoading = ref(false);
const account = ref("");
Expand All @@ -35,13 +35,11 @@ const formattedAccountAddress = computed(() => {
onBeforeMount(async () => {
try {
isLoading.value = true;
torus = new Torus();
torus = new Torus({
web3AuthClientId: "BJRZ6qdDTbj6Vd5YXvV994TYCqY42-PxldCetmvGTUdoq6pkCqdpuC1DIehz76zuYdaq1RJkXGHuDraHRhCQHvA",
});

const wsEmbedBuildEnv = sessionStorage.getItem("ws_embed_build_env");
if (wsEmbedBuildEnv) {
selectedBuildEnv.value = wsEmbedBuildEnv;
await initializeTorus();
}
await initializeTorus();
} catch (error) {
console.error(error);
} finally {
Expand All @@ -58,15 +56,17 @@ const initializeTorus = async () => {
const preferredChain = localStorage.getItem("preferred_chain") || SEPOLIA_CHAIN_ID;
const chainConfig = supportedNetworks[preferredChain];
preferredChainConfig.value = chainConfig;
// const chains = Object.values(supportedNetworks).filter((chain) =>
// [MAINNET_CHAIN_ID, POLYGON_AMOY_CHAIN_ID, SEPOLIA_CHAIN_ID].includes(
// chain.chainId
// )
// );
const chains = Object.values(supportedNetworks).filter((chain) =>
[MAINNET_CHAIN_ID, POLYGON_AMOY_CHAIN_ID, SEPOLIA_CHAIN_ID].includes(
chain.chainId
)
);

console.log("selectedBuildEnv", selectedBuildEnv.value);

await torus?.init({
buildEnv: selectedBuildEnv.value,
// chains,
chains,
chainId: chainConfig.chainId,
});

Expand Down
9 changes: 6 additions & 3 deletions examples/demo-app/src/style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";
@import "@toruslabs/vue-components/web3auth-theme.css";
@custom-variant dark (&:is(.dark *));
@source "../index.html";
@source "./";
@source "../node_modules/@toruslabs/vue-components";

@layer base {
html body {
Expand Down
3 changes: 2 additions & 1 deletion examples/demo-app/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import tailwindcss from "@tailwindcss/vite";
import vue from "@vitejs/plugin-vue";
import { defineConfig, loadEnv } from "vite";

Expand All @@ -17,5 +18,5 @@ export default defineConfig({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
"process.env.VITE_APP_INFURA_PROJECT_KEY": JSON.stringify(VITE_APP_INFURA_PROJECT_KEY),
},
plugins: [vue()],
plugins: [tailwindcss(), vue()],
});
Loading
Loading