diff --git a/Packages/io.chainsafe.web3-unity.hyperplay/Runtime/Libraries/ChainSafe.Gaming.HyperPlay.dll b/Packages/io.chainsafe.web3-unity.hyperplay/Runtime/Libraries/ChainSafe.Gaming.HyperPlay.dll index 2896eba43..09df3431e 100644 Binary files a/Packages/io.chainsafe.web3-unity.hyperplay/Runtime/Libraries/ChainSafe.Gaming.HyperPlay.dll and b/Packages/io.chainsafe.web3-unity.hyperplay/Runtime/Libraries/ChainSafe.Gaming.HyperPlay.dll differ diff --git a/Packages/io.chainsafe.web3-unity.loader/Editor.meta b/Packages/io.chainsafe.web3-unity.loader/Editor.meta new file mode 100644 index 000000000..d9aefbd5f --- /dev/null +++ b/Packages/io.chainsafe.web3-unity.loader/Editor.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +<<<<<<<< HEAD:Packages/io.chainsafe.web3-unity/Runtime/Prefabs/GUI Screens.meta +guid: 9702b9300cb77cf40a19eeabdb2523f7 +======== +guid: 89f45fbb72665a64eb12ddc6b921c914 +>>>>>>>> dev:Packages/io.chainsafe.web3-unity.ramp/Editor.meta +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity.loader/Editor/ScopedRegistryInstaller.cs b/Packages/io.chainsafe.web3-unity.loader/Editor/ScopedRegistryInstaller.cs new file mode 100644 index 000000000..dba1a0272 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity.loader/Editor/ScopedRegistryInstaller.cs @@ -0,0 +1,117 @@ +using UnityEditor; +using UnityEngine; +using System.IO; +using System.Linq; +using System.Text; +using Newtonsoft.Json.Linq; + +[InitializeOnLoad] +public static class ScopedRegistryAndDependencyInstaller +{ + private static readonly string RegistryName = "package.openupm.com"; + private static readonly string RegistryUrl = "https://package.openupm.com"; + private static readonly string[] RequiredScopes = + { + "com.reown", + "com.nethereum.unity" + }; + + // The Git dependency to add + private const string ChainsafeDependencyKey = "io.chainsafe.web3-unity"; + private const string ChainsafeLoaderDependencyKey = "io.chainsafe.web3-unity.loader"; + private const string ChainsafeDependencyUrl = "https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity#nikola/appkit-implementation-1210"; + private const string DependenciesKey = "Dependencies Installed"; + static ScopedRegistryAndDependencyInstaller() + { + // Check if we've already installed the registry and dependencies + if (PlayerPrefs.GetInt(DependenciesKey, 0) == 1) + return; + + InstallDependencies(); + } + + [MenuItem("Edit/Install dependencies")] + public static void InstallDependencies() + { + + try + { + // Set EditorPref so we don't run again if we run into an error. + PlayerPrefs.SetInt(DependenciesKey, 1); + string manifestPath = Path.Combine(Application.dataPath, "../Packages/manifest.json"); + string manifestJson = File.ReadAllText(manifestPath, Encoding.UTF8); + JObject manifest = JObject.Parse(manifestJson); + + // Ensure scopedRegistries node exists + if (manifest["scopedRegistries"] == null) + { + manifest["scopedRegistries"] = new JArray(); + } + + var scopedRegistries = (JArray)manifest["scopedRegistries"]; + + // Find if our registry already exists + var existingRegistry = scopedRegistries + .OfType() + .FirstOrDefault(r => + r["name"] != null && + r["name"].Value().Equals(RegistryName, System.StringComparison.OrdinalIgnoreCase)); + + if (existingRegistry == null) + { + // Create a new registry entry + existingRegistry = new JObject + { + ["name"] = RegistryName, + ["url"] = RegistryUrl, + ["scopes"] = new JArray(RequiredScopes) + }; + scopedRegistries.Add(existingRegistry); + } + else + { + // Registry exists, ensure scopes are present + JArray scopesArray = (JArray)existingRegistry["scopes"]; + var currentScopes = scopesArray.Select(s => s.Value()).ToList(); + + foreach (var scope in RequiredScopes) + { + if (!currentScopes.Contains(scope)) + { + scopesArray.Add(scope); + } + } + } + + // Add the Chainsafe Git dependency + if (manifest["dependencies"] == null) + { + manifest["dependencies"] = new JObject(); + } + + JObject dependencies = (JObject)manifest["dependencies"]; + + // If not present or differs, add/update it + if (dependencies[ChainsafeDependencyKey] == null || dependencies[ChainsafeDependencyKey].Value() != ChainsafeDependencyUrl) + { + dependencies[ChainsafeDependencyKey] = ChainsafeDependencyUrl; + } + + dependencies.Remove(ChainsafeLoaderDependencyKey); + + // Write changes back + File.WriteAllText(manifestPath, manifest.ToString(), Encoding.UTF8); + + + // Refresh to ensure Unity sees the new dependencies + AssetDatabase.Refresh(); + // Clear the key because maybe some other project you get will have the same name so since all the things inside of the editor + // have been installed, you can be safely removed. + PlayerPrefs.DeleteKey(DependenciesKey); + } + catch (System.Exception ex) + { + Debug.LogError($"Failed to install scoped registries or Chainsafe dependency: {ex.Message}\n{ex.StackTrace}"); + } + } +} diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Connection/MetamaskConnectionProvider.cs.meta b/Packages/io.chainsafe.web3-unity.loader/Editor/ScopedRegistryInstaller.cs.meta similarity index 83% rename from Packages/io.chainsafe.web3-unity/Runtime/Scripts/Connection/MetamaskConnectionProvider.cs.meta rename to Packages/io.chainsafe.web3-unity.loader/Editor/ScopedRegistryInstaller.cs.meta index 48f360a01..cea9b5306 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Connection/MetamaskConnectionProvider.cs.meta +++ b/Packages/io.chainsafe.web3-unity.loader/Editor/ScopedRegistryInstaller.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1b64d00084d2c544aa644a8a6010964d +guid: 64d044bf477d8b44e8b66fe8a00669d4 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Packages/io.chainsafe.web3-unity.loader/Editor/io.chainsafe.web3-unity.loader.editor.asmdef b/Packages/io.chainsafe.web3-unity.loader/Editor/io.chainsafe.web3-unity.loader.editor.asmdef new file mode 100644 index 000000000..acedd2690 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity.loader/Editor/io.chainsafe.web3-unity.loader.editor.asmdef @@ -0,0 +1,16 @@ +{ + "name": "io.chainsafe.web3-unity.loader.editor", + "rootNamespace": "", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/src/UnitySampleProject/Assets/Resources/MetamaskConnectionProvider.asset.meta b/Packages/io.chainsafe.web3-unity.loader/Editor/io.chainsafe.web3-unity.loader.editor.asmdef.meta similarity index 54% rename from src/UnitySampleProject/Assets/Resources/MetamaskConnectionProvider.asset.meta rename to Packages/io.chainsafe.web3-unity.loader/Editor/io.chainsafe.web3-unity.loader.editor.asmdef.meta index 6d2c3fd2e..132a5bd55 100644 --- a/src/UnitySampleProject/Assets/Resources/MetamaskConnectionProvider.asset.meta +++ b/Packages/io.chainsafe.web3-unity.loader/Editor/io.chainsafe.web3-unity.loader.editor.asmdef.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: e5b50e2ca9fe0504daf70376bceb84ac -NativeFormatImporter: +guid: 8dc848563b652e743954edaa49caee01 +AssemblyDefinitionImporter: externalObjects: {} - mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity.loader/package.json b/Packages/io.chainsafe.web3-unity.loader/package.json new file mode 100644 index 000000000..259ca3ee8 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity.loader/package.json @@ -0,0 +1,22 @@ +{ + "name": "io.chainsafe.web3-unity.loader", + "version": "3.1.0", + "displayName": "web3.unity SDK Loader", + "description": "Loads chaisnafe sdk in unity from git.", + "license": "LGPL-3.0-only", + "licensesUrl": "https://github.com/ChainSafe/web3.unity/blob/main/LICENSE", + "documentationUrl": "https://docs.gaming.chainsafe.io/", + "dependencies": { + "com.unity.nuget.newtonsoft-json": "3.0.2" + }, + "keywords": [ + "web3", + "ethereum", + "evm" + ], + "author": { + "name": "ChainSafe Gaming", + "email": "bd@chainsafe.io", + "url": "https://gaming.chainsafe.io/" + } +} \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity.loader/package.json.meta b/Packages/io.chainsafe.web3-unity.loader/package.json.meta new file mode 100644 index 000000000..a22704d40 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity.loader/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e6f15db2b3d892049a0883f05bfb57fc +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/ChainSafe.Gaming.Lootboxes.Chainlink.dll b/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/ChainSafe.Gaming.Lootboxes.Chainlink.dll index bfa3e0554..2262a0d03 100644 Binary files a/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/ChainSafe.Gaming.Lootboxes.Chainlink.dll and b/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/ChainSafe.Gaming.Lootboxes.Chainlink.dll differ diff --git a/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/Chainsafe.Gaming.Chainlink.dll b/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/Chainsafe.Gaming.Chainlink.dll index edc4739d8..bc1a90088 100644 Binary files a/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/Chainsafe.Gaming.Chainlink.dll and b/Packages/io.chainsafe.web3-unity.lootboxes/Chainlink/Runtime/Libraries/Chainsafe.Gaming.Chainlink.dll differ diff --git a/Packages/io.chainsafe.web3-unity.mud/Runtime/Libraries/ChainSafe.Gaming.Mud.dll b/Packages/io.chainsafe.web3-unity.mud/Runtime/Libraries/ChainSafe.Gaming.Mud.dll index 2c6207c61..7d4eef732 100644 Binary files a/Packages/io.chainsafe.web3-unity.mud/Runtime/Libraries/ChainSafe.Gaming.Mud.dll and b/Packages/io.chainsafe.web3-unity.mud/Runtime/Libraries/ChainSafe.Gaming.Mud.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Editor/Reown/ReownWebGLPreBuild.cs b/Packages/io.chainsafe.web3-unity/Editor/Reown/ReownWebGLPreBuild.cs new file mode 100644 index 000000000..a15a4edc5 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Editor/Reown/ReownWebGLPreBuild.cs @@ -0,0 +1,33 @@ +#if UNITY_WEBGL +using ChainSafe.Gaming.UnityPackage.Connection; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; +using UnityEngine; + +namespace ChainSafe.Gaming.Editor.Reown +{ + public class ReownWebGLPreBuild : IPreprocessBuildWithReport + { + public int callbackOrder { get; } + + public void OnPreprocessBuild(BuildReport report) + { + // Use AssetDatabase to load the TextAsset from Editor/Resources + string assetPath = "Packages/io.chainsafe.web3-unity/Editor/Resources/ViemChain.txt"; + TextAsset file = AssetDatabase.LoadAssetAtPath(assetPath); + + if (file != null) + { + ReownConnectionProvider provider = Resources.Load("ReownConnectionProvider"); + provider.PopulateViemNames(file.text); + } + else + { + Debug.LogError($"Could not load ViemChain.txt from path: {assetPath}"); + } + } + + } +} +#endif \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Editor/Reown/ReownWebGLPreBuild.cs.meta b/Packages/io.chainsafe.web3-unity/Editor/Reown/ReownWebGLPreBuild.cs.meta new file mode 100644 index 000000000..fdda8984e --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Editor/Reown/ReownWebGLPreBuild.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d3d6e85700ee413fbdc958b79453cb77 +timeCreated: 1734352805 \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Editor/Resources.meta b/Packages/io.chainsafe.web3-unity/Editor/Resources.meta new file mode 100644 index 000000000..f88079c10 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Editor/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 30e439052942efc489ad52ecab1c0197 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/ABIContractClassTemplate.txt b/Packages/io.chainsafe.web3-unity/Editor/Resources/ABIContractClassTemplate.txt similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/ABIContractClassTemplate.txt rename to Packages/io.chainsafe.web3-unity/Editor/Resources/ABIContractClassTemplate.txt diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/ABIContractClassTemplate.txt.meta b/Packages/io.chainsafe.web3-unity/Editor/Resources/ABIContractClassTemplate.txt.meta similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/ABIContractClassTemplate.txt.meta rename to Packages/io.chainsafe.web3-unity/Editor/Resources/ABIContractClassTemplate.txt.meta diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/CustomClassTemplate.txt b/Packages/io.chainsafe.web3-unity/Editor/Resources/CustomClassTemplate.txt similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/CustomClassTemplate.txt rename to Packages/io.chainsafe.web3-unity/Editor/Resources/CustomClassTemplate.txt diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/CustomClassTemplate.txt.meta b/Packages/io.chainsafe.web3-unity/Editor/Resources/CustomClassTemplate.txt.meta similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/CustomClassTemplate.txt.meta rename to Packages/io.chainsafe.web3-unity/Editor/Resources/CustomClassTemplate.txt.meta diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/EventTemplate.txt b/Packages/io.chainsafe.web3-unity/Editor/Resources/EventTemplate.txt similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/EventTemplate.txt rename to Packages/io.chainsafe.web3-unity/Editor/Resources/EventTemplate.txt diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/EventTemplate.txt.meta b/Packages/io.chainsafe.web3-unity/Editor/Resources/EventTemplate.txt.meta similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/EventTemplate.txt.meta rename to Packages/io.chainsafe.web3-unity/Editor/Resources/EventTemplate.txt.meta diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/FunctionTemplate.txt b/Packages/io.chainsafe.web3-unity/Editor/Resources/FunctionTemplate.txt similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/FunctionTemplate.txt rename to Packages/io.chainsafe.web3-unity/Editor/Resources/FunctionTemplate.txt diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/FunctionTemplate.txt.meta b/Packages/io.chainsafe.web3-unity/Editor/Resources/FunctionTemplate.txt.meta similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/FunctionTemplate.txt.meta rename to Packages/io.chainsafe.web3-unity/Editor/Resources/FunctionTemplate.txt.meta diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/ParamTemplate.txt b/Packages/io.chainsafe.web3-unity/Editor/Resources/ParamTemplate.txt similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/ParamTemplate.txt rename to Packages/io.chainsafe.web3-unity/Editor/Resources/ParamTemplate.txt diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/ParamTemplate.txt.meta b/Packages/io.chainsafe.web3-unity/Editor/Resources/ParamTemplate.txt.meta similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/ParamTemplate.txt.meta rename to Packages/io.chainsafe.web3-unity/Editor/Resources/ParamTemplate.txt.meta diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/SubscriptionTemplate.txt b/Packages/io.chainsafe.web3-unity/Editor/Resources/SubscriptionTemplate.txt similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/SubscriptionTemplate.txt rename to Packages/io.chainsafe.web3-unity/Editor/Resources/SubscriptionTemplate.txt diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/SubscriptionTemplate.txt.meta b/Packages/io.chainsafe.web3-unity/Editor/Resources/SubscriptionTemplate.txt.meta similarity index 100% rename from Packages/io.chainsafe.web3-unity/Runtime/Resources/SubscriptionTemplate.txt.meta rename to Packages/io.chainsafe.web3-unity/Editor/Resources/SubscriptionTemplate.txt.meta diff --git a/Packages/io.chainsafe.web3-unity/Editor/Resources/ViemChain.txt b/Packages/io.chainsafe.web3-unity/Editor/Resources/ViemChain.txt new file mode 100644 index 000000000..bdb41a805 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Editor/Resources/ViemChain.txt @@ -0,0 +1,1886 @@ +[ + { + "name": "abey", + "id": "179" + }, + { + "name": "abstractTestnet", + "id": "11124" + }, + { + "name": "acala", + "id": "787" + }, + { + "name": "acria", + "id": "47" + }, + { + "name": "adf", + "id": "1215" + }, + { + "name": "aioz", + "id": "168" + }, + { + "name": "alienx", + "id": "10241024" + }, + { + "name": "alienxHalTestnet", + "id": "10241025" + }, + { + "name": "ancient8", + "id": "888888888" + }, + { + "name": "ancient8Sepolia", + "id": "28122024" + }, + { + "name": "anvil", + "id": "31337" + }, + { + "name": "apeChain", + "id": "33139" + }, + { + "name": "apexTestnet", + "id": "3993" + }, + { + "name": "arbitrum", + "id": "42161" + }, + { + "name": "arbitrumGoerli", + "id": "421613" + }, + { + "name": "arbitrumNova", + "id": "42170" + }, + { + "name": "arbitrumSepolia", + "id": "421614" + }, + { + "name": "areonNetwork", + "id": "463" + }, + { + "name": "areonNetworkTestnet", + "id": "462" + }, + { + "name": "artelaTestnet", + "id": "11822" + }, + { + "name": "assetChain", + "id": "42420" + }, + { + "name": "assetChainTestnet", + "id": "42421" + }, + { + "name": "astar", + "id": "592" + }, + { + "name": "astarZkEVM", + "id": "3776" + }, + { + "name": "astarZkyoto", + "id": "6038361" + }, + { + "name": "atletaOlympia", + "id": "2340" + }, + { + "name": "aurora", + "id": "1313161554" + }, + { + "name": "auroraTestnet", + "id": "1313161555" + }, + { + "name": "auroria", + "id": "205205" + }, + { + "name": "avalanche", + "id": "43114" + }, + { + "name": "avalancheFuji", + "id": "43113" + }, + { + "name": "b3", + "id": "8333" + }, + { + "name": "b3Sepolia", + "id": "1993" + }, + { + "name": "bahamut", + "id": "5165" + }, + { + "name": "base", + "id": "8453" + }, + { + "name": "baseGoerli", + "id": "84531" + }, + { + "name": "baseSepolia", + "id": "84532" + }, + { + "name": "beam", + "id": "4337" + }, + { + "name": "beamTestnet", + "id": "13337" + }, + { + "name": "bearNetworkChainMainnet", + "id": "641230" + }, + { + "name": "bearNetworkChainTestnet", + "id": "751230" + }, + { + "name": "berachainTestnet", + "id": "80085" + }, + { + "name": "berachainTestnetbArtio", + "id": "80084" + }, + { + "name": "bevmMainnet", + "id": "11501" + }, + { + "name": "bifrost", + "id": "3068" + }, + { + "name": "bitTorrent", + "id": "199" + }, + { + "name": "bitTorrentTestnet", + "id": "1028" + }, + { + "name": "bitgert", + "id": "32520" + }, + { + "name": "bitkub", + "id": "96" + }, + { + "name": "bitkubTestnet", + "id": "25925" + }, + { + "name": "bitlayer", + "id": "200901" + }, + { + "name": "bitlayerTestnet", + "id": "200810" + }, + { + "name": "bitrock", + "id": "7171" + }, + { + "name": "blast", + "id": "81457" + }, + { + "name": "blastSepolia", + "id": "168587773" + }, + { + "name": "bob", + "id": "60808" + }, + { + "name": "bobSepolia", + "id": "808813" + }, + { + "name": "boba", + "id": "288" + }, + { + "name": "bobaSepolia", + "id": "28882" + }, + { + "name": "boolBetaMainnet", + "id": "11100" + }, + { + "name": "botanixTestnet", + "id": "3636" + }, + { + "name": "bounceBit", + "id": "6001" + }, + { + "name": "bounceBitTestnet", + "id": "6000" + }, + { + "name": "bronos", + "id": "1039" + }, + { + "name": "bronosTestnet", + "id": "1038" + }, + { + "name": "bsc", + "id": "56" + }, + { + "name": "bscGreenfield", + "id": "1017" + }, + { + "name": "bscTestnet", + "id": "97" + }, + { + "name": "bsquared", + "id": "223" + }, + { + "name": "bsquaredTestnet", + "id": "1123" + }, + { + "name": "btr", + "id": "200901" + }, + { + "name": "btrTestnet", + "id": "200810" + }, + { + "name": "bxn", + "id": "4999" + }, + { + "name": "bxnTestnet", + "id": "4777" + }, + { + "name": "cannon", + "id": "13370" + }, + { + "name": "canto", + "id": "7700" + }, + { + "name": "celo", + "id": "42220" + }, + { + "name": "celoAlfajores", + "id": "44787" + }, + { + "name": "chang", + "id": "5858" + }, + { + "name": "chiliz", + "id": "88888" + }, + { + "name": "chips", + "id": "2882" + }, + { + "name": "classic", + "id": "61" + }, + { + "name": "coinbit", + "id": "112" + }, + { + "name": "coinex", + "id": "52" + }, + { + "name": "confluxESpace", + "id": "1030" + }, + { + "name": "confluxESpaceTestnet", + "id": "71" + }, + { + "name": "coreDao", + "id": "1116" + }, + { + "name": "corn", + "id": "21000000" + }, + { + "name": "cornTestnet", + "id": "21000001" + }, + { + "name": "crab", + "id": "44" + }, + { + "name": "cronos", + "id": "25" + }, + { + "name": "cronosTestnet", + "id": "338" + }, + { + "name": "cronoszkEVM", + "id": "388" + }, + { + "name": "cronoszkEVMTestnet", + "id": "282" + }, + { + "name": "crossbell", + "id": "3737" + }, + { + "name": "curtis", + "id": "33111" + }, + { + "name": "cyber", + "id": "7560" + }, + { + "name": "cyberTestnet", + "id": "111557560" + }, + { + "name": "darwinia", + "id": "46" + }, + { + "name": "dchain", + "id": "2716446429837000" + }, + { + "name": "dchainTestnet", + "id": "2713017997578000" + }, + { + "name": "defichainEvm", + "id": "1130" + }, + { + "name": "defichainEvmTestnet", + "id": "1131" + }, + { + "name": "degen", + "id": "666666666" + }, + { + "name": "dfk", + "id": "53935" + }, + { + "name": "diode", + "id": "15" + }, + { + "name": "disChain", + "id": "513100" + }, + { + "name": "dodochainTestnet", + "id": "53457" + }, + { + "name": "dogechain", + "id": "2000" + }, + { + "name": "dosChain", + "id": "7979" + }, + { + "name": "dosChainTestnet", + "id": "3939" + }, + { + "name": "dreyerxMainnet", + "id": "23451" + }, + { + "name": "dreyerxTestnet", + "id": "23452" + }, + { + "name": "dustboyIoT", + "id": "555888" + }, + { + "name": "dymension", + "id": "1100" + }, + { + "name": "edgeless", + "id": "2026" + }, + { + "name": "edgelessTestnet", + "id": "202" + }, + { + "name": "edgeware", + "id": "2021" + }, + { + "name": "edgewareTestnet", + "id": "2022" + }, + { + "name": "ekta", + "id": "1994" + }, + { + "name": "ektaTestnet", + "id": "1004" + }, + { + "name": "elastos", + "id": "20" + }, + { + "name": "elastosTestnet", + "id": "21" + }, + { + "name": "electroneum", + "id": "52014" + }, + { + "name": "electroneumTestnet", + "id": "5201420" + }, + { + "name": "elysiumTestnet", + "id": "1338" + }, + { + "name": "energy", + "id": "246" + }, + { + "name": "enuls", + "id": "119" + }, + { + "name": "eon", + "id": "7332" + }, + { + "name": "eos", + "id": "17777" + }, + { + "name": "eosTestnet", + "id": "15557" + }, + { + "name": "etherlink", + "id": "42793" + }, + { + "name": "etherlinkTestnet", + "id": "128123" + }, + { + "name": "evmos", + "id": "9001" + }, + { + "name": "evmosTestnet", + "id": "9000" + }, + { + "name": "excelonMainnet", + "id": "22052002" + }, + { + "name": "expanse", + "id": "2" + }, + { + "name": "fantom", + "id": "250" + }, + { + "name": "fantomSonicTestnet", + "id": "64240" + }, + { + "name": "fantomTestnet", + "id": "4002" + }, + { + "name": "fibo", + "id": "12306" + }, + { + "name": "filecoin", + "id": "314" + }, + { + "name": "filecoinCalibration", + "id": "314159" + }, + { + "name": "filecoinHyperspace", + "id": "3141" + }, + { + "name": "fireChain", + "id": "995" + }, + { + "name": "flare", + "id": "14" + }, + { + "name": "flareTestnet", + "id": "114" + }, + { + "name": "flowMainnet", + "id": "747" + }, + { + "name": "flowPreviewnet", + "id": "646" + }, + { + "name": "flowTestnet", + "id": "545" + }, + { + "name": "fluence", + "id": "9999999" + }, + { + "name": "fluenceStage", + "id": "123420000220" + }, + { + "name": "fluenceTestnet", + "id": "52164803" + }, + { + "name": "forma", + "id": "984122" + }, + { + "name": "foundry", + "id": "31337" + }, + { + "name": "fraxtal", + "id": "252" + }, + { + "name": "fraxtalTestnet", + "id": "2522" + }, + { + "name": "funkiMainnet", + "id": "33979" + }, + { + "name": "funkiSepolia", + "id": "3397901" + }, + { + "name": "fuse", + "id": "122" + }, + { + "name": "fuseSparknet", + "id": "123" + }, + { + "name": "fusion", + "id": "32659" + }, + { + "name": "fusionTestnet", + "id": "46688" + }, + { + "name": "garnet", + "id": "17069" + }, + { + "name": "geist", + "id": "63157" + }, + { + "name": "genesys", + "id": "16507" + }, + { + "name": "glideL1Protocol", + "id": "251" + }, + { + "name": "glideL2Protocol", + "id": "253" + }, + { + "name": "gnosis", + "id": "100" + }, + { + "name": "gnosisChiado", + "id": "10200" + }, + { + "name": "goChain", + "id": "60" + }, + { + "name": "gobi", + "id": "1663" + }, + { + "name": "godwoken", + "id": "71402" + }, + { + "name": "goerli", + "id": "5" + }, + { + "name": "gravity", + "id": "1625" + }, + { + "name": "guruNetwork", + "id": "260" + }, + { + "name": "guruTestnet", + "id": "261" + }, + { + "name": "ham", + "id": "5112" + }, + { + "name": "haqqMainnet", + "id": "11235" + }, + { + "name": "haqqTestedge2", + "id": "54211" + }, + { + "name": "hardhat", + "id": "31337" + }, + { + "name": "harmonyOne", + "id": "1666600000" + }, + { + "name": "hashkeyTestnet", + "id": "133" + }, + { + "name": "hedera", + "id": "295" + }, + { + "name": "hederaPreviewnet", + "id": "297" + }, + { + "name": "hederaTestnet", + "id": "296" + }, + { + "name": "hela", + "id": "8668" + }, + { + "name": "hemiSepolia", + "id": "743111" + }, + { + "name": "holesky", + "id": "17000" + }, + { + "name": "hpb", + "id": "269" + }, + { + "name": "hychain", + "id": "2911" + }, + { + "name": "hychainTestnet", + "id": "29112" + }, + { + "name": "iSunCoin", + "id": "8017" + }, + { + "name": "idchain", + "id": "74" + }, + { + "name": "immutableZkEvm", + "id": "13371" + }, + { + "name": "immutableZkEvmTestnet", + "id": "13473" + }, + { + "name": "inEVM", + "id": "2525" + }, + { + "name": "inkSepolia", + "id": "763373" + }, + { + "name": "iota", + "id": "8822" + }, + { + "name": "iotaTestnet", + "id": "1075" + }, + { + "name": "iotex", + "id": "4689" + }, + { + "name": "iotexTestnet", + "id": "4690" + }, + { + "name": "jbc", + "id": "8899" + }, + { + "name": "jbcTestnet", + "id": "88991" + }, + { + "name": "kaia", + "id": "8217" + }, + { + "name": "kairos", + "id": "1001" + }, + { + "name": "kakarotSepolia", + "id": "1802203764" + }, + { + "name": "kakarotStarknetSepolia", + "id": "920637907288165" + }, + { + "name": "kardiaChain", + "id": "24" + }, + { + "name": "karura", + "id": "686" + }, + { + "name": "kava", + "id": "2222" + }, + { + "name": "kavaTestnet", + "id": "2221" + }, + { + "name": "kcc", + "id": "321" + }, + { + "name": "kinto", + "id": "7887" + }, + { + "name": "klaytn", + "id": "8217" + }, + { + "name": "klaytnBaobab", + "id": "1001" + }, + { + "name": "koi", + "id": "701" + }, + { + "name": "kroma", + "id": "255" + }, + { + "name": "kromaSepolia", + "id": "2358" + }, + { + "name": "l3x", + "id": "12324" + }, + { + "name": "l3xTestnet", + "id": "12325" + }, + { + "name": "lavita", + "id": "360890" + }, + { + "name": "lightlinkPegasus", + "id": "1891" + }, + { + "name": "lightlinkPhoenix", + "id": "1890" + }, + { + "name": "linea", + "id": "59144" + }, + { + "name": "lineaGoerli", + "id": "59140" + }, + { + "name": "lineaSepolia", + "id": "59141" + }, + { + "name": "lineaTestnet", + "id": "59140" + }, + { + "name": "lisk", + "id": "1135" + }, + { + "name": "liskSepolia", + "id": "4202" + }, + { + "name": "localhost", + "id": "1337" + }, + { + "name": "loop", + "id": "15551" + }, + { + "name": "lukso", + "id": "42" + }, + { + "name": "luksoTestnet", + "id": "4201" + }, + { + "name": "lycan", + "id": "721" + }, + { + "name": "lyra", + "id": "957" + }, + { + "name": "mainnet", + "id": "1" + }, + { + "name": "mandala", + "id": "595" + }, + { + "name": "manta", + "id": "169" + }, + { + "name": "mantaSepoliaTestnet", + "id": "3441006" + }, + { + "name": "mantaTestnet", + "id": "3441005" + }, + { + "name": "mantle", + "id": "5000" + }, + { + "name": "mantleSepoliaTestnet", + "id": "5003" + }, + { + "name": "mantleTestnet", + "id": "5001" + }, + { + "name": "mapProtocol", + "id": "22776" + }, + { + "name": "matchain", + "id": "698" + }, + { + "name": "matchainTestnet", + "id": "699" + }, + { + "name": "mchVerse", + "id": "29548" + }, + { + "name": "mekong", + "id": "7078815900" + }, + { + "name": "meld", + "id": "333000333" + }, + { + "name": "merlin", + "id": "4200" + }, + { + "name": "metachain", + "id": "571" + }, + { + "name": "metachainIstanbul", + "id": "1453" + }, + { + "name": "metadium", + "id": "11" + }, + { + "name": "metalL2", + "id": "1750" + }, + { + "name": "meter", + "id": "82" + }, + { + "name": "meterTestnet", + "id": "83" + }, + { + "name": "metis", + "id": "1088" + }, + { + "name": "metisGoerli", + "id": "599" + }, + { + "name": "mev", + "id": "7518" + }, + { + "name": "mevTestnet", + "id": "4759" + }, + { + "name": "mint", + "id": "185" + }, + { + "name": "mintSepoliaTestnet", + "id": "1686" + }, + { + "name": "mode", + "id": "34443" + }, + { + "name": "modeTestnet", + "id": "919" + }, + { + "name": "moonbaseAlpha", + "id": "1287" + }, + { + "name": "moonbeam", + "id": "1284" + }, + { + "name": "moonbeamDev", + "id": "1281" + }, + { + "name": "moonriver", + "id": "1285" + }, + { + "name": "morph", + "id": "2818" + }, + { + "name": "morphHolesky", + "id": "2810" + }, + { + "name": "morphSepolia", + "id": "2710" + }, + { + "name": "nahmii", + "id": "5551" + }, + { + "name": "nautilus", + "id": "22222" + }, + { + "name": "neonDevnet", + "id": "245022926" + }, + { + "name": "neonMainnet", + "id": "245022934" + }, + { + "name": "nexi", + "id": "4242" + }, + { + "name": "nexilix", + "id": "240" + }, + { + "name": "oasisTestnet", + "id": "4090" + }, + { + "name": "oasys", + "id": "248" + }, + { + "name": "odysseyTestnet", + "id": "911867" + }, + { + "name": "okc", + "id": "66" + }, + { + "name": "omax", + "id": "311" + }, + { + "name": "oneWorld", + "id": "309075" + }, + { + "name": "oortMainnetDev", + "id": "9700" + }, + { + "name": "opBNB", + "id": "204" + }, + { + "name": "opBNBTestnet", + "id": "5611" + }, + { + "name": "optimism", + "id": "10" + }, + { + "name": "optimismGoerli", + "id": "420" + }, + { + "name": "optimismSepolia", + "id": "11155420" + }, + { + "name": "optopia", + "id": "62050" + }, + { + "name": "optopiaTestnet", + "id": "62049" + }, + { + "name": "orderly", + "id": "291" + }, + { + "name": "orderlySepolia", + "id": "4460" + }, + { + "name": "otimDevnet", + "id": "41144114" + }, + { + "name": "palm", + "id": "11297108109" + }, + { + "name": "palmTestnet", + "id": "11297108099" + }, + { + "name": "pgn", + "id": "424" + }, + { + "name": "pgnTestnet", + "id": "58008" + }, + { + "name": "phoenix", + "id": "13381" + }, + { + "name": "planq", + "id": "7070" + }, + { + "name": "playfiAlbireo", + "id": "1612127" + }, + { + "name": "plinga", + "id": "242" + }, + { + "name": "plumeTestnet", + "id": "161221135" + }, + { + "name": "polterTestnet", + "id": "631571" + }, + { + "name": "polygon", + "id": "137" + }, + { + "name": "polygonAmoy", + "id": "80002" + }, + { + "name": "polygonMumbai", + "id": "80001" + }, + { + "name": "polygonZkEvm", + "id": "1101" + }, + { + "name": "polygonZkEvmCardona", + "id": "2442" + }, + { + "name": "polygonZkEvmTestnet", + "id": "1442" + }, + { + "name": "pulsechain", + "id": "369" + }, + { + "name": "pulsechainV4", + "id": "943" + }, + { + "name": "qMainnet", + "id": "35441" + }, + { + "name": "qTestnet", + "id": "35443" + }, + { + "name": "ql1", + "id": "766" + }, + { + "name": "real", + "id": "111188" + }, + { + "name": "redbellyMainnet", + "id": "151" + }, + { + "name": "redbellyTestnet", + "id": "153" + }, + { + "name": "redstone", + "id": "690" + }, + { + "name": "rei", + "id": "47805" + }, + { + "name": "reyaNetwork", + "id": "1729" + }, + { + "name": "rollux", + "id": "570" + }, + { + "name": "rolluxTestnet", + "id": "57000" + }, + { + "name": "ronin", + "id": "2020" + }, + { + "name": "root", + "id": "7668" + }, + { + "name": "rootPorcini", + "id": "7672" + }, + { + "name": "rootstock", + "id": "30" + }, + { + "name": "rootstockTestnet", + "id": "31" + }, + { + "name": "rss3", + "id": "12553" + }, + { + "name": "rss3Sepolia", + "id": "2331" + }, + { + "name": "saakuru", + "id": "7225878" + }, + { + "name": "saigon", + "id": "2021" + }, + { + "name": "sanko", + "id": "1996" + }, + { + "name": "sapphire", + "id": "23294" + }, + { + "name": "sapphireTestnet", + "id": "23295" + }, + { + "name": "satoshiVM", + "id": "3109" + }, + { + "name": "satoshiVMTestnet", + "id": "3110" + }, + { + "name": "scroll", + "id": "534352" + }, + { + "name": "scrollSepolia", + "id": "534351" + }, + { + "name": "sei", + "id": "1329" + }, + { + "name": "seiDevnet", + "id": "713715" + }, + { + "name": "seiTestnet", + "id": "1328" + }, + { + "name": "sepolia", + "id": "11155111" + }, + { + "name": "shape", + "id": "360" + }, + { + "name": "shapeSepolia", + "id": "11011" + }, + { + "name": "shardeumSphinx", + "id": "8082" + }, + { + "name": "shibarium", + "id": "109" + }, + { + "name": "shibariumTestnet", + "id": "157" + }, + { + "name": "shiden", + "id": "336" + }, + { + "name": "shimmer", + "id": "148" + }, + { + "name": "shimmerTestnet", + "id": "1073" + }, + { + "name": "silicon", + "id": "2355" + }, + { + "name": "siliconSepolia", + "id": "1722641160" + }, + { + "name": "sixProtocol", + "id": "98" + }, + { + "name": "skaleBlockBrawlers", + "id": "391845894" + }, + { + "name": "skaleCalypso", + "id": "1564830818" + }, + { + "name": "skaleCalypsoTestnet", + "id": "974399131" + }, + { + "name": "skaleCryptoBlades", + "id": "1026062157" + }, + { + "name": "skaleCryptoColosseum", + "id": "1032942172" + }, + { + "name": "skaleEuropa", + "id": "2046399126" + }, + { + "name": "skaleEuropaTestnet", + "id": "1444673419" + }, + { + "name": "skaleExorde", + "id": "2139927552" + }, + { + "name": "skaleHumanProtocol", + "id": "1273227453" + }, + { + "name": "skaleNebula", + "id": "1482601649" + }, + { + "name": "skaleNebulaTestnet", + "id": "37084624" + }, + { + "name": "skaleRazor", + "id": "278611351" + }, + { + "name": "skaleTitan", + "id": "1350216234" + }, + { + "name": "skaleTitanTestnet", + "id": "1020352220" + }, + { + "name": "sketchpad", + "id": "984123" + }, + { + "name": "snax", + "id": "2192" + }, + { + "name": "snaxTestnet", + "id": "13001" + }, + { + "name": "soneiumMinato", + "id": "1946" + }, + { + "name": "songbird", + "id": "19" + }, + { + "name": "songbirdTestnet", + "id": "16" + }, + { + "name": "sonicTestnet", + "id": "64165" + }, + { + "name": "sophon", + "id": "50104" + }, + { + "name": "sophonTestnet", + "id": "531050104" + }, + { + "name": "spicy", + "id": "88882" + }, + { + "name": "step", + "id": "1234" + }, + { + "name": "storyOdyssey", + "id": "1516" + }, + { + "name": "storyTestnet", + "id": "1513" + }, + { + "name": "stratis", + "id": "105105" + }, + { + "name": "superlumio", + "id": "8866" + }, + { + "name": "superposition", + "id": "55244" + }, + { + "name": "swan", + "id": "254" + }, + { + "name": "swanProximaTestnet", + "id": "20241133" + }, + { + "name": "swanSaturnTestnet", + "id": "2024" + }, + { + "name": "swissdlt", + "id": "94" + }, + { + "name": "syscoin", + "id": "57" + }, + { + "name": "syscoinTestnet", + "id": "5700" + }, + { + "name": "taiko", + "id": "167000" + }, + { + "name": "taikoHekla", + "id": "167009" + }, + { + "name": "taikoJolnir", + "id": "167007" + }, + { + "name": "taikoKatla", + "id": "167008" + }, + { + "name": "taikoTestnetSepolia", + "id": "167005" + }, + { + "name": "taraxa", + "id": "841" + }, + { + "name": "taraxaTestnet", + "id": "842" + }, + { + "name": "telcoinTestnet", + "id": "2017" + }, + { + "name": "telos", + "id": "40" + }, + { + "name": "telosTestnet", + "id": "41" + }, + { + "name": "tenet", + "id": "1559" + }, + { + "name": "thaiChain", + "id": "7" + }, + { + "name": "that", + "id": "8428" + }, + { + "name": "theta", + "id": "361" + }, + { + "name": "thetaTestnet", + "id": "365" + }, + { + "name": "thunderCore", + "id": "108" + }, + { + "name": "thunderTestnet", + "id": "997" + }, + { + "name": "tiktrixTestnet", + "id": "62092" + }, + { + "name": "tomb", + "id": "6969" + }, + { + "name": "tron", + "id": "728126428" + }, + { + "name": "ubiq", + "id": "8" + }, + { + "name": "ultron", + "id": "1231" + }, + { + "name": "ultronTestnet", + "id": "1230" + }, + { + "name": "unichainSepolia", + "id": "1301" + }, + { + "name": "unique", + "id": "8880" + }, + { + "name": "uniqueOpal", + "id": "8882" + }, + { + "name": "uniqueQuartz", + "id": "8881" + }, + { + "name": "unreal", + "id": "18233" + }, + { + "name": "vanar", + "id": "2040" + }, + { + "name": "vechain", + "id": "100009" + }, + { + "name": "velas", + "id": "106" + }, + { + "name": "viction", + "id": "88" + }, + { + "name": "victionTestnet", + "id": "89" + }, + { + "name": "vision", + "id": "888888" + }, + { + "name": "visionTestnet", + "id": "666666" + }, + { + "name": "wanchain", + "id": "888" + }, + { + "name": "wanchainTestnet", + "id": "999" + }, + { + "name": "weaveVMAlphanet", + "id": "9496" + }, + { + "name": "wemix", + "id": "1111" + }, + { + "name": "wemixTestnet", + "id": "1112" + }, + { + "name": "worldLand", + "id": "103" + }, + { + "name": "worldchain", + "id": "480" + }, + { + "name": "worldchainSepolia", + "id": "4801" + }, + { + "name": "x1Testnet", + "id": "195" + }, + { + "name": "xLayer", + "id": "196" + }, + { + "name": "xLayerTestnet", + "id": "195" + }, + { + "name": "xai", + "id": "660279" + }, + { + "name": "xaiTestnet", + "id": "37714555429" + }, + { + "name": "xdc", + "id": "50" + }, + { + "name": "xdcTestnet", + "id": "51" + }, + { + "name": "xrSepolia", + "id": "2730" + }, + { + "name": "yooldoVerse", + "id": "50005" + }, + { + "name": "yooldoVerseTestnet", + "id": "50006" + }, + { + "name": "zenchainTestnet", + "id": "8408" + }, + { + "name": "zeniq", + "id": "383414847825" + }, + { + "name": "zetachain", + "id": "7000" + }, + { + "name": "zetachainAthensTestnet", + "id": "7001" + }, + { + "name": "zhejiang", + "id": "1337803" + }, + { + "name": "zilliqa", + "id": "32769" + }, + { + "name": "zilliqaTestnet", + "id": "33101" + }, + { + "name": "zircuit", + "id": "48900" + }, + { + "name": "zircuitTestnet", + "id": "48899" + }, + { + "name": "zkFair", + "id": "42766" + }, + { + "name": "zkFairTestnet", + "id": "43851" + }, + { + "name": "zkLinkNova", + "id": "810180" + }, + { + "name": "zkLinkNovaSepoliaTestnet", + "id": "810181" + }, + { + "name": "zkSync", + "id": "324" + }, + { + "name": "zkSyncInMemoryNode", + "id": "260" + }, + { + "name": "zkSyncLocalNode", + "id": "270" + }, + { + "name": "zkSyncSepoliaTestnet", + "id": "300" + }, + { + "name": "zksync", + "id": "324" + }, + { + "name": "zksyncInMemoryNode", + "id": "260" + }, + { + "name": "zksyncLocalCustomHyperchain", + "id": "272" + }, + { + "name": "zksyncLocalHyperchain", + "id": "270" + }, + { + "name": "zksyncLocalHyperchainL1", + "id": "9" + }, + { + "name": "zksyncLocalNode", + "id": "270" + }, + { + "name": "zksyncSepoliaTestnet", + "id": "300" + }, + { + "name": "zora", + "id": "7777777" + }, + { + "name": "zoraSepolia", + "id": "999999999" + }, + { + "name": "zoraTestnet", + "id": "999" + } +] \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Editor/Resources/ViemChain.txt.meta b/Packages/io.chainsafe.web3-unity/Editor/Resources/ViemChain.txt.meta new file mode 100644 index 000000000..044b7616a --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Editor/Resources/ViemChain.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ae48e522378712a4cac49b0d1b3863b4 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Editor/Web3SettingsEditor.ChainSettings.cs b/Packages/io.chainsafe.web3-unity/Editor/Web3SettingsEditor.ChainSettings.cs index 253b73668..87a0d9b88 100644 --- a/Packages/io.chainsafe.web3-unity/Editor/Web3SettingsEditor.ChainSettings.cs +++ b/Packages/io.chainsafe.web3-unity/Editor/Web3SettingsEditor.ChainSettings.cs @@ -1,7 +1,9 @@ using System; +using System.Collections.Generic; using System.Linq; using ChainSafe.Gaming; using ChainSafe.Gaming.Web3; +using Newtonsoft.Json; using UnityEditor; using UnityEditor.Experimental.GraphView; using UnityEngine; @@ -24,6 +26,7 @@ private class ChainSettingsPanel private bool changedRpcOrWs; private int selectedWebHookIndex; + public ChainSettingsPanel(Web3SettingsEditor window, ChainConfigEntry chainConfigEntry) { this.window = window; @@ -167,7 +170,7 @@ public void OnGUI() } chainConfig.Ws = EditorGUILayout.TextField("Custom WebHook", chainConfig.Ws); - + EditorGUI.indentLevel--; if (EditorGUI.EndChangeCheck() || changedRpcOrWs) { diff --git a/Packages/io.chainsafe.web3-unity/Editor/Web3SettingsEditor.cs b/Packages/io.chainsafe.web3-unity/Editor/Web3SettingsEditor.cs index be391366d..3dd266f70 100644 --- a/Packages/io.chainsafe.web3-unity/Editor/Web3SettingsEditor.cs +++ b/Packages/io.chainsafe.web3-unity/Editor/Web3SettingsEditor.cs @@ -60,14 +60,15 @@ private void Awake() { web3Config = ProjectConfigUtilities.CreateOrLoad(); previousProjectId = web3Config.ProjectId; - } + } private void OnEnable() { if (!logo) logo = AssetDatabase.LoadAssetAtPath( "Packages/io.chainsafe.web3-unity/Editor/Textures/ChainSafeLogo2.png"); - + + TryFetchSupportedChains(); } diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Debugging.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Debugging.dll index b46c0747d..8a3a68691 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Debugging.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Debugging.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Gelato.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Gelato.dll index d65471ef5..1468743d1 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Gelato.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Gelato.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessSigner.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessSigner.dll index 3724cc940..795e94756 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessSigner.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessSigner.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessTransactionExecutor.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessTransactionExecutor.dll index f5a40fbf2..46ffdde8b 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessTransactionExecutor.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.InProcessTransactionExecutor.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Marketplace.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Marketplace.dll index 388d13d9e..8db966fdb 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Marketplace.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Marketplace.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Reown.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Reown.dll index 1fa4582b0..f2ab6d4db 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Reown.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Reown.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.SygmaClient.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.SygmaClient.dll index 64c3ea8c6..d694a5a7a 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.SygmaClient.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.SygmaClient.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.EthereumWindow.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.EthereumWindow.dll index 0d6671ac4..da3d068ea 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.EthereumWindow.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.EthereumWindow.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.MetaMask.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.MetaMask.dll index 6f0787bbc..1fac0d4f9 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.MetaMask.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.MetaMask.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.ThirdParty.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.ThirdParty.dll index bcab86e96..1fdb5d3c4 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.ThirdParty.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.ThirdParty.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.dll index bffa2a671..522a10d85 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.Unity.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.dll index 01c590ac9..7badcbecc 100644 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/ChainSafe.Gaming.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Microsoft.Extensions.Logging.Abstractions.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Microsoft.Extensions.Logging.Abstractions.dll index 1c02fc26a..79bb804fb 100755 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Microsoft.Extensions.Logging.Abstractions.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Microsoft.Extensions.Logging.Abstractions.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Hex.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Hex.dll index c5ff2a96b..f425845fd 100755 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Hex.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Hex.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Model.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Model.dll index dd0995b69..b0119d673 100755 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Model.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Model.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.RLP.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.RLP.dll index d4ee75982..48e9247ed 100755 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.RLP.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.RLP.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Signer.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Signer.dll index 4fdb46c6f..6e3b9b59d 100755 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Signer.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Signer.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Util.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Util.dll index 09c5d1b81..be8bb3584 100755 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Util.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Nethereum.Util.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Common.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Common.dll deleted file mode 100755 index 1f19a5d1a..000000000 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Common.dll and /dev/null differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Common.dll.meta b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Common.dll.meta deleted file mode 100644 index eb6d3a865..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Common.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: e04b43f2f20d4a439656b9fe1af00275 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Crypto.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Crypto.dll deleted file mode 100755 index 535522a66..000000000 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Crypto.dll and /dev/null differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Crypto.dll.meta b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Crypto.dll.meta deleted file mode 100644 index fadbb9277..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Crypto.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: caa2d002e3624f9a9a22192287ba1dc4 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.WebSocket.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.WebSocket.dll deleted file mode 100755 index 740d30b6c..000000000 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.WebSocket.dll and /dev/null differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.WebSocket.dll.meta b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.WebSocket.dll.meta deleted file mode 100644 index 5fba38dba..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.WebSocket.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 989d09a2daad49f4a03ce35676f8a73b -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.dll deleted file mode 100755 index 765837f7f..000000000 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.dll and /dev/null differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.dll.meta b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.dll.meta deleted file mode 100644 index 51502c718..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Network.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 46d79c074bd0404f8ae8308c7bf068ed -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Storage.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Storage.dll deleted file mode 100755 index 4b3de11bb..000000000 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Storage.dll and /dev/null differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Storage.dll.meta b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Storage.dll.meta deleted file mode 100644 index 407008c2e..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.Storage.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 420e5ffe9c05462b811cf6e99f354475 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.dll deleted file mode 100755 index 302acb026..000000000 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.dll and /dev/null differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.dll.meta b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.dll.meta deleted file mode 100644 index 23731befc..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Core.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: c5cc3b37059047a0a4f50868cf44f7e5 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Sign.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Sign.dll deleted file mode 100755 index 2864c2531..000000000 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Sign.dll and /dev/null differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Sign.dll.meta b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Sign.dll.meta deleted file mode 100644 index 1b2e1b27a..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.Sign.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 87e9efdf23054d55a6ba6ac9e3bba701 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.WalletKit.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.WalletKit.dll deleted file mode 100755 index 2fbba0c90..000000000 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.WalletKit.dll and /dev/null differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.WalletKit.dll.meta b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.WalletKit.dll.meta deleted file mode 100644 index 4b0ee4fd4..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/Reown.WalletKit.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: b3eaaa40ec724c62bb0d374b9eba2377 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/System.Numerics.Vectors.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/System.Numerics.Vectors.dll index a808165ac..10205772c 100755 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/System.Numerics.Vectors.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/System.Numerics.Vectors.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/System.Runtime.CompilerServices.Unsafe.dll b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/System.Runtime.CompilerServices.Unsafe.dll index b17135bc9..491a80a97 100755 Binary files a/Packages/io.chainsafe.web3-unity/Runtime/Libraries/System.Runtime.CompilerServices.Unsafe.dll and b/Packages/io.chainsafe.web3-unity/Runtime/Libraries/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Plugins/Countly/csc.rsp.meta b/Packages/io.chainsafe.web3-unity/Runtime/Plugins/Countly/csc.rsp.meta new file mode 100644 index 000000000..b29495dcd --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Plugins/Countly/csc.rsp.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a24005f16a377574c88b9a818a391065 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Prefabs/Web3Unity.prefab b/Packages/io.chainsafe.web3-unity/Runtime/Prefabs/Web3Unity.prefab index e2f0d3282..5912cb104 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Prefabs/Web3Unity.prefab +++ b/Packages/io.chainsafe.web3-unity/Runtime/Prefabs/Web3Unity.prefab @@ -11,7 +11,7 @@ GameObject: - component: {fileID: 8519303782652390544} - component: {fileID: 5008553068369276269} - component: {fileID: 29625373239180716} - - component: {fileID: 153625530502621119} + - component: {fileID: 1849669373672644507} m_Layer: 0 m_Name: Web3Unity m_TagString: Untagged @@ -63,10 +63,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 96ece91a37dec784f8c42b19da0bbaae, type: 3} m_Name: m_EditorClassIdentifier: + initializeOnAwake: 1 + rememberConnection: 1 connectScreenFactory: LandscapePrefab: {fileID: 741700721959473792, guid: 920ab7036ad598d44aa2f8f24a488823, type: 3} PortraitPrefab: {fileID: 4806868497684407626, guid: fc961e494bc607444b66ddaf341ca50c, type: 3} ---- !u!114 &153625530502621119 +--- !u!114 &1849669373672644507 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/Reown AppKit.prefab b/Packages/io.chainsafe.web3-unity/Runtime/Resources/Reown AppKit.prefab new file mode 100644 index 000000000..cefc268db --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Resources/Reown AppKit.prefab @@ -0,0 +1,180 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &158044275252838131 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8114948220982685209} + - component: {fileID: 830808784489831061} + - component: {fileID: 857699176889885464} + m_Layer: 0 + m_Name: Utilities + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8114948220982685209 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 158044275252838131} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 710658489450244879} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &830808784489831061 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 158044275252838131} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f5c7b55377338463fa97de3b378488b7, type: 3} + m_Name: + m_EditorClassIdentifier: + _colorA: {r: 0.67058825, g: 0.67058825, b: 0.67058825, a: 1} + _colorB: {r: 0.29411766, g: 0.29411766, b: 0.29411766, a: 1} + _speed: 2 + _lerpCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 2 + outSlope: 2 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!114 &857699176889885464 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 158044275252838131} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0bb06120bbb66400c9730e044f00b518, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &5904779526130413779 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5548460347198765618} + - component: {fileID: 3737159026218804949} + m_Layer: 0 + m_Name: Modal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5548460347198765618 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5904779526130413779} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 710658489450244879} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3737159026218804949 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5904779526130413779} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_PanelSettings: {fileID: 11400000, guid: 2a7dd17f274bf43c8b576f2803168e84, type: 2} + m_ParentUI: {fileID: 0} + sourceAsset: {fileID: 9197481963319205126, guid: 320d7a8e8a0f4883b0cd6759a8328cd1, type: 3} + m_SortingOrder: 100 +--- !u!1 &6019781919744940759 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 710658489450244879} + - component: {fileID: 270032162678623120} + m_Layer: 0 + m_Name: Reown AppKit + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &710658489450244879 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6019781919744940759} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5548460347198765618} + - {fileID: 8114948220982685209} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &270032162678623120 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6019781919744940759} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f95d3e618c48b489c8a36470691405fa, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Resources/Reown AppKit.prefab.meta b/Packages/io.chainsafe.web3-unity/Runtime/Resources/Reown AppKit.prefab.meta new file mode 100644 index 000000000..4c9b1d7f3 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Resources/Reown AppKit.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e688fa665851dcc4bacf0c456c9e801b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ClipboardManager.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ClipboardManager.cs index bbffb48a0..96e1a7fae 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ClipboardManager.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ClipboardManager.cs @@ -37,7 +37,7 @@ private void InitializeClipboardHandler() _clipboardHandler = null; #endif } - + private void Update() { #if ENABLE_INPUT_SYSTEM @@ -53,6 +53,7 @@ private void Update() #endif } + [MonoPInvokeCallback(typeof(Action))] public static void OnPaste(string text) diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Connection/MetamaskConnectionProvider.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Connection/MetamaskConnectionProvider.cs deleted file mode 100644 index 21df4dcbb..000000000 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Connection/MetamaskConnectionProvider.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Threading.Tasks; -#if UNITY_WEBGL && !UNITY_EDITOR -using ChainSafe.Gaming.Unity.MetaMask; -using ChainSafe.Gaming.Web3.Evm.Wallet; -#endif -using ChainSafe.Gaming.Web3.Build; -using UnityEngine; - -namespace ChainSafe.Gaming.UnityPackage.Connection -{ - /// - /// Metamask's connection provider used for connecting to a Metamask wallet. - /// - [CreateAssetMenu(menuName = "ChainSafe/Connection Provider/Metamask", fileName = nameof(MetamaskConnectionProvider))] - public class MetamaskConnectionProvider : ConnectionProvider - { - [field: SerializeField, DefaultAssetValue("Packages/io.chainsafe.web3-unity/Runtime/Sprites/MetaMask_Icon.png")] - public override Sprite ButtonIcon { get; protected set; } - - [field: SerializeField] public override string ButtonText { get; protected set; } = "MetaMask"; - - public override bool IsAvailable => Application.platform == RuntimePlatform.WebGLPlayer && Application.isEditor == false; - - public override Task Initialize(bool rememberSession) - { - return Task.CompletedTask; - } - - protected override void ConfigureServices(IWeb3ServiceCollection services) - { -#if UNITY_WEBGL && !UNITY_EDITOR - services.UseMetaMask().UseWalletSigner().UseWalletTransactionExecutor(); -#endif - } - - public override Task SavedSessionAvailable() - { - return Task.FromResult(false); - } - } -} diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Connection/ReownConnectionProvider.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Connection/ReownConnectionProvider.cs index be4b34f96..db607d8f0 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Connection/ReownConnectionProvider.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Connection/ReownConnectionProvider.cs @@ -1,18 +1,20 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using ChainSafe.Gaming.GUI; using ChainSafe.Gaming.Reown; +using ChainSafe.Gaming.Reown.AppKit; using ChainSafe.Gaming.Reown.Connection; using ChainSafe.Gaming.Reown.Dialog; using ChainSafe.Gaming.Reown.Wallets; using ChainSafe.Gaming.Web3.Build; using ChainSafe.Gaming.Web3.Evm.Wallet; +using Newtonsoft.Json; using Reown.Core; using Reown.Core.Network; using Reown.Core.Network.Interfaces; using UnityEngine; -using UnityEngine.Serialization; using ReownConnectionHandler = ChainSafe.Gaming.Reown.Connection.IConnectionHandler; namespace ChainSafe.Gaming.UnityPackage.Connection @@ -43,6 +45,9 @@ public class ReownConnectionProvider : ConnectionProvider, IReownConfig, IConnec [field: SerializeField] public WalletLocationOption WalletLocationOption { get; private set; } = WalletLocationOption.LocalAndRemote; + + [field:SerializeField] + public ViemNameChainId[] ChainIdAndViemNameArray { get; private set; } [field: SerializeField] public override Sprite ButtonIcon { get; protected set; } @@ -56,6 +61,8 @@ public class ReownConnectionProvider : ConnectionProvider, IReownConfig, IConnec public bool ForceNewSession { get; set; } public EventHandler OnRelayErrored { get; set; } + public Dictionary ChainIdViemNameMap { get; private set; } = new(); + bool IReownConfig.RememberSession => RememberSession || _storedSessionAvailable; public IList IncludeWalletIds => includeWalletIds; public IList ExcludeWalletIds => excludeWalletIds; @@ -64,8 +71,8 @@ public class ReownConnectionProvider : ConnectionProvider, IReownConfig, IConnec public string SignMessageRpcMethodName => "personal_sign"; public string SignTypedMessageRpcMethodName => "eth_signTypedData"; public override bool IsAvailable => true; - - public IConnectionBuilder ConnectionBuilder + + public IConnectionBuilder ConnectionBuilder { get { @@ -97,7 +104,7 @@ public IConnectionBuilder ConnectionBuilder } #if UNITY_EDITOR - private void OnValidate() + public void OnValidate() { if (!connectionScreenPrefabs.LandscapePrefab && !connectionScreenPrefabs.PortraitPrefab) { @@ -105,14 +112,36 @@ private void OnValidate() connectionScreenPrefabs.PortraitPrefab = UnityEditor.AssetDatabase.LoadAssetAtPath(UnityEditor.AssetDatabase.GUIDToAssetPath("f844207643fe35744b72bf387a704960")); } } + + public void PopulateViemNames(string text) + { + var projectConfig = ProjectConfigUtilities.Load(); + if (ChainIdAndViemNameArray == null || projectConfig.ChainConfigs.Count != ChainIdAndViemNameArray.Length) + { + var allChainIdsAndViemNames = JsonConvert.DeserializeObject(text); + var dict = projectConfig.ChainConfigs.ToDictionary(x => x.ChainId, x => x); + ChainIdAndViemNameArray = allChainIdsAndViemNames.Where(x => dict.ContainsKey(x.ChainId)).ToArray(); + } + } #endif + protected override void ConfigureServices(IWeb3ServiceCollection services) { + #if UNITY_WEBGL && !UNITY_EDITOR + ChainIdViemNameMap = ChainIdViemNameMap.Count == 0 ? ChainIdAndViemNameArray.ToDictionary(x => x.ChainId, x => x.ViewName) : ChainIdViemNameMap; + services.UseReownWebGL(this) + .UseWalletSigner() + .UseWalletTransactionExecutor(); + + #else services.UseReown(this) .UseWalletSigner() .UseWalletTransactionExecutor(); + + #endif } + public override async Task SavedSessionAvailable() { @@ -135,4 +164,13 @@ public Task ProvideHandler() return Task.FromResult((ReownConnectionHandler)_loadedHandler); } } + + [Serializable] + public class ViemNameChainId + { + [JsonProperty("id")] + [field:SerializeField]public string ChainId { get; set; } + [JsonProperty("name")] + [field:SerializeField]public string ViewName { get; set; } + } } diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ProjectConfigUtilities.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ProjectConfigUtilities.cs index a40b6366f..1955ea937 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ProjectConfigUtilities.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/ProjectConfigUtilities.cs @@ -113,6 +113,7 @@ public LocalhostChainConfig(string chainId, string symbol, string chain, string public string Ipc => null; public string Ws { get; } public string BlockExplorerUrl { get; } + public string ViemName { get; } } } } \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit.meta b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit.meta new file mode 100644 index 000000000..6071902fe --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 292b2bba1f834cb89897e413e3662e4c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSendTransactionWagmi.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSendTransactionWagmi.cs new file mode 100644 index 000000000..1efbf2a59 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSendTransactionWagmi.cs @@ -0,0 +1,35 @@ +using ChainSafe.Gaming.Reown.Models; +using Nethereum.RPC.Eth.DTOs; +using Reown.Core.Common.Utils; +using Reown.Core.Network.Models; + +namespace ChainSafe.Gaming.Reown.AppKit +{ + /// + /// Wagmi doesn't support array when sending transactions like Nethereum does, so I've created this class to handle the sending + /// of a single transaction. + /// + [RpcMethod("sendTransaction")] + [RpcRequestOptions(Clock.ONE_MINUTE, 99999)] + [Preserve] + public class EthSendTransactionWagmi : TransactionModel + { + + public EthSendTransactionWagmi(params TransactionInput[] inputs) : base() + { + var input = inputs[0]; + From = input.From; + To = input.To; + Data = input.Data; + Gas = input.Gas?.ToString(); + GasPrice = input.GasPrice?.ToString(); + Value = input.Value?.ToString(); + Nonce = input.Nonce?.ToString(); + } + + public EthSendTransactionWagmi() + { + + } + } +} \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSendTransactionWagmi.cs.meta b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSendTransactionWagmi.cs.meta new file mode 100644 index 000000000..3665cb5cc --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSendTransactionWagmi.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0dec7364271373649945f933cb1d6aec +timeCreated: 1733932572 \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSignMessageWagmi.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSignMessageWagmi.cs new file mode 100644 index 000000000..9ee3fbfd0 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSignMessageWagmi.cs @@ -0,0 +1,17 @@ +using Newtonsoft.Json; + +namespace ChainSafe.Gaming.Reown.AppKit +{ + /// + /// Unlike the original EthSignMessage, this class is used only for webGL when we are sending the signMessage request trough wagmi. + /// + public class EthSignMessageWagmi + { + public EthSignMessageWagmi(params object[] x) + { + Message = x[0].ToString(); + } + [JsonProperty("message")] + public string Message { get; set; } + } +} \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSignMessageWagmi.cs.meta b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSignMessageWagmi.cs.meta new file mode 100644 index 000000000..ec54f5092 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/EthSignMessageWagmi.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a2a2828c37de45a9879b7f754ec2209b +timeCreated: 1734344562 \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLExtensions.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLExtensions.cs new file mode 100644 index 000000000..1eea0163c --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLExtensions.cs @@ -0,0 +1,26 @@ +#if UNITY_WEBGL && !UNITY_EDITOR +using ChainSafe.Gaming.Web3.Build; +using ChainSafe.Gaming.Web3.Core; +using ChainSafe.Gaming.Web3.Evm.Wallet; +using Microsoft.Extensions.DependencyInjection; + +namespace ChainSafe.Gaming.Reown.AppKit +{ + public static class ReownWebGLExtensions + { + public static IWeb3ServiceCollection UseReownWebGL( + this IWeb3ServiceCollection services, + IReownConfig config) + { + services.AssertServiceNotBound(); + services.ConfigureReown(config); + services.AddSingleton(); + services.AddSingleton(); + services.UseWalletProvider(config); + return services; + } + + + } +} +#endif \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLExtensions.cs.meta b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLExtensions.cs.meta new file mode 100644 index 000000000..92b201078 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLExtensions.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8a28bba061bf9b44caac3b98910e60d2 +timeCreated: 1733822979 \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLProvider.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLProvider.cs new file mode 100644 index 000000000..750a9e0eb --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLProvider.cs @@ -0,0 +1,227 @@ +#if UNITY_WEBGL +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using ChainSafe.Gaming.Reown.Methods; +using ChainSafe.Gaming.Web3; +using ChainSafe.Gaming.Web3.Core; +using ChainSafe.Gaming.Web3.Core.Chains; +using ChainSafe.Gaming.Web3.Core.Operations; +using ChainSafe.Gaming.Web3.Environment; +using ChainSafe.Gaming.Web3.Evm.Wallet; +using Nethereum.JsonRpc.Client.RpcMessages; +using Newtonsoft.Json; +using Reown.AppKit.Unity; +using Reown.AppKit.Unity.WebGl.Wagmi; +using UnityEngine; +using NativeCurrency = Reown.AppKit.Unity.WebGl.Wagmi.NativeCurrency; +using Object = UnityEngine.Object; +using W3AppKit = global::Reown.AppKit.Unity.AppKit; + +namespace ChainSafe.Gaming.Reown.AppKit +{ + public class ReownWebGLProvider : WalletProvider, ILifecycleParticipant, IConnectionHelper + { + private IReownConfig ReownConfig { get; set; } + + private readonly ReownHttpClient _httpClient; + private readonly IChainConfigSet _chains; + private readonly ILogWriter _logWriter; + private readonly IChainManager _chainManager; + private Chain[] _appKitChains; + + private readonly string[] TestnetSuffix = new[] + { + "Testnet", + "Goerli", + "Sepolia" + }; + + public ReownWebGLProvider(ReownHttpClient httpClient, IChainConfigSet chains, IReownConfig reownConfig, + ILogWriter logWriter, Web3Environment web3Environment, IChainManager chainManager, + IOperationTracker operationTracker) : base(web3Environment, chainManager.Current, operationTracker) + { + _httpClient = httpClient; + _chains = chains; + _logWriter = logWriter; + _chainManager = chainManager; + ReownConfig = reownConfig; + } + + private async Task Initialize() + { + if (W3AppKit.Instance != null) + return; + + Object.Instantiate(Resources.Load("Reown AppKit")); + + _appKitChains = _chains.Configs + .Select(x => + { + if (!ReownConfig.ChainIdViemNameMap.TryGetValue(x.ChainId, out var viemName)) + throw new ReownIntegrationException( + $"Viem Name is not set for chain: {x.Chain} {x.ChainId}. Make sure to populate the viem name for this chain id in Reown Connection Provider."); + return IChainConfigToAppKitChain(x); + }).ToArray(); + + var appKitConfig = new AppKitConfig() + { + projectId = ReownConfig.ProjectId, + metadata = new Metadata(ReownConfig.Metadata.Name, ReownConfig.Metadata.Description, + ReownConfig.Metadata.Url, ReownConfig.Metadata.Icons[0], new RedirectData() + { + Native = ReownConfig.Metadata.Redirect.Native, + Universal = ReownConfig.Metadata.Redirect.Universal + }), + supportedChains = _appKitChains, + enableEmail = false, + enableOnramp = false + }; + + await W3AppKit.InitializeAsync(appKitConfig); + } + + private Chain IChainConfigToAppKitChain(IChainConfig x) + { + return new Chain(ChainConstants.Namespaces.Evm, x.ChainId, + x.Chain, new Currency(x.NativeCurrency.Name, x.NativeCurrency.Symbol, + x.NativeCurrency.Decimals), new BlockExplorer(x.Chain + " block explorer", x.BlockExplorerUrl), + x.Rpc, IsTestnet(x.Chain), "https://chainlist.org/unknown-logo.png", ReownConfig.ChainIdViemNameMap[x.ChainId]); + } + + private bool IsTestnet(string argChain) + { + return TestnetSuffix.Any(x => argChain.Contains(x, StringComparison.InvariantCultureIgnoreCase)); + } + + public async ValueTask WillStartAsync() + { + await Initialize(); + } + + public ValueTask WillStopAsync() + { + W3AppKit.AccountConnected -= AppKitAccountConnected; + W3AppKit.ModalController.OpenStateChanged -= OpenStateChanged; + W3AppKit.ModalController.OpenStateChanged -= OpenStateChanged; + return new ValueTask(); + } + + public bool StoredSessionAvailable => false; + + private readonly TaskCompletionSource _accountConnected = new(); + + public override async Task Connect() + { + await Initialize(); + W3AppKit.AccountConnected += AppKitAccountConnected; + W3AppKit.NetworkController.ChainChanged += NetworkControllerOnChainChanged; + W3AppKit.ModalController.OpenStateChanged += OpenStateChanged; + W3AppKit.OpenModal(); + var result = await _accountConnected.Task; + return result; + } + + private void NetworkControllerOnChainChanged(object sender, NetworkController.ChainChangedEventArgs e) + { + W3AppKit.CloseModal(); + } + + private async void OpenStateChanged(object sender, ModalOpenStateChangedEventArgs e) + { + await Task.Delay(200); + if(!e.IsOpen && _accountConnected.Task.IsCompleted == false) + _accountConnected.SetException(new TaskCanceledException()); + } + + private async void AppKitAccountConnected(object sender, Connector.AccountConnectedEventArgs e) + { + var account = await e.GetAccount(); + _accountConnected.SetResult(account.Address); + } + + public override async Task Disconnect() + { + await W3AppKit.ConnectorController.DisconnectAsync(); + } + + public override async Task HandleChainSwitching() + { + var currentChain = _chainManager.Current; + await WagmiInterop.SwitchChainAsync(int.Parse(currentChain.ChainId), new AddEthereumChainParameter() + { + chainId = $"{ChainConstants.Namespaces.Evm}:{currentChain.ChainId}", + blockExplorerUrls = new [] { currentChain.BlockExplorerUrl }, + chainName = currentChain.Chain, + nativeCurrency = new NativeCurrency() + { + decimals = currentChain.NativeCurrency.Decimals, + name = currentChain.NativeCurrency.Name, + symbol = currentChain.NativeCurrency.Symbol + }, + rpcUrls = new [] { currentChain.Rpc }, + iconUrls = new [] { "https://chainlist.org/unknown-logo.png"} + }); + } + + public override async Task Request(string method, params object[] parameters) + { + return await ReownRequest(method, parameters); + } + + private async Task ReownRequest(string method, params object[] parameters) + { + // Helper method to make a request using ReownSignClient. + async Task MakeRequest(bool sendChainId = true) + { + var data = (TRequest)Activator.CreateInstance(typeof(TRequest), parameters); + try + { + return await WagmiInterop.InteropCallAsync(method, data); + } + catch (KeyNotFoundException e) + { + throw new ReownIntegrationException( + "Can't execute request. The session was most likely terminated on the wallet side.", e); + } + } + + switch (method) + { + case "personal_sign": + method = "signMessage"; + return await MakeRequest(); + case "eth_signTypedData": + method = "signTypedData"; + return await MakeRequest(); + case "eth_sendTransaction": + method = "sendTransaction"; + return await MakeRequest(); + case "wallet_addEthereumChain" : + return default; + default: + try + { + // Direct RPC request via http, Reown RPC url. + var chain = W3AppKit.NetworkController.ActiveChain.ChainId; + + // Using Reown Blockchain API: https://docs.reown.com/cloud/blockchain-api + var url = $"https://rpc.walletconnect.com/v1?chainId={chain}&projectId={ReownConfig.ProjectId}"; + + var body = JsonConvert.SerializeObject(new RpcRequestMessage(Guid.NewGuid().ToString(), method, + parameters)); + var rawResult = await _httpClient.PostRaw(url, body, "application/json"); + var response = JsonConvert.DeserializeObject(rawResult.Response); + + return response.Result.ToObject(); + } + catch (Exception e) + { + throw new ReownIntegrationException($"{method} RPC method currently not implemented.", e); + } + } + } + } +} +#endif \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLProvider.cs.meta b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLProvider.cs.meta new file mode 100644 index 000000000..60fde6da1 --- /dev/null +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/AppKit/ReownWebGLProvider.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4bdcf4e8e2dd4e343a6ccfd411c4e546 +timeCreated: 1733824761 \ No newline at end of file diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/ReownConfigAsset.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/ReownConfigAsset.cs index b74b5aec1..d20a9b679 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/ReownConfigAsset.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Reown/ReownConfigAsset.cs @@ -34,7 +34,8 @@ public class ReownConfigAsset : ScriptableObject, IReownConfig public bool RememberSession { get; set; } public bool ForceNewSession { get; set; } public EventHandler OnRelayErrored { get; set; } - + public Dictionary ChainIdViemNameMap { get; } + public IRelayUrlBuilder RelayUrlBuilder => null; // todo; public IList IncludeWalletIds => includeWalletIds; diff --git a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/UI/ConnectionScreen.cs b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/UI/ConnectionScreen.cs index bc0e8de47..3ea752dde 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/Scripts/UI/ConnectionScreen.cs +++ b/Packages/io.chainsafe.web3-unity/Runtime/Scripts/UI/ConnectionScreen.cs @@ -16,7 +16,10 @@ public class ConnectionScreen : MonoBehaviour [SerializeField] private ConnectionProviderButton providerButtonPrefab; [SerializeField] private Button closeButton; + private int _numberOfProviders; + private int loadingOverlayId; + private ConnectionProvider _provider; private void Awake() { @@ -29,7 +32,9 @@ public void Initialize(ConnectionProvider[] providers) { if (provider != null && provider.IsAvailable) { + _numberOfProviders++; var button = Instantiate(providerButtonPrefab, providerContainer); + _provider = provider; button.Set(provider.ButtonIcon, provider.ButtonText, () => ConnectClicked(provider)); } } @@ -61,9 +66,16 @@ private async Task TryConnect(ConnectionProvider provider) } } - public void Open() + public async void Open() { - gameObject.SetActive(true); + if (_provider != null && _numberOfProviders == 1) + { + await TryConnect(_provider); + } + else + { + gameObject.SetActive(true); + } } public void Close() diff --git a/Packages/io.chainsafe.web3-unity/Runtime/chainsafe.web3-unity.asmdef b/Packages/io.chainsafe.web3-unity/Runtime/chainsafe.web3-unity.asmdef index 3db91aa8a..26459935e 100644 --- a/Packages/io.chainsafe.web3-unity/Runtime/chainsafe.web3-unity.asmdef +++ b/Packages/io.chainsafe.web3-unity/Runtime/chainsafe.web3-unity.asmdef @@ -4,6 +4,11 @@ "references": [ "GUID:6055be8ebefd69e48b49212b09b47b2f", "GUID:1e69005fbbf5a4cd0a6c61596a74886e", + "GUID:3e99d4890953d4e1794cd95f5f8af28c", + "GUID:4a7aa3f3f98a146a1a22cec006648e4f", + "GUID:2475f66dc86de476fbf57ee4d48fb277", + "GUID:ef24534b04b0d4a5d94edc102ea97a33", + "GUID:33de4d868b803453e9e80bc244c66263", "GUID:75469ad4d38634e559750d17036d5f7c" ], "includePlatforms": [], diff --git a/Packages/io.chainsafe.web3-unity/package.json b/Packages/io.chainsafe.web3-unity/package.json index 3164e94de..c3419ef6d 100644 --- a/Packages/io.chainsafe.web3-unity/package.json +++ b/Packages/io.chainsafe.web3-unity/package.json @@ -8,7 +8,19 @@ "documentationUrl": "https://docs.gaming.chainsafe.io/", "dependencies": { "com.unity.nuget.newtonsoft-json": "3.0.2", - "com.unity.textmeshpro": "3.0.6" + "com.unity.textmeshpro": "3.0.6", + "com.reown.appkit.unity": "1.2.0", + "com.nethereum.unity": "4.26.0", + "com.reown.core": "1.1.2", + "com.reown.core.common": "1.1.2", + "com.reown.core.crypto": "1.1.2", + "com.reown.core.network": "1.1.2", + "com.reown.core.storage": "1.1.2", + "com.reown.sign": "1.1.2", + "com.reown.sign.nethereum": "1.1.2", + "com.reown.sign.nethereum.unity": "1.1.2", + "com.reown.sign.unity": "1.1.2", + "com.reown.unity.dependencies": "1.1.2" }, "keywords": [ "web3", diff --git a/Setup/dependencies.json b/Setup/dependencies.json index 0ffcebcfc..af0947cc5 100644 --- a/Setup/dependencies.json +++ b/Setup/dependencies.json @@ -51,15 +51,7 @@ "ChainSafe.Gaming.Unity.MetaMask", "ChainSafe.Gaming.Marketplace", "ChainSafe.Gaming.Unity.EthereumWindow", - "ChainSafe.Gaming.Reown", - "Reown.Core", - "Reown.Core.Common", - "Reown.Core.Crypto", - "Reown.Core.Network", - "Reown.Core.Network.WebSocket", - "Reown.Core.Storage", - "Reown.Sign", - "Reown.WalletKit" + "ChainSafe.Gaming.Reown" ] }, { diff --git a/src/ChainSafe.Gaming.Reown/IReownConfig.cs b/src/ChainSafe.Gaming.Reown/IReownConfig.cs index ef2c007c0..3b09b6313 100644 --- a/src/ChainSafe.Gaming.Reown/IReownConfig.cs +++ b/src/ChainSafe.Gaming.Reown/IReownConfig.cs @@ -102,6 +102,11 @@ public interface IReownConfig : IWalletProviderConfig /// EventHandler? OnRelayErrored { get; } + /// + /// Map that contains the chain ID and the Viem name of that chain. Used ONLY for WebGL for AppKit. + /// + public Dictionary ChainIdViemNameMap { get; } + /// /// Validates the Reown configuration object. /// diff --git a/src/ChainSafe.Gaming.Reown/ReownProvider.cs b/src/ChainSafe.Gaming.Reown/ReownProvider.cs index e0fec2202..7176f3247 100644 --- a/src/ChainSafe.Gaming.Reown/ReownProvider.cs +++ b/src/ChainSafe.Gaming.Reown/ReownProvider.cs @@ -246,6 +246,7 @@ public override async Task Connect() } connected = true; + await SwitchChainAddIfMissing(); return address; } diff --git a/src/ChainSafe.Gaming.Unity.MetaMask/MetaMaskProvider.cs b/src/ChainSafe.Gaming.Unity.MetaMask/MetaMaskProvider.cs index bce4115b3..433b0aa92 100644 --- a/src/ChainSafe.Gaming.Unity.MetaMask/MetaMaskProvider.cs +++ b/src/ChainSafe.Gaming.Unity.MetaMask/MetaMaskProvider.cs @@ -88,8 +88,8 @@ public override async Task Connect() EventName = "Metamask WebGL Initialized", PackageName = "io.chainsafe.web3-unity", }); - - return await metaMaskController.Connect(chainConfig, chainRegistryProvider); + var connect = await metaMaskController.Connect(chainConfig, chainRegistryProvider); + return connect; } } } \ No newline at end of file diff --git a/src/ChainSafe.Gaming/Web3/Evm/Wallet/WalletProvider.cs b/src/ChainSafe.Gaming/Web3/Evm/Wallet/WalletProvider.cs index f1a47d5ca..2eab858ac 100644 --- a/src/ChainSafe.Gaming/Web3/Evm/Wallet/WalletProvider.cs +++ b/src/ChainSafe.Gaming/Web3/Evm/Wallet/WalletProvider.cs @@ -1,6 +1,5 @@ using System; using System.Globalization; -using System.Numerics; using System.Threading.Tasks; using ChainSafe.Gaming.Evm.Providers; using ChainSafe.Gaming.Web3.Core.Chains; @@ -38,7 +37,7 @@ protected WalletProvider(Web3Environment environment, IChainConfig chainConfig, public abstract Task Request(string method, params object[] parameters); // todo sync wallet chain id before sending any other request - public async Task HandleChainSwitching() + public virtual async Task HandleChainSwitching() { try { diff --git a/src/ChainSafe.Gaming/Web3/Evm/Wallet/WalletSigner.cs b/src/ChainSafe.Gaming/Web3/Evm/Wallet/WalletSigner.cs index bc700f711..c025b64e0 100644 --- a/src/ChainSafe.Gaming/Web3/Evm/Wallet/WalletSigner.cs +++ b/src/ChainSafe.Gaming/Web3/Evm/Wallet/WalletSigner.cs @@ -22,15 +22,13 @@ public WalletSigner(IWalletProvider walletProvider, IWalletProviderConfig wallet this.walletConfig = walletConfig; } - public string PublicAddress { get; private set; } + public string PublicAddress { get; protected set; } public virtual async ValueTask WillStartAsync() { string address = await walletProvider.Connect(); PublicAddress = address.AssertIsPublicAddress(); - - await walletProvider.SwitchChainAddIfMissing(); } public virtual async Task SignMessage(string message) diff --git a/src/UnitySampleProject/Assets/Resources/MetamaskConnectionProvider.asset b/src/UnitySampleProject/Assets/Resources/MetamaskConnectionProvider.asset deleted file mode 100644 index 597156757..000000000 --- a/src/UnitySampleProject/Assets/Resources/MetamaskConnectionProvider.asset +++ /dev/null @@ -1,16 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1b64d00084d2c544aa644a8a6010964d, type: 3} - m_Name: MetamaskConnectionProvider - m_EditorClassIdentifier: - k__BackingField: {fileID: 21300000, guid: 5a352cd3fc34a4b4390c5fa195b12ad7, type: 3} - k__BackingField: MetaMask diff --git a/src/UnitySampleProject/Assets/Resources/ReownConnectionProvider.asset b/src/UnitySampleProject/Assets/Resources/ReownConnectionProvider.asset index b430f6958..625c7d71b 100644 --- a/src/UnitySampleProject/Assets/Resources/ReownConnectionProvider.asset +++ b/src/UnitySampleProject/Assets/Resources/ReownConnectionProvider.asset @@ -17,21 +17,29 @@ MonoBehaviour: PortraitPrefab: {fileID: 593021089488692521, guid: f844207643fe35744b72bf387a704960, type: 3} includeWalletIds: [] excludeWalletIds: [] - k__BackingField: 214bf16d1d17a589e2d54d49fefa2259 - k__BackingField: Web3.Unity + k__BackingField: f4bff60eb260841f46b1c77588cd8acb + k__BackingField: Web3.unity k__BackingField: 1 k__BackingField: unity-game k__BackingField: - Description: web3.unity is an open-source gaming SDK. + Description: Web3.Unity SDK is an open source SDK that connects unity games to + the blockchain Icons: [] - Name: Web3.Unity + Name: Web3.Unity SDK Redirect: Native: Universal: - Url: https://chainsafe.io/ + Url: https://chainsafe.io VerifyUrl: k__BackingField: k__BackingField: 1 k__BackingField: 0 + k__BackingField: + - k__BackingField: 1993 + k__BackingField: b3Sepolia + - k__BackingField: 11155420 + k__BackingField: optimismSepolia + - k__BackingField: 11155111 + k__BackingField: sepolia k__BackingField: {fileID: 21300000, guid: 9af22e71d3035844ca8ae6e9f2a538f5, type: 3} k__BackingField: Reown diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/3.0.6/Web3.Unity Samples/Scenes/SampleMain.unity b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/3.0.6/Web3.Unity Samples/Scenes/SampleMain.unity index 59fb3ff5d..d267029c5 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/3.0.6/Web3.Unity Samples/Scenes/SampleMain.unity +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/3.0.6/Web3.Unity Samples/Scenes/SampleMain.unity @@ -1023,14 +1023,22 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 29625373239180716, guid: 6d183a51c0030794a8ff3fea5dbd6423, type: 3} - propertyPath: initializeOnAwake - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 29625373239180716, guid: 6d183a51c0030794a8ff3fea5dbd6423, type: 3} - propertyPath: rememberConnection + - target: {fileID: 5008553068369276269, guid: 6d183a51c0030794a8ff3fea5dbd6423, type: 3} + propertyPath: providers.Array.size value: 1 objectReference: {fileID: 0} + - target: {fileID: 5008553068369276269, guid: 6d183a51c0030794a8ff3fea5dbd6423, type: 3} + propertyPath: providers.Array.data[0] + value: + objectReference: {fileID: 11400000, guid: cad6fa48701480044a2a6f2d9c9dae1e, type: 2} + - target: {fileID: 5008553068369276269, guid: 6d183a51c0030794a8ff3fea5dbd6423, type: 3} + propertyPath: providers.Array.data[1] + value: + objectReference: {fileID: 11400000, guid: cad6fa48701480044a2a6f2d9c9dae1e, type: 2} + - target: {fileID: 5008553068369276269, guid: 6d183a51c0030794a8ff3fea5dbd6423, type: 3} + propertyPath: providers.Array.data[2] + value: + objectReference: {fileID: 11400000, guid: cad6fa48701480044a2a6f2d9c9dae1e, type: 2} - target: {fileID: 8519303782652390544, guid: 6d183a51c0030794a8ff3fea5dbd6423, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -1071,16 +1079,12 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 8854369476742677865, guid: 6d183a51c0030794a8ff3fea5dbd6423, type: 3} - propertyPath: pollingInterval - value: 10 - objectReference: {fileID: 0} - target: {fileID: 9007579812972099230, guid: 6d183a51c0030794a8ff3fea5dbd6423, type: 3} propertyPath: m_Name value: Web3Unity objectReference: {fileID: 0} m_RemovedComponents: - - {fileID: 0} + - {fileID: 5476790877551271816, guid: 6d183a51c0030794a8ff3fea5dbd6423, type: 3} m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] @@ -1119,7 +1123,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -0.000061035156, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &1703188665 diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/3.0.6/Web3.Unity Samples/Scripts/Samples/Erc20Sample.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/3.0.6/Web3.Unity Samples/Scripts/Samples/Erc20Sample.cs index adac61e27..bbf32262a 100644 --- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/3.0.6/Web3.Unity Samples/Scripts/Samples/Erc20Sample.cs +++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/3.0.6/Web3.Unity Samples/Scripts/Samples/Erc20Sample.cs @@ -114,7 +114,6 @@ public async Task TotalSupply() public async Task MintErc20() { var mintResponse = await Web3Unity.Web3.Erc20.MintWithReceipt(ChainSafeContracts.Erc20, valueToSend * weiPerEther); - return mintResponse.TransactionHash; } diff --git a/src/UnitySampleProject/Assets/csc.rsp.meta b/src/UnitySampleProject/Assets/csc.rsp.meta new file mode 100644 index 000000000..b7d246f8d --- /dev/null +++ b/src/UnitySampleProject/Assets/csc.rsp.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8630a7b4d41c54991bb6abdad2d1bbe6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/UnitySampleProject/Packages/manifest.json b/src/UnitySampleProject/Packages/manifest.json index 30ab7bd87..4964e76c0 100644 --- a/src/UnitySampleProject/Packages/manifest.json +++ b/src/UnitySampleProject/Packages/manifest.json @@ -1,5 +1,6 @@ { "dependencies": { + "com.tools.webglthreadingpatcher": "https://github.com/VolodymyrBS/WebGLThreadingPatcher.git", "com.unity.collab-proxy": "2.4.4", "com.unity.ide.rider": "3.0.34", "com.unity.ide.visualstudio": "2.0.22", @@ -11,6 +12,7 @@ "com.unity.toolchain.macos-arm64-linux-x86_64": "2.0.0", "com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.9", "com.unity.ugui": "1.0.0", + "com.unity.vectorgraphics": "2.0.0-preview.25", "com.unity.visualscripting": "1.9.4", "com.utilities.async": "https://github.com/RageAgainstThePixel/com.utilities.async.git#upm", "io.chainsafe.web3-unity": "file:../../../Packages/io.chainsafe.web3-unity", @@ -50,8 +52,7 @@ "com.unity.modules.video": "1.0.0", "com.unity.modules.vr": "1.0.0", "com.unity.modules.wind": "1.0.0", - "com.unity.modules.xr": "1.0.0", - "com.tools.webglthreadingpatcher": "https://github.com/VolodymyrBS/WebGLThreadingPatcher.git" + "com.unity.modules.xr": "1.0.0" }, "enableLockFile": true, "scopedRegistries": [ @@ -59,8 +60,19 @@ "name": "package.openupm.com", "url": "https://package.openupm.com", "scopes": [ - "com.nethereum.unity" + "com.nethereum.unity", + "com.reown.core", + "com.reown.core.common", + "com.reown.core.crypto", + "com.reown.core.network", + "com.reown.core.storage", + "com.reown.sign", + "com.reown.sign.nethereum", + "com.reown.sign.nethereum.unity", + "com.reown.sign.unity", + "com.reown.unity.dependencies", + "com.reown.appkit.unity" ] } ] -} \ No newline at end of file +} diff --git a/src/UnitySampleProject/Packages/packages-lock.json b/src/UnitySampleProject/Packages/packages-lock.json index 06d1a6023..c5eca3ebd 100644 --- a/src/UnitySampleProject/Packages/packages-lock.json +++ b/src/UnitySampleProject/Packages/packages-lock.json @@ -1,5 +1,124 @@ { "dependencies": { + "com.nethereum.unity": { + "version": "4.26.0", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://package.openupm.com" + }, + "com.reown.appkit.unity": { + "version": "1.2.0", + "depth": 1, + "source": "registry", + "dependencies": { + "com.reown.sign.nethereum.unity": "1.2.0", + "com.reown.sign.unity": "1.2.0", + "com.reown.core": "1.2.0", + "com.reown.unity.dependencies": "1.2.0", + "com.unity.vectorgraphics": "2.0.0-preview.24" + }, + "url": "https://package.openupm.com" + }, + "com.reown.core": { + "version": "1.2.0", + "depth": 2, + "source": "registry", + "dependencies": { + "com.reown.core.common": "1.2.0", + "com.reown.core.network": "1.2.0", + "com.reown.core.storage": "1.2.0", + "com.reown.core.crypto": "1.2.0", + "com.reown.unity.dependencies": "1.2.0" + }, + "url": "https://package.openupm.com" + }, + "com.reown.core.common": { + "version": "1.2.0", + "depth": 3, + "source": "registry", + "dependencies": { + "com.unity.nuget.newtonsoft-json": "3.2.1" + }, + "url": "https://package.openupm.com" + }, + "com.reown.core.crypto": { + "version": "1.2.0", + "depth": 3, + "source": "registry", + "dependencies": { + "com.reown.core.common": "1.2.0", + "com.reown.core.network": "1.2.0", + "com.reown.core.storage": "1.2.0", + "com.reown.unity.dependencies": "1.2.0" + }, + "url": "https://package.openupm.com" + }, + "com.reown.core.network": { + "version": "1.2.0", + "depth": 3, + "source": "registry", + "dependencies": { + "com.reown.core.common": "1.2.0" + }, + "url": "https://package.openupm.com" + }, + "com.reown.core.storage": { + "version": "1.2.0", + "depth": 3, + "source": "registry", + "dependencies": { + "com.reown.core.common": "1.2.0" + }, + "url": "https://package.openupm.com" + }, + "com.reown.sign": { + "version": "1.2.0", + "depth": 3, + "source": "registry", + "dependencies": { + "com.reown.core": "1.2.0" + }, + "url": "https://package.openupm.com" + }, + "com.reown.sign.nethereum": { + "version": "1.2.0", + "depth": 3, + "source": "registry", + "dependencies": { + "com.reown.sign": "1.2.0", + "com.nethereum.unity": "4.26.0" + }, + "url": "https://package.openupm.com" + }, + "com.reown.sign.nethereum.unity": { + "version": "1.2.0", + "depth": 2, + "source": "registry", + "dependencies": { + "com.reown.sign.nethereum": "1.2.0", + "com.reown.sign.unity": "1.2.0" + }, + "url": "https://package.openupm.com" + }, + "com.reown.sign.unity": { + "version": "1.2.0", + "depth": 2, + "source": "registry", + "dependencies": { + "com.reown.sign": "1.2.0" + }, + "url": "https://package.openupm.com" + }, + "com.reown.unity.dependencies": { + "version": "1.2.0", + "depth": 2, + "source": "registry", + "dependencies": { + "com.unity.nuget.newtonsoft-json": "3.2.1" + }, + "url": "https://package.openupm.com" + }, "com.tools.webglthreadingpatcher": { "version": "https://github.com/VolodymyrBS/WebGLThreadingPatcher.git", "depth": 0, @@ -9,6 +128,12 @@ }, "hash": "c2f3628a028373afc8c66e443f7ce21bcb613a47" }, + "com.unity.2d.sprite": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": {} + }, "com.unity.collab-proxy": { "version": "2.4.4", "depth": 0, @@ -146,6 +271,25 @@ "com.unity.modules.imgui": "1.0.0" } }, + "com.unity.vectorgraphics": { + "version": "2.0.0-preview.25", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0", + "com.unity.2d.sprite": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.physics2d": "1.0.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.visualscripting": { "version": "1.9.4", "depth": 0, @@ -173,7 +317,19 @@ "source": "local", "dependencies": { "com.unity.nuget.newtonsoft-json": "3.0.2", - "com.unity.textmeshpro": "3.0.6" + "com.unity.textmeshpro": "3.0.6", + "com.reown.appkit.unity": "1.2.0", + "com.nethereum.unity": "4.26.0", + "com.reown.core": "1.1.2", + "com.reown.core.common": "1.1.2", + "com.reown.core.crypto": "1.1.2", + "com.reown.core.network": "1.1.2", + "com.reown.core.storage": "1.1.2", + "com.reown.sign": "1.1.2", + "com.reown.sign.nethereum": "1.1.2", + "com.reown.sign.nethereum.unity": "1.1.2", + "com.reown.sign.unity": "1.1.2", + "com.reown.unity.dependencies": "1.1.2" } }, "io.chainsafe.web3-unity.hyperplay": { diff --git a/src/UnitySampleProject/ProjectSettings/PackageManagerSettings.asset b/src/UnitySampleProject/ProjectSettings/PackageManagerSettings.asset index 9cfd149e6..2ecba18d0 100644 --- a/src/UnitySampleProject/ProjectSettings/PackageManagerSettings.asset +++ b/src/UnitySampleProject/ProjectSettings/PackageManagerSettings.asset @@ -31,6 +31,17 @@ MonoBehaviour: m_Url: https://package.openupm.com m_Scopes: - com.nethereum.unity + - com.reown.core + - com.reown.core.common + - com.reown.core.crypto + - com.reown.core.network + - com.reown.core.storage + - com.reown.sign + - com.reown.sign.nethereum + - com.reown.sign.nethereum.unity + - com.reown.sign.unity + - com.reown.unity.dependencies + - com.reown.appkit.unity m_IsDefault: 0 m_Capabilities: 0 m_ConfigSource: 4 diff --git a/src/UnitySampleProject/ProjectSettings/ProjectSettings.asset b/src/UnitySampleProject/ProjectSettings/ProjectSettings.asset index e88f96d99..c147f4d7e 100644 --- a/src/UnitySampleProject/ProjectSettings/ProjectSettings.asset +++ b/src/UnitySampleProject/ProjectSettings/ProjectSettings.asset @@ -793,7 +793,7 @@ PlayerSettings: webGLPowerPreference: 2 scriptingDefineSymbols: Standalone: ENABLE_ANALYTICS - WebGL: RAMP_AVAILABLE;MARKETPLACE_AVAILABLE + WebGL: RAMP_AVAILABLE;MARKETPLACE_AVAILABLE;APPKIT_AVAILABLE iPhone: RAMP_AVAILABLE additionalCompilerArguments: {} platformArchitecture: {}