Upgrade MetaMask SDK to 2.0.0
This PR upgrades the embedded MetaMask SDK to the latest version (2.0.0). This version simplifies the prefab configuration and fixes several bugs
PR-Codex overview
This PR focuses on removing unnecessary files and adding new MetaMask SDK components and NaughtyAttributes features.
Detailed summary
- Deleted unnecessary files related to Infura and MetaMaskWindow
- Added MetaMask SDK components for different runtime versions
- Added NaughtyAttributes scripts for attribute handling
The following files were skipped due to too many changes:
Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyDrawers.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyValidators.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/DrawerAttributes_SpecialCase/ShowNonSerializedFieldAttribute.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Models/MetaMaskUnityRpcUrlConfig.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyDrawers_SpecialCase.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/SocketIOUnity/Runtime/SocketIOClient/SocketIO.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/DrawerAttributes_SpecialCase/SpecialCaseDrawerAttribute.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/MetaMaskUnityException.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/MetaMaskSDK.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask.NEthereum/MetaMaskNEthereumExtensions.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/Utility.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Logging/MetaMaskLogToText.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/EditorGUI.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/NaughtyInspector.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/Utility/SavedBool.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/DrawerAttributes/DrawerAttribute.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/Utility/ButtonUtility.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/Utility/PropertyUtility.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyDrawers/PropertyDrawerBase.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/DecoratorDrawers/InfoBoxDecoratorDrawer.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyValidators/PropertyValidatorBase.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyValidators/RequiredPropertyValidator.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/DrawerAttributes_SpecialCase/ShowNativePropertyAttribute.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyDrawers_SpecialCase/ReorderableListPropertyDrawer.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyDrawers_SpecialCase/SpecialCasePropertyDrawerBase.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/DrawerAttributes_SpecialCase/ShowNonSerializedFieldAttribute.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/EditorGUI/MetaMaskWindow.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/Utility/NaughtyEditorGUI.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/Utility/ReflectionUtility.cs.meta,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/ValidatorAttributes/RequiredAttribute.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Transports/Unity/UGUI/MetaMaskUnityUITransport.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Contracts/ScriptableContract.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Logging/MetaMaskLogToText.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Utilities/Singleton.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/Utility/SavedBool.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/package.json,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/DrawerAttributes/InfoBoxAttribute.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/package.json,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Models/UnityChainInfo.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/DrawerAttributes/HorizontalLineAttribute.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Utilities/TokenDisplay.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/MetaMaskUnityEventHandler.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/MetaAttributes/ShowIfAttribute.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Logging/MetaMaskUnityLogger.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/MetaAttributes/EnableIfAttribute.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/MetaAttributes/DisableIfAttribute.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Installer/Editor/MetaMaskInstallerWindow.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/DecoratorDrawers/HorizontalLineDecoratorDrawer.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/DrawerAttributes_SpecialCase/ButtonAttribute.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyValidators/PropertyValidatorBase.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Transports/Unity/MetaMaskUnityScriptableObjectTransport.cs,Assets/Thirdweb/Core/Scripts/Wallets/ThirdwebMetamask.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/MetaAttributes/ShowIfAttributeBase.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/MetaAttributes/EnableIfAttributeBase.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Third,Assets/Thirdweb/Core/Plugins/MetaMask/Plugins/Libraries/NaughtyAttributes/Scripts/Core/Utility/EColor.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Utilities/HideUntilMetaMaskReady.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/IMetaMaskSDK.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/IO/MetaMaskHttpService.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/MetaMaskConfig.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Providers/JsSDKProvider.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/DecoratorDrawers/InfoBoxDecoratorDrawer.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/Utility/ButtonUtility.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyDrawers_SpecialCase/SpecialCasePropertyDrawerBase.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Utilities/TextureBase64.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyDrawers/PropertyDrawerBase.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Resources/MetaMask/Config/Default.asset,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyValidators/RequiredPropertyValidator.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/Utility/ReflectionUtility.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/Cryptography/UnityEciesProvider.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Resources/MetaMask/Prefabs/UI/MetaMask,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/PropertyDrawers_SpecialCase/ReorderableListPropertyDrawer.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/NaughtyInspector.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Resources/MetaMask/Prefabs/UI/MetaMask,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/Utility/PropertyUtility.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/MetaMaskUnity.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Resources/MetaMask/Prefabs/UI/OTP,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/Scripts/Editor/Utility/NaughtyEditorGUI.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Scripts/MetaMaskSDK.cs,Assets/Thirdweb/Core/Plugins/MetaMask/Resources/MetaMask/Prefabs/UI/Dynamic,Assets/Thirdweb/Core/Plugins/MetaMask/Editor/NaughtyAttributes/README.html
✨ Ask PR-Codex anything about this PR by commenting with
/codex {your question}
Thanks @ecp4224 , looks like some good effort was made this version :) Tested on Desktop and worked fine. Testing on Android and iOS next. In the meantime let me know if this makes sense to you too.
New connection flow is interesting but previously the mobile app post connect showed "you can return to the app" msg, this new step of choosing account kind of circumvents it, minor feedback for future versions; not to leave users confused.
Works on mobile, will merge tonight after some additional testing, thanks again Eddie :)
Hey @ecp4224 don't think I can merge this after testing further on mobile, seems every request attempts to reopen the mm mobile app from scratch and re-deep link/connect and not actually trigger a signature
You end up in weird states on both iOS and Android where it feels like multiple connections are ongoing and requests stop popping up
Eventually they work for a while without feeling like they reopen the app from scratch but I think it's too unstable currently
Also sidenote the OTP panel has a missing nested prefab causing an error on import
Thank you for your efforts @ecp4224 !