Skip to content

Commit

Permalink
Ecosystem Wallet Linking & Guest Login (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xFirekeeper authored Sep 11, 2024
1 parent fd38705 commit 5f9b5c2
Show file tree
Hide file tree
Showing 10 changed files with 367 additions and 123 deletions.
44 changes: 33 additions & 11 deletions Thirdweb.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,14 @@

#region Ecosystem Wallet

// var ecosystemWallet = await EcosystemWallet.Create(client: client, ecosystemId: "ecosystem.the-bonfire", authProvider: AuthProvider.Google);
// var ecosystemWallet = await EcosystemWallet.Create(client: client, ecosystemId: "ecosystem.the-bonfire", email: "[email protected]");

// if (!await ecosystemWallet.IsConnected())
// {
// _ = await ecosystemWallet.LoginWithOauth(
// isMobile: false,
// (url) =>
// {
// var psi = new ProcessStartInfo { FileName = url, UseShellExecute = true };
// _ = Process.Start(psi);
// },
// "thirdweb://",
// new InAppWalletBrowser()
// );
// _ = await ecosystemWallet.SendOTP();
// Console.WriteLine("Enter OTP:");
// var otp = Console.ReadLine();
// _ = await ecosystemWallet.LoginWithOtp(otp: otp);
// }
// var ecosystemWalletAddress = await ecosystemWallet.GetAddress();
// Console.WriteLine($"Ecosystem Wallet address: {ecosystemWalletAddress}");
Expand All @@ -103,6 +97,11 @@
// );
// Console.WriteLine($"Ecosystem Wallet typed sign: {ecosystemTypedSignature}");

// var siweSigner = await PrivateKeyWallet.Generate(client: client);
// var ecosystemWalletOther = await EcosystemWallet.Create(client: client, ecosystemId: "ecosystem.the-bonfire", authProvider: AuthProvider.Siwe, siweSigner: siweSigner);
// var linkedAccounts = await ecosystemWallet.LinkAccount(walletToLink: ecosystemWalletOther, chainId: 421614);
// Console.WriteLine($"Linked accounts: {JsonConvert.SerializeObject(linkedAccounts, Formatting.Indented)}");

// var ecosystemSmartWallet = await SmartWallet.Create(ecosystemWallet, 421614);

// var ecosystemTx = await ThirdwebTransaction.Create(wallet: ecosystemSmartWallet, txInput: new ThirdwebTransactionInput(chainId: 421614, to: await ecosystemWallet.GetAddress()));
Expand Down Expand Up @@ -166,6 +165,29 @@

#endregion

#region Guest Login

// var guestWallet = await EcosystemWallet.Create(ecosystemId: "ecosystem.the-bonfire", client: client, authProvider: AuthProvider.Guest);
// if (!await guestWallet.IsConnected())
// {
// _ = await guestWallet.LoginWithGuest();
// }
// var address = await guestWallet.GetAddress();
// Console.WriteLine($"Guest address: {address}");

// var oldLinkedAccounts = await guestWallet.GetLinkedAccounts();
// Console.WriteLine($"Old linked accounts: {JsonConvert.SerializeObject(oldLinkedAccounts, Formatting.Indented)}");

// var emailWalletFresh = await EcosystemWallet.Create(ecosystemId: "ecosystem.the-bonfire", client: client, email: "[email protected]");
// _ = await emailWalletFresh.SendOTP();
// Console.WriteLine("Enter OTP:");
// var otp = Console.ReadLine();

// var linkedAccounts = await guestWallet.LinkAccount(walletToLink: emailWalletFresh, otp: otp);
// Console.WriteLine($"Linked accounts: {JsonConvert.SerializeObject(linkedAccounts, Formatting.Indented)}");

#endregion

#region Account Linking

// var inAppWalletMain = await InAppWallet.Create(client: client, authProvider: AuthProvider.Google);
Expand Down
Loading

0 comments on commit 5f9b5c2

Please sign in to comment.