diff --git a/Thirdweb.Console/Program.cs b/Thirdweb.Console/Program.cs index 072d0bf..8c4f6da 100644 --- a/Thirdweb.Console/Program.cs +++ b/Thirdweb.Console/Program.cs @@ -1,7 +1,9 @@ #pragma warning disable IDE0005 #pragma warning disable IDE0059 +using System.Diagnostics; using dotenv.net; +using Newtonsoft.Json; using Thirdweb; DotEnv.Load(); @@ -14,8 +16,8 @@ #region Basic Wallet Interaction -// // Create a private key wallet -// var privateKeyWallet = await PrivateKeyWallet.Generate(client); +// Create a private key wallet +var privateKeyWallet = await PrivateKeyWallet.Generate(client); // var walletAddress = await privateKeyWallet.GetAddress(); // Console.WriteLine($"PK Wallet address: {walletAddress}"); @@ -744,7 +746,7 @@ #region InAppWallet - OAuth -// var inAppWalletOAuth = await InAppWallet.Create(client: client, authProvider: AuthProvider.Github); +// var inAppWalletOAuth = await InAppWallet.Create(client: client, authProvider: AuthProvider.TikTok); // if (!await inAppWalletOAuth.IsConnected()) // { // _ = await inAppWalletOAuth.LoginWithOauth( diff --git a/Thirdweb/Thirdweb.Wallets/InAppWallet/EcosystemWallet/EcosystemWallet.cs b/Thirdweb/Thirdweb.Wallets/InAppWallet/EcosystemWallet/EcosystemWallet.cs index 8e2b00d..1037983 100644 --- a/Thirdweb/Thirdweb.Wallets/InAppWallet/EcosystemWallet/EcosystemWallet.cs +++ b/Thirdweb/Thirdweb.Wallets/InAppWallet/EcosystemWallet/EcosystemWallet.cs @@ -137,6 +137,7 @@ public static async Task Create( Thirdweb.AuthProvider.Line => "Line", Thirdweb.AuthProvider.Guest => "Guest", Thirdweb.AuthProvider.X => "X", + Thirdweb.AuthProvider.TikTok => "TikTok", Thirdweb.AuthProvider.Coinbase => "Coinbase", Thirdweb.AuthProvider.Github => "Github", Thirdweb.AuthProvider.Twitch => "Twitch", @@ -744,6 +745,7 @@ public async Task> LinkAccount( case "Telegram": case "Line": case "X": + case "TikTok": case "Coinbase": case "Github": case "Twitch": @@ -871,7 +873,7 @@ public async Task LoginWithOtp(string otp) var platform = this.HttpClient?.Headers?["x-sdk-name"] == "UnitySDK_WebGL" ? "web" : "dotnet"; var redirectUrl = isMobile ? mobileRedirectScheme : "http://localhost:8789/"; var loginUrl = await this.EmbeddedWallet.FetchHeadlessOauthLoginLinkAsync(this.AuthProvider, platform).ConfigureAwait(false); - loginUrl = platform == "web" ? loginUrl : $"{loginUrl}&redirectUrl={redirectUrl}&developerClientId={this.Client.ClientId}&authOption={this.AuthProvider}"; + loginUrl = platform == "web" ? loginUrl : $"{loginUrl}&redirectUrl={redirectUrl}&developerClientId={this.Client.ClientId}&authOption={this.AuthProvider.ToLower()}"; if (!string.IsNullOrEmpty(this._ecosystemId)) { loginUrl = $"{loginUrl}&ecosystemId={this._ecosystemId}"; diff --git a/Thirdweb/Thirdweb.Wallets/InAppWallet/EmbeddedWallet.Authentication/Server.cs b/Thirdweb/Thirdweb.Wallets/InAppWallet/EmbeddedWallet.Authentication/Server.cs index a262384..6669fcf 100644 --- a/Thirdweb/Thirdweb.Wallets/InAppWallet/EmbeddedWallet.Authentication/Server.cs +++ b/Thirdweb/Thirdweb.Wallets/InAppWallet/EmbeddedWallet.Authentication/Server.cs @@ -200,7 +200,7 @@ internal override async Task VerifyGuestAsync(string sessionId) // login/oauthprovider internal override Task FetchHeadlessOauthLoginLinkAsync(string authProvider, string platform) { - return Task.FromResult(MakeUri2024($"/login/{authProvider}", new Dictionary { { "clientId", this._clientId }, { "platform", platform } }).ToString()); + return Task.FromResult(MakeUri2024($"/login/{authProvider.ToLower()}", new Dictionary { { "clientId", this._clientId }, { "platform", platform } }).ToString()); } // login/email diff --git a/Thirdweb/Thirdweb.Wallets/InAppWallet/InAppWallet.Types.cs b/Thirdweb/Thirdweb.Wallets/InAppWallet/InAppWallet.Types.cs index f4a7812..7d41e57 100644 --- a/Thirdweb/Thirdweb.Wallets/InAppWallet/InAppWallet.Types.cs +++ b/Thirdweb/Thirdweb.Wallets/InAppWallet/InAppWallet.Types.cs @@ -20,6 +20,7 @@ public enum AuthProvider Line, Guest, X, + TikTok, Coinbase, Github, Twitch,