Skip to content

Commit

Permalink
Expose UserStatusResponse fields
Browse files Browse the repository at this point in the history
  • Loading branch information
0xFirekeeper committed Dec 26, 2024
1 parent e5c2aa7 commit a47c7c3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,40 @@ namespace Thirdweb;

public partial class EcosystemWallet
{
/// <summary>
/// User linked account details.
/// </summary>
public class UserStatusResponse
{
/// <summary>
/// The user's linked accounts.
/// </summary>
[JsonProperty("linkedAccounts")]
internal List<LinkedAccount> LinkedAccounts { get; set; }
public List<LinkedAccount> LinkedAccounts { get; set; }

/// <summary>
/// The user's wallets, generally only one wallet is returned.
/// </summary>
[JsonProperty("wallets")]
internal List<ShardedOrEnclaveWallet> Wallets { get; set; }
public List<ShardedOrEnclaveWallet> Wallets { get; set; }
}

internal class ShardedOrEnclaveWallet
/// <summary>
/// Represents a user's embedded wallet.
/// </summary>
public class ShardedOrEnclaveWallet
{
/// <summary>
/// The public address of the wallet.
/// </summary>
[JsonProperty("address")]
internal string Address { get; set; }
public string Address { get; set; }

/// <summary>
/// The wallet's creation date.
/// </summary>
[JsonProperty("createdAt")]
internal DateTime CreatedAt { get; set; }
public DateTime CreatedAt { get; set; }

[JsonProperty("type")]
internal string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private async Task<string> MigrateShardToEnclave(Server.VerifyResult authResult)
#region Wallet Specific

/// <summary>
/// Gets the user details from the enclave wallet.
/// Gets the user details from the enclave wallet. For auth provider specific details use GetUserAuthDetails.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains the user details.</returns>
public async Task<UserStatusResponse> GetUserDetails()
Expand All @@ -294,7 +294,7 @@ public async Task<UserStatusResponse> GetUserDetails()
}

/// <summary>
/// Gets the user auth details from the corresponding auth provider.
/// Gets the user auth details from the corresponding auth provider. For linked account details use GetUserDetails or GetLinkedAccounts.
/// </summary>
/// <returns>The user auth details as a JObject</returns>
public JObject GetUserAuthDetails()
Expand Down
9 changes: 9 additions & 0 deletions Thirdweb/Thirdweb.Wallets/InAppWallet/InAppWallet.Types.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,21 @@ public enum AuthProvider
/// </summary>
public struct LinkedAccount
{
/// <summary>
/// The auth provider method used to create or link this account.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }

/// <summary>
/// Additional details about the linked account.
/// </summary>
[JsonProperty("details")]
public LinkedAccountDetails Details { get; set; }

/// <summary>
/// The email, address, phone and id related to the linked account, where applicable.
/// </summary>
public struct LinkedAccountDetails
{
[JsonProperty("email")]
Expand Down

0 comments on commit a47c7c3

Please sign in to comment.