Skip to content

Commit 62491c5

Browse files
committed
feat - support mm smart account
1 parent ea6a623 commit 62491c5

File tree

8 files changed

+816
-110
lines changed

8 files changed

+816
-110
lines changed

demo/vue-app-new/package-lock.json

Lines changed: 543 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/vue-app-new/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
},
1212
"dependencies": {
1313
"@solana/web3.js": "^1.98.0",
14-
"@toruslabs/base-controllers": "^8.1.0",
14+
"@toruslabs/base-controllers": "^8.3.1",
1515
"@toruslabs/bs58": "^1.0.0",
16-
"@toruslabs/ethereum-controllers": "^8.2.0",
16+
"@toruslabs/ethereum-controllers": "^8.3.4",
1717
"@toruslabs/solana-controllers": "^8.1.0",
1818
"@toruslabs/tweetnacl-js": "^1.0.4",
1919
"@toruslabs/vue-components": "^8.0.6",
@@ -22,7 +22,7 @@
2222
"@web3auth/modal": "file:../../packages/modal",
2323
"@web3auth/no-modal": "file:../../packages/no-modal",
2424
"@web3auth/sign-in-with-ethereum": "^5.0.0",
25-
"@web3auth/ws-embed": "^5.0.0",
25+
"@web3auth/ws-embed": "file:../../web3auth-ws-embed-5.0.0.tgz",
2626
"ethers": "^6.13.5",
2727
"petite-vue-i18n": "^11.1.3",
2828
"vue": "^3.5.13"

demo/vue-app-new/src/MainView.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ import { type Web3AuthContextConfig, Web3AuthProvider } from "@web3auth/modal/vu
1919
import { WalletServicesProvider } from "@web3auth/no-modal/vue";
2020
import { computed, onBeforeMount, ref, watch } from "vue";
2121
22-
import { AUTH_CONNECTION, type AUTH_CONNECTION_TYPE, BUILD_ENV } from "@web3auth/auth";
22+
import { type AUTH_CONNECTION_TYPE, BUILD_ENV } from "@web3auth/auth";
2323
import AppDashboard from "./components/AppDashboard.vue";
2424
import AppHeader from "./components/AppHeader.vue";
2525
import AppSettings from "./components/AppSettings.vue";
2626
import { clientIds, NFT_CHECKOUT_CLIENT_ID } from "./config";
2727
import { FormConfigSettings } from "./interfaces";
2828
import { formDataStore } from "./store/form";
2929
import { getChainConfig } from "./utils/chainconfig";
30+
import { SmartAccountType } from "@toruslabs/ethereum-controllers";
31+
import { Implementation } from "@metamask/delegation-toolkit";
3032
3133
const formData = formDataStore;
3234
@@ -54,7 +56,7 @@ const options = computed((): Web3AuthOptions => {
5456
}
5557
});
5658
accountAbstractionConfig = {
57-
smartAccountType: formData.smartAccountType as string,
59+
smartAccountType: formData.smartAccountType as SmartAccountType,
5860
chains,
5961
};
6062
}

demo/vue-app-new/src/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,15 @@ export const defaultLoginMethod: Record<AUTH_CONNECTION_TYPE, FormConfigSettings
8080
{} as Record<AUTH_CONNECTION_TYPE, FormConfigSettings>
8181
);
8282

83-
export type SmartAccountType = "biconomy" | "safe" | "nexus" | "kernel" | "trust";
83+
export type SmartAccountType = "biconomy" | "safe" | "nexus" | "kernel" | "trust" | "metamask";
8484

8585
export const SmartAccountOptions: { name: string; value: SmartAccountType }[] = [
8686
{ name: "Biconomy", value: "biconomy" },
8787
{ name: "Safe", value: "safe" },
8888
{ name: "Nexus", value: "nexus" },
8989
{ name: "Kernel", value: "kernel" },
9090
{ name: "Trust", value: "trust" },
91+
{ name: "Metamask", value: "metamask" },
9192
// { name: "Light", value: "light" },
9293
// { name: "Simple", value: "simple" },
9394
];

0 commit comments

Comments
 (0)