Skip to content

Commit

Permalink
✨ Update Web3Auth SDK to 3.0.0 (#226)
Browse files Browse the repository at this point in the history
* ✨ Update Web3Auth SDK to 3.0.0

* 🔖 Bump SDK version 1.2.5
  • Loading branch information
GabrielePicco authored Jun 21, 2024
1 parent fe5466e commit a064c45
Show file tree
Hide file tree
Showing 12 changed files with 232 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Runtime/Plugins/Web3AuthSDK/Api/Web3AuthApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public class Web3AuthApi
{
static Web3AuthApi instance;
static string baseAddress = "https://broadcast-server.tor.us";
static string baseAddress = "https://session.web3auth.io";

public static Web3AuthApi getInstance()
{
Expand Down
13 changes: 13 additions & 0 deletions Runtime/Plugins/Web3AuthSDK/Types/ChainConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections.Generic;
#nullable enable
public class ChainConfig {
public Web3Auth.ChainNamespace? chainNamespace { get; set; } = Web3Auth.ChainNamespace.EIP155;
public int decimals { get; set; } = 18;
public string blockExplorerUrl { get; set; } = null;
public string chainId { get; set; }
public string displayName { get; set; } = null;
public string logo { get; set; } = null;
public string rpcTarget { get; set; }
public string ticker { get; set; } = null;
public string tickerName { get; set; } = null;
}
11 changes: 11 additions & 0 deletions Runtime/Plugins/Web3AuthSDK/Types/ChainConfig.cs.meta

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

12 changes: 2 additions & 10 deletions Runtime/Plugins/Web3AuthSDK/Types/LoginParams.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
using System;
using UnityEngine.Scripting;

[Preserve]
[Serializable]
public class LoginParams
{
[Preserve]
public Provider loginProvider { get; set; }
[Preserve]
public string dappShare { get; set; }
[Preserve]
public ExtraLoginOptions extraLoginOptions { get; set; }
[Preserve]
public Uri redirectUrl { get; set; }
[Preserve]
public string appState { get; set; }
[Preserve]
public MFALevel mfaLevel { get; set; }
[Preserve]

public Curve curve { get; set; } = Curve.SECP256K1;
public string dappUrl { get; set; }
}
10 changes: 7 additions & 3 deletions Runtime/Plugins/Web3AuthSDK/Types/MfaSettings.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
#pragma warning disable CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

public class MfaSettings
{
public MfaSetting? deviceShareFactor { get; set; }
public MfaSetting? backUpShareFactor { get; set; }
public MfaSetting? socialBackupFactor { get; set; }
public MfaSetting? passwordFactor { get; set; }
public MfaSetting? passkeysFactor { get; set; }
public MfaSetting? authenticatorFactor { get; set; }

// Constructors
public MfaSettings(
MfaSetting? deviceShareFactor,
MfaSetting? backUpShareFactor,
MfaSetting? socialBackupFactor,
MfaSetting? passwordFactor)
MfaSetting? passwordFactor,
MfaSetting? passkeysFactor,
MfaSetting? authenticatorFactor)
{
this.deviceShareFactor = deviceShareFactor;
this.backUpShareFactor = backUpShareFactor;
this.socialBackupFactor = socialBackupFactor;
this.passwordFactor = passwordFactor;
this.passkeysFactor = passkeysFactor;
this.authenticatorFactor = authenticatorFactor;
}
}
6 changes: 5 additions & 1 deletion Runtime/Plugins/Web3AuthSDK/Types/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@ public enum Provider
[EnumMember(Value = "jwt")]
JWT,
[EnumMember(Value = "CUSTOM_VERIFIER")]
CUSTOM_VERIFIER
CUSTOM_VERIFIER,
[EnumMember(Value = "sms_passwordless")]
SMS_PASSWORDLESS,
[EnumMember(Value = "farcaster")]
FARCASTER
}
4 changes: 4 additions & 0 deletions Runtime/Plugins/Web3AuthSDK/Types/SessionResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public class SessionResponse
{
public string sessionId;
}
11 changes: 11 additions & 0 deletions Runtime/Plugins/Web3AuthSDK/Types/SessionResponse.cs.meta

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

2 changes: 1 addition & 1 deletion Runtime/Plugins/Web3AuthSDK/Types/UserInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using UnityEngine.Scripting;

[Serializable]
Expand Down
20 changes: 15 additions & 5 deletions Runtime/Plugins/Web3AuthSDK/Types/Web3AuthOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System;
using System.Collections.Generic;
#nullable enable
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

public class Web3AuthOptions {
public string clientId { get; set; }
Expand All @@ -12,20 +11,31 @@ public class Web3AuthOptions {
public string sdkUrl {
get {
if (buildEnv == Web3Auth.BuildEnv.STAGING)
return "https://staging-auth.web3auth.io/{openLoginVersion}";
return "https://staging-auth.web3auth.io/v8";
else if (buildEnv == Web3Auth.BuildEnv.TESTING)
return "https://develop-auth.web3auth.io";
else
return "https://auth.web3auth.io/{openLoginVersion}";
return "https://auth.web3auth.io/v8";
}
set { }
}
public const string openLoginVersion = "v6";

public string walletSdkUrl {
get {
if (buildEnv == Web3Auth.BuildEnv.STAGING)
return "https://staging-wallet.web3auth.io/v2";
else if (buildEnv == Web3Auth.BuildEnv.TESTING)
return "https://develop-wallet.web3auth.io";
else
return "https://wallet.web3auth.io/v2";
}
set { }
}
public WhiteLabelData? whiteLabel { get; set; }
public Dictionary<string, LoginConfigItem>? loginConfig { get; set; }
public bool? useCoreKitKey { get; set; } = false;
public Web3Auth.ChainNamespace? chainNamespace { get; set; } = Web3Auth.ChainNamespace.EIP155;
public MfaSettings? mfaSettings { get; set; } = null;
public int sessionTime { get; set; } = 86400;
public ChainConfig? chainConfig { get; set; }
}
Loading

0 comments on commit a064c45

Please sign in to comment.