Skip to content

Commit

Permalink
Merge pull request #34 from TreasureProject/develop
Browse files Browse the repository at this point in the history
v0.2.5
  • Loading branch information
alecananian authored Apr 12, 2024
2 parents 48d4b07 + 50cb302 commit 63050e3
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 3 deletions.
14 changes: 14 additions & 0 deletions Assets/Treasure/TDK/Runtime/API/Auth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ public struct LogInResponse
public string token;
}

[Serializable]
public struct User
{
public string id;
public string smartAccountAddress;
public string email;
}

public partial class API
{
public async Task<AuthPayload> GetAuthPayload(string address, string chainId)
Expand All @@ -80,5 +88,11 @@ public async Task<string> LogIn(AuthPayload payload, string signature)
}));
return JsonConvert.DeserializeObject<LogInResponse>(response).token;
}

public async Task<User> GetCurrentUser()
{
var response = await Get("/users/me");
return JsonConvert.DeserializeObject<User>(response);
}
}
}
1 change: 1 addition & 0 deletions Assets/Treasure/TDK/Runtime/API/Corruption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public struct HarvesterCorruptionRemoval
{
public List<CorruptionRemovalRecipe> corruptionRemovalRecipes;
public List<InventoryToken> userInventoryCorruptionRemovalRecipeItems;
public List<Dictionary<string, Approval>> userApprovalsCorruptionRemovalRecipeItems;
public List<CorruptionRemoval> userCorruptionRemovals;
}

Expand Down
6 changes: 6 additions & 0 deletions Assets/Treasure/TDK/Runtime/API/Harvester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public struct Booster
public int userCharactersStaked;
public double userCharactersMaxBoost;
public double userCharactersBoost;
public List<InventoryToken> userInventoryLegions;
public List<Token> userStakedLegions;
public bool userLegionsApproved;
public int userLegionsMaxWeightStakeable;
public int userLegionsWeightStaked;
public double userLegionsBoost;
public BigInteger userMagicMaxStakeable;
public BigInteger userMagicStaked;
public BigInteger userMagicRewardsClaimable;
Expand Down
13 changes: 13 additions & 0 deletions Assets/Treasure/TDK/Runtime/Common/Approval.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using Newtonsoft.Json;

namespace Treasure
{
[Serializable]
public class Approval
{
[JsonProperty("operator")]
public string operatorAddress;
public bool approved;
}
}
11 changes: 11 additions & 0 deletions Assets/Treasure/TDK/Runtime/Common/Approval.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Assets/Treasure/TDK/Runtime/Common/Token.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public struct Attribute
public int tokenId;
public string name;
public string image;
public string imageAlt;
public List<Attribute> attributes;
}

Expand Down
4 changes: 2 additions & 2 deletions Assets/Treasure/TDK/Runtime/Connect/UI/TDKEmbeddedWalletUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ public override async Task LoginWithOTP()
{
SubmitButton.GetComponent<LoadingButton>().SetLoading(true);
OnSubmitOTP();
}
}
});

await OnSendOTP();
TDKConnectUIManager.Instance.ShowConfirmLoginModal();
}

public override async Task<User> Connect(EmbeddedWallet embeddedWallet, string email, AuthOptions authOptions)
public override async Task<Thirdweb.EWS.User> Connect(EmbeddedWallet embeddedWallet, string email, AuthOptions authOptions)
{
var config = Resources.Load<ThirdwebConfig>("ThirdwebConfig");
_customScheme = config != null ? config.customScheme : null;
Expand Down
2 changes: 1 addition & 1 deletion Assets/Treasure/TDK/Runtime/TDKVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public static class TDKVersion
{
public static string name = "tdk-unity";
public static string version = "0.2.4";
public static string version = "0.2.5";
}
}

0 comments on commit 63050e3

Please sign in to comment.