From 24475eb629a233af2e9636ee65d80c52acd8bba0 Mon Sep 17 00:00:00 2001 From: 0xFirekeeper <0xFirekeeper@gmail.com> Date: Wed, 24 May 2023 05:23:03 +0300 Subject: [PATCH] Fix magic link internal server error --- Assets/Thirdweb/Core/Scripts/ThirdwebSDK.cs | 3 +- Assets/Thirdweb/Core/Scripts/Wallet.cs | 5 +- .../Examples/Scenes/Scene_Marketplace.unity | 311 ++++-------------- .../Scripts/Prefabs/Prefab_Writing.cs | 38 +-- .../Prefabs/Scripts/MagicUnity.cs | 9 +- 5 files changed, 99 insertions(+), 267 deletions(-) diff --git a/Assets/Thirdweb/Core/Scripts/ThirdwebSDK.cs b/Assets/Thirdweb/Core/Scripts/ThirdwebSDK.cs index 35bd26e6..483c37dd 100644 --- a/Assets/Thirdweb/Core/Scripts/ThirdwebSDK.cs +++ b/Assets/Thirdweb/Core/Scripts/ThirdwebSDK.cs @@ -146,7 +146,8 @@ public NativeSession(WalletProvider provider, int lastChainId, string lastRPC, A appName = options.wallet?.appName ?? "Thirdweb Game", appDescription = options.wallet?.appDescription ?? "Thirdweb Game Demo", appIcons = options.wallet?.appIcons ?? new string[] { "https://thirdweb.com/favicon.ico" }, - appUrl = options.wallet?.appUrl ?? "https://thirdweb.com" + appUrl = options.wallet?.appUrl ?? "https://thirdweb.com", + magicLinkApiKey = options.wallet?.magicLinkApiKey, }; FetchChainData(); diff --git a/Assets/Thirdweb/Core/Scripts/Wallet.cs b/Assets/Thirdweb/Core/Scripts/Wallet.cs index 49a75858..79ee838f 100644 --- a/Assets/Thirdweb/Core/Scripts/Wallet.cs +++ b/Assets/Thirdweb/Core/Scripts/Wallet.cs @@ -106,6 +106,9 @@ public async Task Connect(WalletConnection walletConnection) await new WaitForSeconds(0.5f); } + if (ThirdwebManager.Instance.SDK.nativeSession.options.wallet?.magicLinkApiKey == null) + throw new UnityException("MagicLink API Key is not set!"); + MagicUnity.Instance.Initialize( ThirdwebManager.Instance.SDK.nativeSession.options.wallet?.magicLinkApiKey, new link.magic.unity.sdk.Relayer.CustomNodeConfiguration(oldSession.lastRPC, oldSession.lastChainId) @@ -528,7 +531,7 @@ public async Task RecoverAddress(string message, string signature) { var signer = new EthereumMessageSigner(); var addressRecovered = signer.EncodeUTF8AndEcRecover(message, signature); - return addressRecovered; // TODO: Check viability + return addressRecovered; } } diff --git a/Assets/Thirdweb/Examples/Scenes/Scene_Marketplace.unity b/Assets/Thirdweb/Examples/Scenes/Scene_Marketplace.unity index 86d08519..2946b268 100644 --- a/Assets/Thirdweb/Examples/Scenes/Scene_Marketplace.unity +++ b/Assets/Thirdweb/Examples/Scenes/Scene_Marketplace.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_IndirectSpecularColor: {r: 0.3708985, g: 0.3783704, b: 0.35722548, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -380,7 +380,6 @@ RectTransform: - {fileID: 1480913186} - {fileID: 2775678917868836931} - {fileID: 960218563} - - {fileID: 2414829411545535877} - {fileID: 1919283922} m_Father: {fileID: 0} m_RootOrder: 4 @@ -448,7 +447,7 @@ MonoBehaviour: - gameObjects: - {fileID: 960218562} - gameObjects: - - {fileID: 1783570060} + - {fileID: 0} --- !u!4 &825054373 Transform: m_ObjectHideFlags: 0 @@ -753,11 +752,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1550381721} m_CullTransparentMesh: 1 ---- !u!1 &1783570060 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 7877806352732901850, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} - m_PrefabInstance: {fileID: 2285981558031324588} - m_PrefabAsset: {fileID: 0} --- !u!224 &1919283922 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 6187535723501583949, guid: c1ebffa97f49c3d40b9927ff37c9c4f3, type: 3} @@ -770,326 +764,220 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 574059470} m_Modifications: - - target: {fileID: 696252699284340127, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_Name - value: 'Prefab_ConnectWallet ' - objectReference: {fileID: 0} - - target: {fileID: 869323735247564608, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 351517270, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 869323735247564608, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 351517270, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 869323735247564608, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 351517270, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 869323735247564608, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 351517270, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 869323735247564608, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 351517270, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 5263241086014312978, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5617547850687684258, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 679192014, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 5617547850687684258, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 679192014, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 5617547850687684258, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 679192014, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 5617547850687684258, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 679192014, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 5617547850687684258, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_Pivot.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_Pivot.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_RootOrder - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_AnchorMax.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_AnchorMin.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_SizeDelta.x - value: 250 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_SizeDelta.y - value: 60 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_AnchoredPosition.x - value: -50 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 679192014, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.y - value: -20 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} - propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 8438017473816786819, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 1045367076, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 8438017473816786819, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 1045367076, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 8438017473816786819, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 1045367076, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 8438017473816786819, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 1045367076, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 8438017473816786819, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + - target: {fileID: 1045367076, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} ---- !u!1001 &2285981558031324588 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 574059470} - m_Modifications: - - target: {fileID: 1782919512759592407, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 696252699284340127, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + propertyPath: m_Name + value: 'Prefab_ConnectWallet ' + objectReference: {fileID: 0} + - target: {fileID: 1335404546759128317, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 1782919512759592407, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 1335404546759128317, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 1782919512759592407, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 1335404546759128317, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 1782919512759592407, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 1335404546759128317, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 1782919512759592407, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 1335404546759128317, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 1809789802022172611, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 1335404547797609897, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6243171688188928066, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 1809789802022172611, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6243171688188928066, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 1809789802022172611, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6243171688188928066, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 1809789802022172611, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6243171688188928066, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 1809789802022172611, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6243171688188928066, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_Pivot.x - value: 0.5 + value: 1 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_Pivot.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_RootOrder - value: 5 + value: 4 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMax.x - value: 0.5 + value: 1 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMax.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMin.x - value: 0.5 + value: 1 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMin.y value: 1 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_SizeDelta.x value: 250 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_SizeDelta.y value: 60 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: -50 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.y value: -20 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 6539300962087038060, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 5148122847268743721, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 7558163674396937018, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 5148122847268743721, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 7558163674396937018, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 5148122847268743721, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 7558163674396937018, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 5148122847268743721, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 7558163674396937018, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 5148122847268743721, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} + - target: {fileID: 7558163674396937018, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 7276129280455848231, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7877806352732901850, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} - propertyPath: m_Name - value: Prefab_ConnectWalletNative - objectReference: {fileID: 0} m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} ---- !u!224 &2414829411545535877 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 4483969581313638441, guid: 5970370bfc0e0d5468d98e62e7ad038d, type: 3} - m_PrefabInstance: {fileID: 2285981558031324588} - m_PrefabAsset: {fileID: 0} + m_SourcePrefab: {fileID: 100100000, guid: a6218c0a90161f349bc6bc87fbc624da, type: 3} --- !u!224 &2775678917868836931 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 7988299437291109124, guid: c0a6febe87e862049aafa44a9f65ff2c, type: 3} @@ -1152,63 +1040,6 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 379ed01658d62a14484f953196ff19db, type: 3} ---- !u!1001 &4758541914668730807 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3202619366221042882, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_RootOrder - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 3202619366221042882, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3202619366221042882, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3202619366221042882, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3202619366221042882, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3202619366221042882, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3202619366221042882, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3202619366221042882, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3202619366221042882, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3202619366221042882, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3202619366221042882, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3202619366221042887, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} - propertyPath: m_Name - value: WalletConnect - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: aed198bf91a75b94db61c4f472ea1579, type: 3} --- !u!1001 &5213221436888228679 PrefabInstance: m_ObjectHideFlags: 0 @@ -1611,7 +1442,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6187535723501583949, guid: c1ebffa97f49c3d40b9927ff37c9c4f3, type: 3} propertyPath: m_RootOrder - value: 6 + value: 5 objectReference: {fileID: 0} - target: {fileID: 6187535723501583949, guid: c1ebffa97f49c3d40b9927ff37c9c4f3, type: 3} propertyPath: m_AnchorMax.x diff --git a/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Writing.cs b/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Writing.cs index 0472d7fb..41bc36c3 100644 --- a/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Writing.cs +++ b/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_Writing.cs @@ -18,33 +18,33 @@ public async void MintERC20() try { // Traditional Minting (Requires Minter Role) - Contract contract = ThirdwebManager.Instance.SDK.GetContract(TOKEN_ERC20_CONTRACT); + // Contract contract = ThirdwebManager.Instance.SDK.GetContract(TOKEN_ERC20_CONTRACT); // Minting // var transactionResult = await contract.ERC20.Mint("1.2"); // Debugger.Instance.Log("[Mint ERC20] Successful", transactionResult.ToString()); // Signature Minting - var receiverAddress = await ThirdwebManager.Instance.SDK.wallet.GetAddress(); - var payload = new ERC20MintPayload(receiverAddress, "3.2"); - var signedPayload = await contract.ERC20.signature.Generate(payload); - bool isValid = await contract.ERC20.signature.Verify(signedPayload); - if (isValid) - { - Debugger.Instance.Log("Sign minting ERC20...", $"Signature: {signedPayload.signature}"); - var result = await contract.ERC20.signature.Mint(signedPayload); - Debugger.Instance.Log("[Mint (Signature) ERC20] Successful", result.ToString()); - } - else - { - Debugger.Instance.Log("Signature Invalid", $"Signature: {signedPayload.signature} is invalid!"); - } + // var receiverAddress = await ThirdwebManager.Instance.SDK.wallet.GetAddress(); + // var payload = new ERC20MintPayload(receiverAddress, "3.2"); + // var signedPayload = await contract.ERC20.signature.Generate(payload); + // bool isValid = await contract.ERC20.signature.Verify(signedPayload); + // if (isValid) + // { + // Debugger.Instance.Log("Sign minting ERC20...", $"Signature: {signedPayload.signature}"); + // var result = await contract.ERC20.signature.Mint(signedPayload); + // Debugger.Instance.Log("[Mint (Signature) ERC20] Successful", result.ToString()); + // } + // else + // { + // Debugger.Instance.Log("Signature Invalid", $"Signature: {signedPayload.signature} is invalid!"); + // } // Claiming - // Debugger.Instance.Log("Request Sent", "Pending confirmation..."); - // Contract contract = ThirdwebManager.Instance.SDK.GetContract(DROP_ERC20_CONTRACT); - // var result = await contract.ERC20.Claim("0.3"); - // Debugger.Instance.Log("[Claim ERC20] Successful", result.ToString()); + Debugger.Instance.Log("Request Sent", "Pending confirmation..."); + Contract contract = ThirdwebManager.Instance.SDK.GetContract(DROP_ERC20_CONTRACT); + var result = await contract.ERC20.Claim("0.3"); + Debugger.Instance.Log("[Claim ERC20] Successful", result.ToString()); } catch (System.Exception e) { diff --git a/Assets/Thirdweb/Plugins/magic-unity/link.magic.unity.sdk/Prefabs/Scripts/MagicUnity.cs b/Assets/Thirdweb/Plugins/magic-unity/link.magic.unity.sdk/Prefabs/Scripts/MagicUnity.cs index 341ed260..829519eb 100644 --- a/Assets/Thirdweb/Plugins/magic-unity/link.magic.unity.sdk/Prefabs/Scripts/MagicUnity.cs +++ b/Assets/Thirdweb/Plugins/magic-unity/link.magic.unity.sdk/Prefabs/Scripts/MagicUnity.cs @@ -1,12 +1,7 @@ -using System; -using System.Collections; -using System.Collections.Generic; using System.Threading.Tasks; using link.magic.unity.sdk; using link.magic.unity.sdk.Relayer; using Nethereum.ABI.EIP712; -using Nethereum.JsonRpc.Client; -using Thirdweb.Contracts.Forwarder.ContractDefinition; using UnityEngine; public class MagicUnity : MonoBehaviour @@ -66,6 +61,8 @@ public async Task PersonalSign(string message) public async Task SignTypedDataV4(T data, TypedData typedData) where TDomain : IDomain { - throw new NotImplementedException("Magic does not support EIP712"); + Debug.LogWarning("SignTypedDataV4 may not be implemented as part of Magic's Unity SDK."); + var signTypedData = new Nethereum.RPC.AccountSigning.EthSignTypedDataV4(_magic.Provider); + return await signTypedData.SendRequestAsync(typedData.ToJson(data)); } }