Skip to content

Commit 34f2fc4

Browse files
committed
Update wallet connection example to use InAppWallet
Replaces the previous Thirdweb SDK wallet connection example with a new approach using InAppWallet and Google authentication. The updated code demonstrates connecting with EIP7702Sponsored execution mode and retrieving the wallet address.
1 parent 79ea412 commit 34f2fc4

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

apps/dashboard/src/@/components/contracts/code-overview.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -441,20 +441,17 @@ return (
441441
442442
public async void ConnectWallet()
443443
{
444-
// Reference to your Thirdweb SDK
445-
var sdk = ThirdwebManager.Instance.SDK;
446-
447-
// Configure the connection
448-
var connection = new WalletConnection(
449-
provider: WalletProvider.SmartWallet, // The wallet provider you want to connect to (Required)
450-
chainId: 1, // The chain you want to connect to (Required)
451-
password: "myEpicPassword", // If using a local wallet as personal wallet (Optional)
452-
email: "[email protected]", // If using an email wallet as personal wallet (Optional)
453-
personalWallet: WalletProvider.LocalWallet // The personal wallet you want to use with your Account (Optional)
444+
var wallet = await ConnectWallet(
445+
new WalletOptions(
446+
provider: WalletProvider.InAppWallet,
447+
chainId: {{chainId}},
448+
inAppWalletOptions: new InAppWalletOptions(
449+
authprovider: AuthProvider.Google,
450+
executionMode: ExecutionMode.EIP7702Sponsored
451+
)
452+
)
454453
);
455-
456-
// Connect the wallet
457-
string address = await sdk.wallet.Connect(connection);
454+
string address = await wallet.GetAddress();
458455
}`,
459456
},
460457
},

0 commit comments

Comments
 (0)