Skip to content

Commit 6c532b4

Browse files
committed
added function to get ecosystem config
1 parent 9cdc67d commit 6c532b4

5 files changed

Lines changed: 44 additions & 0 deletions

File tree

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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace Sequence.EcosystemWallet
2+
{
3+
public enum EcosystemAuthProvider
4+
{
5+
Email,
6+
Google,
7+
Apple,
8+
Passkey,
9+
Mnemonic,
10+
Unknown
11+
}
12+
13+
public struct EcosystemConfig
14+
{
15+
public string name;
16+
public EcosystemAuthProvider[] enabledProviders;
17+
}
18+
}

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
{

0 commit comments

Comments
 (0)