Skip to content

Commit 8778ad0

Browse files
authored
Added function to get Ecosystem config (#344)
* added function to get ecosystem config * added more values to the ecosystem config * version bump
1 parent da665d1 commit 8778ad0

File tree

6 files changed

+50
-1
lines changed

6 files changed

+50
-1
lines changed

Assets/SequenceSDK/EcosystemWallet/UnitTests/AuthenticationTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Sequence.EcosystemWallet.Primitives;
66
using Sequence.EcosystemWallet.Primitives.Common;
77
using Sequence.Utils;
8+
using UnityEngine;
89

910
namespace Sequence.EcosystemWallet.UnitTests
1011
{
@@ -18,6 +19,17 @@ public void Disconnect()
1819
SequenceWallet.RecoverFromStorage().Disconnect();
1920
}
2021

22+
[Test]
23+
public async Task TestGetEcosystemConfig()
24+
{
25+
var config = await new SequenceConnect().GetEcosystemConfig();
26+
27+
Debug.Log($"Ecosystem Name: {config.name}");
28+
29+
foreach (var provider in config.enabledProviders)
30+
Debug.Log($"Provider: {provider}");
31+
}
32+
2133
[Test]
2234
public async Task CreateSessionForExplicitEmit()
2335
{
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System.Numerics;
2+
3+
namespace Sequence.EcosystemWallet
4+
{
5+
public enum EcosystemAuthProvider
6+
{
7+
Email,
8+
Google,
9+
Apple,
10+
Passkey,
11+
Mnemonic,
12+
Unknown
13+
}
14+
15+
public struct EcosystemConfig
16+
{
17+
public string name;
18+
public string description;
19+
public string url;
20+
public BigInteger[] supportedChains;
21+
public EcosystemAuthProvider[] enabledProviders;
22+
}
23+
}

Packages/Sequence-Unity/Sequence/SequenceSDK/EcosystemWallet/Authentication/Requests/EcosystemConfig.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/Sequence-Unity/Sequence/SequenceSDK/EcosystemWallet/Authentication/SequenceConnect.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
using System.Threading.Tasks;
2+
using Sequence.Config;
3+
using Sequence.Utils;
24

35
namespace Sequence.EcosystemWallet
46
{
57
public class SequenceConnect : IConnect
68
{
79
private readonly EcosystemClient _client = new();
10+
11+
public async Task<EcosystemConfig> GetEcosystemConfig()
12+
{
13+
var walletUrl= SequenceConfig.GetConfig().WalletAppUrl;
14+
var client = new HttpClient(walletUrl);
15+
return await client.SendGetRequest<EcosystemConfig>("api/wallet-configuration");
16+
}
817

918
public async Task<IWallet> SignInWithEmail(string email, IPermissions permissions)
1019
{

Packages/Sequence-Unity/Sequence/SequenceSDK/Utils/Networking/HttpClient.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ public async Task<TResponse> SendGetRequest<TResponse>(string path, Dictionary<s
118118
var request = UnityWebRequest.Get(url);
119119
request.method = UnityWebRequest.kHttpVerbGET;
120120
SetHeaders(request, headers);
121+
122+
SequenceLog.Info($">> {url}");
121123

122124
try
123125
{

Packages/Sequence-Unity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xyz.0xsequence.waas-unity",
3-
"version": "5.0.7",
3+
"version": "5.0.8",
44
"displayName": "Sequence SDK",
55
"description": "A Unity SDK for Sequence APIs",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)