Skip to content

Commit 75f777c

Browse files
authored
InAppWallet EIP7702 Session Key Integration (#150)
1 parent b6541d6 commit 75f777c

File tree

3 files changed

+45
-36
lines changed

3 files changed

+45
-36
lines changed

Thirdweb.Console/Program.cs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -360,20 +360,13 @@
360360

361361
#region EIP-7702
362362

363-
// var chain = 11155111; // sepolia
363+
// var chain = 11155111; // 7702-compatible chain
364364

365365
// // Connect to EOA
366-
// var smartEoa = await InAppWallet.Create(client, authProvider: AuthProvider.Google, executionMode: ExecutionMode.EIP7702Sponsored);
366+
// var smartEoa = await InAppWallet.Create(client, authProvider: AuthProvider.Guest, executionMode: ExecutionMode.EIP7702Sponsored);
367367
// if (!await smartEoa.IsConnected())
368368
// {
369-
// _ = await smartEoa.LoginWithOauth(
370-
// isMobile: false,
371-
// (url) =>
372-
// {
373-
// var psi = new ProcessStartInfo { FileName = url, UseShellExecute = true };
374-
// _ = Process.Start(psi);
375-
// }
376-
// );
369+
// _ = await smartEoa.LoginWithGuest(defaultSessionIdOverride: new Guid().ToString());
377370
// }
378371
// var smartEoaAddress = await smartEoa.GetAddress();
379372
// Console.WriteLine($"User Wallet address: {await smartEoa.GetAddress()}");
@@ -389,18 +382,7 @@
389382
// Console.WriteLine($"Is delegated: {isDelegated}");
390383

391384
// // Create a session key
392-
// var sessionKeyReceipt = await smartEoa.CreateSessionKey(
393-
// chain,
394-
// new SessionSpec()
395-
// {
396-
// Signer = await Utils.GetAddressFromENS(client, "0xfirekeeper.eth"),
397-
// IsWildcard = true,
398-
// ExpiresAt = Utils.GetUnixTimeStampNow() + 86400, // 1 day
399-
// CallPolicies = new List<CallSpec>(),
400-
// TransferPolicies = new List<TransferSpec>(),
401-
// Uid = Guid.NewGuid().ToByteArray().PadTo32Bytes()
402-
// }
403-
// );
385+
// var sessionKeyReceipt = await smartEoa.CreateSessionKey(chainId: chain, signerAddress: await Utils.GetAddressFromENS(client, "vitalik.eth"), durationInSeconds: 86400, grantFullPermissions: true);
404386
// Console.WriteLine($"Session key receipt: {sessionKeyReceipt.TransactionHash}");
405387

406388
#endregion

0 commit comments

Comments
 (0)