Skip to content

Commit 37f0020

Browse files
committed
nits for testing different usecases
1 parent f927f2c commit 37f0020

File tree

2 files changed

+65
-7
lines changed

2 files changed

+65
-7
lines changed

web-modal-sdk/blockchain-connection-examples/evm-modal-example/src/web3AuthProviderProps.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";
44
import { CHAIN_NAMESPACES, WEB3AUTH_NETWORK } from "@web3auth/base";
55
import { AuthAdapter } from "@web3auth/auth-adapter";
66
import { WalletServicesPlugin } from "@web3auth/wallet-services-plugin";
7-
// import { getDefaultExternalAdapters, getInjectedAdapters } from "@web3auth/default-evm-adapter";
7+
import { getDefaultExternalAdapters, getInjectedAdapters } from "@web3auth/default-evm-adapter";
88

99
const chainConfig = {
1010
chainId: "0xaa36a7", // for wallet connect make sure to pass in this chain in the loginSettings of the adapter.
@@ -55,7 +55,7 @@ const authAdapter = new AuthAdapter({
5555
logoLight: "https://web3auth.io/images/web3authlog.png",
5656
logoDark: "https://web3auth.io/images/web3authlogodark.png",
5757
defaultLanguage: "en", // en, de, ja, ko, zh, es, fr, pt, nl, tr
58-
mode: "dark", // whether to enable dark, light or auto mode. defaultValue: auto [ system theme]
58+
mode: "light", // whether to enable dark, light or auto mode. defaultValue: auto [ system theme]
5959
},
6060
mfaSettings: {
6161
deviceShareFactor: {
@@ -85,10 +85,10 @@ const authAdapter = new AuthAdapter({
8585
const walletServicesPlugin = new WalletServicesPlugin();
8686

8787
// const adapters = await getInjectedAdapters({options: web3AuthOptions});
88-
// const adapters = await getDefaultExternalAdapters({ options: web3AuthOptions });
88+
const adapters = await getDefaultExternalAdapters({ options: web3AuthOptions });
8989

9090
export const web3AuthContextConfig: Web3AuthContextConfig = {
9191
web3AuthOptions,
92-
adapters: [authAdapter],
92+
adapters: [authAdapter, ...adapters],
9393
plugins: [walletServicesPlugin],
9494
};

web-modal-sdk/blockchain-connection-examples/solana-modal-example/src/App.tsx

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { useEffect, useState } from "react";
22
import { Web3Auth } from "@web3auth/modal";
3-
import { CHAIN_NAMESPACES, IAdapter, IProvider, WEB3AUTH_NETWORK } from "@web3auth/base";
3+
import { CHAIN_NAMESPACES, IAdapter, IProvider, WALLET_ADAPTERS, WEB3AUTH_NETWORK } from "@web3auth/base";
44

55
import RPC from "./solanaRPC";
66
import "./App.css";
77

88
// Adapters
9-
import { getDefaultExternalAdapters } from "@web3auth/default-solana-adapter"; // All default Solana Adapters
9+
import { getDefaultExternalAdapters, getInjectedAdapters } from "@web3auth/default-solana-adapter"; // All default Solana Adapters
1010
import { SolanaPrivateKeyProvider } from "@web3auth/solana-provider";
1111

1212
const clientId = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ"; // get from https://dashboard.web3auth.io
@@ -66,7 +66,65 @@ function App() {
6666

6767
setWeb3auth(web3auth);
6868

69-
await web3auth.initModal();
69+
await web3auth.initModal({
70+
modalConfig: {
71+
[WALLET_ADAPTERS.AUTH]: {
72+
label: "auth",
73+
loginMethods: {
74+
// it will hide the facebook option from the Web3Auth modal.
75+
facebook: {
76+
name: "facebook",
77+
showOnModal: false,
78+
},
79+
reddit: {
80+
name: "reddit",
81+
showOnModal: false,
82+
},
83+
twitch: {
84+
name: "twitch",
85+
showOnModal: false,
86+
},
87+
line: {
88+
name: "line",
89+
showOnModal: false,
90+
},
91+
kakao: {
92+
name: "kakao",
93+
showOnModal: false,
94+
},
95+
linkedin: {
96+
name: "linkedin",
97+
showOnModal: false,
98+
},
99+
twitter: {
100+
name: "twitter",
101+
showOnModal: false,
102+
},
103+
weibo: {
104+
name: "weibo",
105+
showOnModal: false,
106+
},
107+
wechat: {
108+
name: "wechat",
109+
showOnModal: false,
110+
},
111+
farcaster: {
112+
name: "farcaster",
113+
showOnModal: false,
114+
},
115+
email_passwordless: {
116+
name: "email-passwordless",
117+
showOnModal: true,
118+
},
119+
sms_passwordless: {
120+
name: "sms-passwordless",
121+
showOnModal: true,
122+
},
123+
},
124+
showOnModal: true,
125+
},
126+
},
127+
});
70128
setProvider(web3auth.provider);
71129

72130
if (web3auth.connected) {

0 commit comments

Comments
 (0)