Skip to content

Commit 5f9b5c2

Browse files
authored
Ecosystem Wallet Linking & Guest Login (#65)
1 parent fd38705 commit 5f9b5c2

File tree

10 files changed

+367
-123
lines changed

10 files changed

+367
-123
lines changed

Thirdweb.Console/Program.cs

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,14 @@
7474

7575
#region Ecosystem Wallet
7676

77-
// var ecosystemWallet = await EcosystemWallet.Create(client: client, ecosystemId: "ecosystem.the-bonfire", authProvider: AuthProvider.Google);
77+
// var ecosystemWallet = await EcosystemWallet.Create(client: client, ecosystemId: "ecosystem.the-bonfire", email: "firekeeper+linkeco@thirdweb.com");
7878

7979
// if (!await ecosystemWallet.IsConnected())
8080
// {
81-
// _ = await ecosystemWallet.LoginWithOauth(
82-
// isMobile: false,
83-
// (url) =>
84-
// {
85-
// var psi = new ProcessStartInfo { FileName = url, UseShellExecute = true };
86-
// _ = Process.Start(psi);
87-
// },
88-
// "thirdweb://",
89-
// new InAppWalletBrowser()
90-
// );
81+
// _ = await ecosystemWallet.SendOTP();
82+
// Console.WriteLine("Enter OTP:");
83+
// var otp = Console.ReadLine();
84+
// _ = await ecosystemWallet.LoginWithOtp(otp: otp);
9185
// }
9286
// var ecosystemWalletAddress = await ecosystemWallet.GetAddress();
9387
// Console.WriteLine($"Ecosystem Wallet address: {ecosystemWalletAddress}");
@@ -103,6 +97,11 @@
10397
// );
10498
// Console.WriteLine($"Ecosystem Wallet typed sign: {ecosystemTypedSignature}");
10599

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

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

167166
#endregion
168167

168+
#region Guest Login
169+
170+
// var guestWallet = await EcosystemWallet.Create(ecosystemId: "ecosystem.the-bonfire", client: client, authProvider: AuthProvider.Guest);
171+
// if (!await guestWallet.IsConnected())
172+
// {
173+
// _ = await guestWallet.LoginWithGuest();
174+
// }
175+
// var address = await guestWallet.GetAddress();
176+
// Console.WriteLine($"Guest address: {address}");
177+
178+
// var oldLinkedAccounts = await guestWallet.GetLinkedAccounts();
179+
// Console.WriteLine($"Old linked accounts: {JsonConvert.SerializeObject(oldLinkedAccounts, Formatting.Indented)}");
180+
181+
// var emailWalletFresh = await EcosystemWallet.Create(ecosystemId: "ecosystem.the-bonfire", client: client, email: "firekeeper+guestupgrade5@thirdweb.com");
182+
// _ = await emailWalletFresh.SendOTP();
183+
// Console.WriteLine("Enter OTP:");
184+
// var otp = Console.ReadLine();
185+
186+
// var linkedAccounts = await guestWallet.LinkAccount(walletToLink: emailWalletFresh, otp: otp);
187+
// Console.WriteLine($"Linked accounts: {JsonConvert.SerializeObject(linkedAccounts, Formatting.Indented)}");
188+
189+
#endregion
190+
169191
#region Account Linking
170192

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

0 commit comments

Comments
 (0)