Skip to content

Commit c69fe1c

Browse files
authored
Deprecate WalletConnect in favor of Reown AppKit (#240)
1 parent 358a5c8 commit c69fe1c

File tree

356 files changed

+39927
-94644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+39927
-94644
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,6 @@ dotnet_diagnostic.JSON002.severity = silent
164164

165165
# CS8981: The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
166166
dotnet_diagnostic.CS8981.severity = suggestion
167+
168+
# IDE0055: Fix formatting
169+
dotnet_diagnostic.IDE0055.severity = silent
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest
3-
xmlns:android="http://schemas.android.com/apk/res/android"
4-
package="com.thirdweb.unity"
5-
xmlns:tools="http://schemas.android.com/tools">
6-
7-
<application>
8-
<activity android:name="com.unity3d.player.UnityPlayerActivity"
9-
android:theme="@style/UnityThemeSelector">
10-
<intent-filter>
11-
<action android:name="android.intent.action.MAIN" />
12-
<category android:name="android.intent.category.LAUNCHER" />
13-
</intent-filter>
14-
15-
<intent-filter>
16-
<action android:name="android.intent.action.VIEW" />
17-
<category android:name="android.intent.category.DEFAULT" />
18-
<category android:name="android.intent.category.BROWSABLE" />
19-
<!-- Set your bundle id here -->
20-
<!-- Replace 'com.thirdweb.unitysdk' with your desired scheme -->
21-
<data android:scheme="com.thirdweb.unitysdk" />
22-
</intent-filter>
23-
24-
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
25-
</activity>
26-
</application>
27-
</manifest>
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
package="com.thirdweb.unity"
5+
xmlns:tools="http://schemas.android.com/tools"
6+
>
7+
<application>
8+
<activity
9+
android:name="com.unity3d.player.UnityPlayerActivity"
10+
android:theme="@style/UnityThemeSelector"
11+
>
12+
<intent-filter>
13+
<action android:name="android.intent.action.MAIN" />
14+
<category android:name="android.intent.category.LAUNCHER" />
15+
</intent-filter>
16+
<intent-filter>
17+
<action android:name="android.intent.action.VIEW" />
18+
<category android:name="android.intent.category.DEFAULT" />
19+
<category android:name="android.intent.category.BROWSABLE" />
20+
<!-- Set your bundle id here -->
21+
<!-- Replace 'com.thirdweb.unitysdk' with your desired scheme -->
22+
<data android:scheme="com.thirdweb.unitysdk" />
23+
</intent-filter>
24+
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
25+
</activity>
26+
</application>
27+
</manifest>

Assets/Thirdweb/Editor/Postprocessor.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,16 @@ public class Postprocessor
2424
[PostProcessBuild(1)]
2525
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
2626
{
27-
if (target != BuildTarget.WebGL) return;
28-
if (!supportedPostprocessor) return;
29-
if (!IsEnable) return;
27+
if (target != BuildTarget.WebGL)
28+
return;
29+
if (!supportedPostprocessor)
30+
return;
31+
if (!IsEnable)
32+
return;
3033

3134
var path = Path.Combine(pathToBuiltProject, "index.html");
32-
if (!File.Exists(path)) return;
35+
if (!File.Exists(path))
36+
return;
3337

3438
var html = File.ReadAllText(path);
3539

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<dependencies>
2-
<androidPackages>
3-
<androidPackage spec="androidx.browser:browser:1.4.0" />
4-
</androidPackages>
5-
</dependencies>
2+
<androidPackages>
3+
<androidPackage spec="androidx.browser:browser:1.4.0" />
4+
</androidPackages>
5+
</dependencies>

Assets/Thirdweb/Editor/ThirdwebManagerEditor.cs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using UnityEngine;
2-
using UnityEditor;
3-
using Thirdweb.Unity;
41
using System.Reflection;
2+
using Thirdweb.Unity;
3+
using UnityEditor;
4+
using UnityEngine;
55

66
namespace Thirdweb.Editor
77
{
@@ -11,8 +11,6 @@ public abstract class ThirdwebManagerBaseEditor<T> : UnityEditor.Editor
1111
protected SerializedProperty initializeOnAwakeProp;
1212
protected SerializedProperty showDebugLogsProp;
1313
protected SerializedProperty autoConnectLastWalletProp;
14-
protected SerializedProperty supportedChainsProp;
15-
protected SerializedProperty includedWalletIdsProp;
1614
protected SerializedProperty redirectPageHtmlOverrideProp;
1715
protected SerializedProperty rpcOverridesProp;
1816

@@ -27,8 +25,6 @@ protected virtual void OnEnable()
2725
initializeOnAwakeProp = FindProp("InitializeOnAwake");
2826
showDebugLogsProp = FindProp("ShowDebugLogs");
2927
autoConnectLastWalletProp = FindProp("AutoConnectLastWallet");
30-
supportedChainsProp = FindProp("SupportedChains");
31-
includedWalletIdsProp = FindProp("IncludedWalletIds");
3228
redirectPageHtmlOverrideProp = FindProp("RedirectPageHtmlOverride");
3329
rpcOverridesProp = FindProp("RpcOverrides");
3430

@@ -90,10 +86,7 @@ protected virtual void DrawMiscTab()
9086
DrawProperty(rpcOverridesProp, "RPC Overrides");
9187
GUILayout.Space(10);
9288
EditorGUILayout.LabelField("OAuth Redirect Page HTML Override", EditorStyles.boldLabel);
93-
redirectPageHtmlOverrideProp.stringValue = EditorGUILayout.TextArea(redirectPageHtmlOverrideProp.stringValue, GUILayout.MinHeight(75));
94-
GUILayout.Space(10);
95-
DrawProperty(supportedChainsProp, "WalletConnect Supported Chains");
96-
DrawProperty(includedWalletIdsProp, "WalletConnect Included Wallet IDs");
89+
redirectPageHtmlOverrideProp.stringValue = EditorGUILayout.TextArea(redirectPageHtmlOverrideProp.stringValue, GUILayout.MinHeight(150));
9790
}
9891

9992
protected virtual void DrawDebugTab()
@@ -170,7 +163,7 @@ protected void InitializeStyles()
170163
{
171164
fontStyle = FontStyle.Bold,
172165
alignment = TextAnchor.MiddleLeft,
173-
padding = new RectOffset(10, 10, 10, 10)
166+
padding = new RectOffset(10, 10, 10, 10),
174167
};
175168
}
176169

Assets/Thirdweb/Examples/Scenes/Scene_Playground.unity

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2887,8 +2887,8 @@ MonoBehaviour:
28872887
m_Script: {fileID: 11500000, guid: d2b449f3a04d6c94eb686cd39ae75785, type: 3}
28882888
m_Name:
28892889
m_EditorClassIdentifier:
2890-
ActiveChainId: 421614
2891-
WebglForceMetamaskExtension: 1
2890+
ActiveChainId: 84532
2891+
WebglForceMetamaskExtension: 0
28922892
ConnectWalletPanel: {fileID: 974997944}
28932893
PrivateKeyWalletButton: {fileID: 736464798}
28942894
EcosystemWalletButton: {fileID: 1496910716}
@@ -2904,7 +2904,7 @@ MonoBehaviour:
29042904
LogText: {fileID: 2031826890}
29052905
InputField: {fileID: 0}
29062906
InputFieldSubmitButton: {fileID: 0}
2907-
- Identifier: WalletConnectWallet
2907+
- Identifier: ReownWallet
29082908
Panel: {fileID: 1922056857}
29092909
Action1Button: {fileID: 1632196339}
29102910
Action2Button: {fileID: 1340124642}
@@ -4230,6 +4230,26 @@ PrefabInstance:
42304230
propertyPath: m_AnchoredPosition.x
42314231
value: 0
42324232
objectReference: {fileID: 0}
4233+
- target: {fileID: 753652708382381279, guid: f1f7a02a8c5efe54c95062bd90592227, type: 3}
4234+
propertyPath: m_AnchorMax.y
4235+
value: 0
4236+
objectReference: {fileID: 0}
4237+
- target: {fileID: 753652708382381279, guid: f1f7a02a8c5efe54c95062bd90592227, type: 3}
4238+
propertyPath: m_AnchorMin.y
4239+
value: 0
4240+
objectReference: {fileID: 0}
4241+
- target: {fileID: 753652708382381279, guid: f1f7a02a8c5efe54c95062bd90592227, type: 3}
4242+
propertyPath: m_SizeDelta.x
4243+
value: 0
4244+
objectReference: {fileID: 0}
4245+
- target: {fileID: 753652708382381279, guid: f1f7a02a8c5efe54c95062bd90592227, type: 3}
4246+
propertyPath: m_AnchoredPosition.x
4247+
value: 0
4248+
objectReference: {fileID: 0}
4249+
- target: {fileID: 753652708382381279, guid: f1f7a02a8c5efe54c95062bd90592227, type: 3}
4250+
propertyPath: m_AnchoredPosition.y
4251+
value: 0
4252+
objectReference: {fileID: 0}
42334253
- target: {fileID: 1288923049808236541, guid: f1f7a02a8c5efe54c95062bd90592227, type: 3}
42344254
propertyPath: <BundleId>k__BackingField
42354255
value: com.thirdweb.unitysdk

Assets/Thirdweb/Examples/Scripts/PlaygroundManager.cs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.Threading.Tasks;
23
using Newtonsoft.Json;
34
using TMPro;
45
using UnityEngine;
@@ -24,7 +25,7 @@ public class WalletPanelUI
2425
public class PlaygroundManager : MonoBehaviour
2526
{
2627
[field: SerializeField, Header("Wallet Options")]
27-
private ulong ActiveChainId = 421614;
28+
private ulong ActiveChainId = 84532;
2829

2930
[field: SerializeField]
3031
private bool WebglForceMetamaskExtension = false;
@@ -65,8 +66,8 @@ private async void Start()
6566
{
6667
Decimals = 18,
6768
Name = "ETH",
68-
Symbol = "ETH"
69-
}
69+
Symbol = "ETH",
70+
},
7071
};
7172
}
7273
}
@@ -77,6 +78,11 @@ private void InitializePanels()
7778

