Skip to content

Commit 9f21e1c

Browse files
committed
.NET 2.17.0 // Nebula Beta & Enhanced Analytics
1 parent 554a14d commit 9f21e1c

File tree

5 files changed

+2
-44
lines changed

5 files changed

+2
-44
lines changed

Diff for: Assets/Thirdweb/Editor/ThirdwebManagerEditor.cs

-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public abstract class ThirdwebManagerBaseEditor<T> : UnityEditor.Editor
1010
{
1111
protected SerializedProperty initializeOnAwakeProp;
1212
protected SerializedProperty showDebugLogsProp;
13-
protected SerializedProperty optOutUsageAnalyticsProp;
1413
protected SerializedProperty autoConnectLastWalletProp;
1514
protected SerializedProperty supportedChainsProp;
1615
protected SerializedProperty includedWalletIdsProp;
@@ -27,7 +26,6 @@ protected virtual void OnEnable()
2726
{
2827
initializeOnAwakeProp = FindProp("InitializeOnAwake");
2928
showDebugLogsProp = FindProp("ShowDebugLogs");
30-
optOutUsageAnalyticsProp = FindProp("OptOutUsageAnalytics");
3129
autoConnectLastWalletProp = FindProp("AutoConnectLastWallet");
3230
supportedChainsProp = FindProp("SupportedChains");
3331
includedWalletIdsProp = FindProp("IncludedWalletIds");
@@ -83,7 +81,6 @@ protected virtual void DrawPreferencesTab()
8381
EditorGUILayout.HelpBox("Set your preferences and initialization options here.", MessageType.Info);
8482
DrawProperty(initializeOnAwakeProp, "Initialize On Awake");
8583
DrawProperty(showDebugLogsProp, "Show Debug Logs");
86-
DrawProperty(optOutUsageAnalyticsProp, "Opt-Out of Usage Analytics");
8784
DrawProperty(autoConnectLastWalletProp, "Auto-Connect Last Wallet");
8885
}
8986

Diff for: Assets/Thirdweb/Runtime/NET/Thirdweb.dll

43.5 KB
Binary file not shown.

Diff for: Assets/Thirdweb/Runtime/Unity/ThirdwebManagerBase.cs

-40
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,6 @@ public abstract class ThirdwebManagerBase : MonoBehaviour
204204
[field: SerializeField]
205205
protected bool ShowDebugLogs { get; set; } = true;
206206

207-
[field: SerializeField]
208-
protected bool OptOutUsageAnalytics { get; set; } = false;
209-
210207
[field: SerializeField]
211208
protected bool AutoConnectLastWallet { get; set; } = false;
212209

@@ -518,12 +515,6 @@ public virtual async Task<IThirdwebWallet> ConnectWallet(WalletOptions walletOpt
518515
var address = await wallet.GetAddress();
519516
var isSmartWallet = walletOptions.SmartWalletOptions != null;
520517

521-
if (!OptOutUsageAnalytics)
522-
{
523-
var typeString = isSmartWallet ? "smartWallet" : walletOptions.Provider.ToString()[..1].ToLower() + walletOptions.Provider.ToString()[1..];
524-
TrackUsage("connectWallet", "connect", typeString, address);
525-
}
526-
527518
SetAutoConnectOptions(walletOptions);
528519

529520
// If SmartWallet, do upgrade
@@ -635,36 +626,5 @@ protected virtual void SetAutoConnectOptions(WalletOptions walletOptions)
635626
}
636627
}
637628
}
638-
639-
protected virtual async void TrackUsage(string source, string action, string walletType, string walletAddress)
640-
{
641-
if (string.IsNullOrEmpty(source) || string.IsNullOrEmpty(action) || string.IsNullOrEmpty(walletType) || string.IsNullOrEmpty(walletAddress))
642-
{
643-
ThirdwebDebug.LogWarning("Invalid usage analytics parameters.");
644-
return;
645-
}
646-
647-
try
648-
{
649-
var content = new System.Net.Http.StringContent(
650-
JsonConvert.SerializeObject(
651-
new
652-
{
653-
source,
654-
action,
655-
walletAddress,
656-
walletType,
657-
}
658-
),
659-
System.Text.Encoding.UTF8,
660-
"application/json"
661-
);
662-
_ = await Client.HttpClient.PostAsync("https://c.thirdweb.com/event", content);
663-
}
664-
catch
665-
{
666-
ThirdwebDebug.LogWarning("Failed to report usage analytics.");
667-
}
668-
}
669629
}
670630
}

Diff for: Assets/Thirdweb/Runtime/Unity/Wallets/Core/MetaMaskWallet.cs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace Thirdweb.Unity
1616
public class MetaMaskWallet : IThirdwebWallet
1717
{
1818
public ThirdwebClient Client => _client;
19+
public string WalletId => "metamask";
1920
public ThirdwebAccountType AccountType => ThirdwebAccountType.ExternalAccount;
2021

2122
private static ThirdwebClient _client;

Diff for: Assets/Thirdweb/Runtime/Unity/Wallets/Core/WalletConnectWallet.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Thirdweb.Unity
1818
public class WalletConnectWallet : IThirdwebWallet
1919
{
2020
public ThirdwebClient Client => _client;
21-
21+
public string WalletId => "walletconnect";
2222
public ThirdwebAccountType AccountType => ThirdwebAccountType.ExternalAccount;
2323

2424
protected ThirdwebClient _client;

0 commit comments

Comments
 (0)