7879
ConnectWalletPanel.SetActive(true);
7980

81+
if (ThirdwebManager.Instance != null && ThirdwebManager.Instance.ActiveWallet != null)
82+
{
83+
ThirdwebManager.Instance.ActiveWallet.Disconnect();
84+
}
85+
8086
PrivateKeyWalletButton.onClick.RemoveAllListeners();
8187
PrivateKeyWalletButton.onClick.AddListener(() =>
8288
{
@@ -90,7 +96,7 @@ private void InitializePanels()
9096
WalletConnectButton.onClick.RemoveAllListeners();
9197
WalletConnectButton.onClick.AddListener(() =>
9298
{
93-
var options = GetWalletOptions(WalletProvider.WalletConnectWallet);
99+
var options = GetWalletOptions(WalletProvider.ReownWallet);
94100
ConnectWallet(options);
95101
});
96102
}
@@ -99,7 +105,7 @@ private async void ConnectWallet(WalletOptions options)
99105
{
100106
// Connect the wallet
101107

102-
var internalWalletProvider = options.Provider == WalletProvider.MetaMaskWallet ? WalletProvider.WalletConnectWallet : options.Provider;
108+
var internalWalletProvider = options.Provider == WalletProvider.MetaMaskWallet ? WalletProvider.ReownWallet : options.Provider;
103109
var currentPanel = WalletPanels.Find(panel => panel.Identifier == internalWalletProvider.ToString());
104110

105111
Log(currentPanel.LogText, $"Connecting...");
@@ -156,9 +162,8 @@ private WalletOptions GetWalletOptions(WalletProvider provider)
156162
case WalletProvider.EcosystemWallet:
157163
var ecosystemWalletOptions = new EcosystemWalletOptions(ecosystemId: "ecosystem.the-bonfire", authprovider: AuthProvider.Google);
158164
return new WalletOptions(provider: WalletProvider.EcosystemWallet, chainId: ActiveChainId, ecosystemWalletOptions: ecosystemWalletOptions);
159-
case WalletProvider.WalletConnectWallet:
160-
var externalWalletProvider =
161-
Application.platform == RuntimePlatform.WebGLPlayer && WebglForceMetamaskExtension ? WalletProvider.MetaMaskWallet : WalletProvider.WalletConnectWallet;
165+
case WalletProvider.ReownWallet:
166+
var externalWalletProvider = Application.platform == RuntimePlatform.WebGLPlayer && WebglForceMetamaskExtension ? WalletProvider.MetaMaskWallet : WalletProvider.ReownWallet;
162167
return new WalletOptions(provider: externalWalletProvider, chainId: ActiveChainId);
163168
default:
164169
throw new System.NotImplementedException("Wallet provider not implemented for this example.");
@@ -342,7 +347,7 @@ private void InitializeContractsPanel()
342347
try
343348
{
344349
LoadingLog(panel.LogText);
345-
var dropErc1155Contract = await ThirdwebManager.Instance.GetContract(address: "0x94894F65d93eb124839C667Fc04F97723e5C4544", chainId: ActiveChainId);
350+
var dropErc1155Contract = await ThirdwebManager.Instance.GetContract(address: "0x8F0a4dde7791fa9B6C62E0B099a1a3ff6dd1cF29", chainId: ActiveChainId);
346351
var nft = await dropErc1155Contract.ERC1155_GetNFT(tokenId: 1);
347352
Log(panel.LogText, $"NFT: {JsonConvert.SerializeObject(nft.Metadata)}");
348353
var sprite = await nft.GetNFTSprite(client: ThirdwebManager.Instance.Client);
@@ -365,7 +370,7 @@ private void InitializeContractsPanel()
365370
try
366371
{
367372
LoadingLog(panel.LogText);
368-
var contract = await ThirdwebManager.Instance.GetContract(address: "0x6A7a26c9a595E6893C255C9dF0b593e77518e0c3", chainId: ActiveChainId);
373+
var contract = await ThirdwebManager.Instance.GetContract(address: "0x8F0a4dde7791fa9B6C62E0B099a1a3ff6dd1cF29", chainId: ActiveChainId);
369374
var result = await contract.ERC1155_URI(tokenId: 1);
370375
Log(panel.LogText, $"Result (uri): {result}");
371376
}
@@ -382,7 +387,7 @@ private void InitializeContractsPanel()
382387
try
383388
{
384389
LoadingLog(panel.LogText);
385-
var dropErc20Contract = await ThirdwebManager.Instance.GetContract(address: "0xEBB8a39D865465F289fa349A67B3391d8f910da9", chainId: ActiveChainId);
390+
var dropErc20Contract = await ThirdwebManager.Instance.GetContract(address: "0x28C1209fa6e7f1B258Ef65527C94129c6F82995f", chainId: ActiveChainId);
386391
var symbol = await dropErc20Contract.ERC20_Symbol();
387392
var balance = await dropErc20Contract.ERC20_BalanceOf(ownerAddress: await ThirdwebManager.Instance.GetActiveWallet().GetAddress());
388393
var balanceEth = Utils.ToEth(wei: balance.ToString(), decimalsToDisplay: 0, addCommas: false);

Assets/Thirdweb/Plugins/ThreadingPatcher/Editor/WebGLThreadingPatcher.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using Mono.Cecil;
2-
using Mono.Cecil.Cil;
31
using System.IO;
42
using System.Linq;
3+
using Mono.Cecil;
4+
using Mono.Cecil.Cil;
55
using UnityEditor;
66
using UnityEditor.Build;
77
using UnityEditor.Build.Reporting;
@@ -805,7 +805,7 @@ private static TypeDefinition AddMonoPInvokeCallbackAttribute(ModuleDefinition m
805805
{
806806
var type = new TypeDefinition("AOT", "MonoPInvokeCallbackAttribute", TypeAttributes.AnsiClass | TypeAttributes.AutoClass | TypeAttributes.BeforeFieldInit | TypeAttributes.Public)
807807
{
808-
BaseType = moduleDefinition.ImportReference(moduleDefinition.Types.First(t => t.FullName == "System.Attribute"))
808+
BaseType = moduleDefinition.ImportReference(moduleDefinition.Types.First(t => t.FullName == "System.Attribute")),
809809
};
810810
var ctor = new MethodDefinition(
811811
".ctor",

Assets/Thirdweb/Plugins/ThreadingPatcher/Runtime/TimerRunner.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ private void Awake()
3030
var scheduler = timer.GetNestedType("Scheduler", BindingFlags.NonPublic);
3131

3232
var timerSchedulerInstance = scheduler.GetProperty("Instance").GetValue(null);
33-
_timerSchedulerLoop = (Func<int>)scheduler.GetMethod("RunSchedulerLoop", BindingFlags.Instance | BindingFlags.NonPublic)
34-
.CreateDelegate(typeof(Func<int>), timerSchedulerInstance);
33+
_timerSchedulerLoop = (Func<int>)scheduler.GetMethod("RunSchedulerLoop", BindingFlags.Instance | BindingFlags.NonPublic).CreateDelegate(typeof(Func<int>), timerSchedulerInstance);
3534
}
3635

3736
[Preserve]
@@ -59,4 +58,4 @@ private IEnumerator TimerUpdateCoroutine()
5958
#pragma warning restore CS0162 // Unreachable code detected
6059
}
6160
}
62-
}
61+
}

Assets/Thirdweb/Plugins/WalletConnectUnity.meta

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)