diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay.meta b/Assets/Thirdweb/Core/Scripts/Hyperplay.meta new file mode 100644 index 00000000..600c485e --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 51ab940595798f24f93f242e9f1837ea +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay/Hyperplay.cs b/Assets/Thirdweb/Core/Scripts/Hyperplay/Hyperplay.cs new file mode 100644 index 00000000..46a7c5f7 --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay/Hyperplay.cs @@ -0,0 +1,77 @@ +using System.Threading.Tasks; +using Nethereum.JsonRpc.Client.RpcMessages; +using UnityEngine; +using UnityEngine.Networking; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Thirdweb.Hyperplay +{ + public class Hyperplay + { + public string[] Accounts { get; private set; } + public string ChainId { get; private set; } + + public Hyperplay(string chainId) + { + ChainId = chainId; + Accounts = null; + } + + internal async Task Initialize() + { + Accounts = (await Request(new RpcRequestMessage(-1, "eth_accounts"))).GetResult(); + } + + internal async Task Request(RpcRequestMessage message) + { + HyperplayRequest hyperplayRequest = new HyperplayRequest() { Method = message.Method, Params = message.RawParameters }; + string jsonString = JsonConvert.SerializeObject(hyperplayRequest); + byte[] jsonBytes = System.Text.Encoding.UTF8.GetBytes(jsonString); + using (var request = new UnityWebRequest("localhost:9680/rpcRaw", "POST")) + { + request.uploadHandler = new UploadHandlerRaw(jsonBytes); + request.downloadHandler = new DownloadHandlerBuffer(); + request.SetRequestHeader("Content-Type", "application/json"); + await request.SendWebRequest(); + if (request.result != UnityWebRequest.Result.Success) + { + Debug.LogError(request.error); + throw new UnityException("RPC request failed: " + request.error); + } + var hyperplayResult = JsonConvert.DeserializeObject(request.downloadHandler.text); + try + { + return new RpcResponseMessage(message.Id, JsonConvert.DeserializeObject(hyperplayResult.Result.ToString())); + } + catch + { + return new RpcResponseMessage(message.Id, hyperplayResult.Result.ToString()); + } + } + } + } + + [System.Serializable] + public struct HyperplayRequest + { + [JsonProperty("method")] + public string Method { get; set; } + + [JsonProperty("params")] + public object Params { get; set; } + } + + [System.Serializable] + public struct HyperplayResult + { + [JsonProperty("result")] + public object Result { get; set; } + + [JsonProperty("id")] + public long Id { get; set; } + + [JsonProperty("jsonrpc")] + public string JsonRpc { get; set; } + } +} diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay/Hyperplay.cs.meta b/Assets/Thirdweb/Core/Scripts/Hyperplay/Hyperplay.cs.meta new file mode 100644 index 00000000..a54d10dd --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay/Hyperplay.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a72cbabcb0356540b89313e79e30660 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum.meta b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum.meta new file mode 100644 index 00000000..f29d8c20 --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 15cd0514fad003a4aba7f35ca42808a4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayAccount.cs b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayAccount.cs new file mode 100644 index 00000000..1a45641f --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayAccount.cs @@ -0,0 +1,37 @@ +using Nethereum.JsonRpc.Client; +using Nethereum.RPC.Accounts; +using Nethereum.RPC.AccountSigning; +using Nethereum.RPC.NonceServices; +using Nethereum.RPC.TransactionManagers; + +namespace Thirdweb.Hyperplay +{ + public class HyperplayAccount : IAccount + { + private readonly Hyperplay _wallet; + private readonly IClient _client; + + public string Address + { + get { return _wallet.Accounts[0]; } + } + + public ITransactionManager TransactionManager { get; } + public INonceService NonceService { get; set; } + public IAccountSigningService AccountSigningService { get; } + + public IClient Client + { + get { return _client; } + } + + public HyperplayAccount(Hyperplay wallet, IClient client) + { + _wallet = wallet; + _client = client; + TransactionManager = new HyperplayTransactionManager(this); + NonceService = new InMemoryNonceService(Address, client); + AccountSigningService = new AccountSigningService(client); + } + } +} diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayAccount.cs.meta b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayAccount.cs.meta new file mode 100644 index 00000000..eaceebd1 --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayAccount.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3327f9eab278c9a41bfceb12313346d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayClient.cs b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayClient.cs new file mode 100644 index 00000000..187506e1 --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayClient.cs @@ -0,0 +1,39 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Nethereum.JsonRpc.Client; +using Nethereum.JsonRpc.Client.RpcMessages; + +namespace Thirdweb.Hyperplay +{ + public class HyperplayClient : ClientBase + { + private Hyperplay _hyperplay; + + public HyperplayClient(Hyperplay Hyperplay) + { + this._hyperplay = Hyperplay; + } + + private static readonly Random rng = new Random(); + private static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + + public static long GenerateRpcId() + { + var date = (long)((DateTime.UtcNow - UnixEpoch).TotalMilliseconds) * (10L * 10L * 10L); + var extra = (long)Math.Floor(rng.NextDouble() * (10.0 * 10.0 * 10.0)); + return date + extra; + } + + protected override async Task SendAsync(RpcRequestMessage message, string route = null) + { + message.Id = GenerateRpcId(); + return await _hyperplay.Request(message); + } + + protected override Task SendAsync(RpcRequestMessage[] requests) + { + return Task.WhenAll(requests.Select(r => SendAsync(r))); + } + } +} diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayClient.cs.meta b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayClient.cs.meta new file mode 100644 index 00000000..5447a763 --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayClient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a5a6d3a08ff4d94f91cac455ffb766e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayNEthereumExtensions.cs b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayNEthereumExtensions.cs new file mode 100644 index 00000000..ed8e7a19 --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayNEthereumExtensions.cs @@ -0,0 +1,14 @@ +using Nethereum.Web3; + +namespace Thirdweb.Hyperplay +{ + public static class HyperplayNEthereumExtensions + { + public static Web3 CreateWeb3(this Hyperplay Hyperplay) + { + var client = new HyperplayClient(Hyperplay); + var account = new HyperplayAccount(Hyperplay, client); + return new Web3(account, client); + } + } +} diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayNEthereumExtensions.cs.meta b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayNEthereumExtensions.cs.meta new file mode 100644 index 00000000..04d4ab9d --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayNEthereumExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ddcc517e1bb137e488a910de9b925173 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayTransactionManager.cs b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayTransactionManager.cs new file mode 100644 index 00000000..6ac7ccce --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayTransactionManager.cs @@ -0,0 +1,11 @@ +namespace Thirdweb.Hyperplay +{ + public class HyperplayTransactionManager : Nethereum.RPC.TransactionManagers.TransactionManager + { + public HyperplayTransactionManager(HyperplayAccount account) + : base(account.Client) + { + Account = account; + } + } +} diff --git a/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayTransactionManager.cs.meta b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayTransactionManager.cs.meta new file mode 100644 index 00000000..05e737d5 --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Hyperplay/Nethereum/HyperplayTransactionManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5f3174e8a50b264793785cdd10d7c9a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Thirdweb/Core/Scripts/ThirdwebSession.cs b/Assets/Thirdweb/Core/Scripts/ThirdwebSession.cs index be776a55..2ce9cab3 100644 --- a/Assets/Thirdweb/Core/Scripts/ThirdwebSession.cs +++ b/Assets/Thirdweb/Core/Scripts/ThirdwebSession.cs @@ -76,6 +76,9 @@ public async Task Connect(WalletConnection walletConnection) throw new UnityException("Smart wallet config is required for smart wallet connection method!"); ActiveWallet = new ThirdwebSmartWallet(ActiveWallet, Options.smartWalletConfig.Value); break; + case WalletProvider.Hyperplay: + ActiveWallet = new ThirdwebHyperplay(ChainId.ToString()); + break; default: throw new UnityException("This wallet connection method is not supported on this platform!"); } diff --git a/Assets/Thirdweb/Core/Scripts/Wallet.cs b/Assets/Thirdweb/Core/Scripts/Wallet.cs index e5c9a651..26097783 100644 --- a/Assets/Thirdweb/Core/Scripts/Wallet.cs +++ b/Assets/Thirdweb/Core/Scripts/Wallet.cs @@ -531,6 +531,7 @@ public enum WalletProvider MagicLink, LocalWallet, SmartWallet, - Paper + Paper, + Hyperplay } } diff --git a/Assets/Thirdweb/Core/Scripts/Wallets/ThirdwebHyperplay.cs b/Assets/Thirdweb/Core/Scripts/Wallets/ThirdwebHyperplay.cs new file mode 100644 index 00000000..6e8a5c33 --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Wallets/ThirdwebHyperplay.cs @@ -0,0 +1,79 @@ +using System.Threading.Tasks; +using Nethereum.Web3; +using Nethereum.Web3.Accounts; +using Thirdweb.Hyperplay; + +namespace Thirdweb.Wallets +{ + public class ThirdwebHyperplay : IThirdwebWallet + { + private Web3 _web3; + private WalletProvider _provider; + private WalletProvider _signerProvider; + private Hyperplay.Hyperplay _hyperPlay; + + public ThirdwebHyperplay(string chainId) + { + _web3 = null; + _provider = WalletProvider.Hyperplay; + _signerProvider = WalletProvider.Hyperplay; + _hyperPlay = new Hyperplay.Hyperplay(chainId); + } + + public async Task Connect(WalletConnection walletConnection, string rpc) + { + await _hyperPlay.Initialize(); + _web3 = _hyperPlay.CreateWeb3(); + return _hyperPlay.Accounts[0]; + } + + public Task Disconnect() + { + _web3 = null; + return Task.CompletedTask; + } + + public Account GetLocalAccount() + { + return null; + } + + public Task GetAddress() + { + var addy = _hyperPlay.Accounts[0]; + if (addy != null) + addy = addy.ToChecksumAddress(); + return Task.FromResult(addy); + } + + public async Task GetSignerAddress() + { + return await GetAddress(); + } + + public WalletProvider GetProvider() + { + return _provider; + } + + public WalletProvider GetSignerProvider() + { + return _signerProvider; + } + + public Task GetWeb3() + { + return Task.FromResult(_web3); + } + + public async Task GetSignerWeb3() + { + return await GetWeb3(); + } + + public Task IsConnected() + { + return Task.FromResult(_web3 != null); + } + } +} diff --git a/Assets/Thirdweb/Core/Scripts/Wallets/ThirdwebHyperplay.cs.meta b/Assets/Thirdweb/Core/Scripts/Wallets/ThirdwebHyperplay.cs.meta new file mode 100644 index 00000000..25e3c9d8 --- /dev/null +++ b/Assets/Thirdweb/Core/Scripts/Wallets/ThirdwebHyperplay.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb0b7ec3a1e16e045be65e8bfc92ca23 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Thirdweb/Examples/Prefabs/Prefab_ConnectWallet.prefab b/Assets/Thirdweb/Examples/Prefabs/Prefab_ConnectWallet.prefab index 3907855d..2592f392 100644 --- a/Assets/Thirdweb/Examples/Prefabs/Prefab_ConnectWallet.prefab +++ b/Assets/Thirdweb/Examples/Prefabs/Prefab_ConnectWallet.prefab @@ -300,11 +300,11 @@ RectTransform: m_Children: - {fileID: 949716022} m_Father: {fileID: 1105468536} - m_RootOrder: 9 + m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 256, y: -595} + m_AnchoredPosition: {x: 256, y: -665} m_SizeDelta: {x: 462, y: 60} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &205585823 @@ -1794,6 +1794,7 @@ RectTransform: - {fileID: 1389010191} - {fileID: 1446449672} - {fileID: 1759235101} + - {fileID: 8517345997646397885} - {fileID: 205585820} m_Father: {fileID: 1986256472} m_RootOrder: 0 @@ -1801,7 +1802,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 512, y: 675} + m_SizeDelta: {x: 512, y: 745} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1105468538 CanvasRenderer: @@ -3439,7 +3440,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 25.000004, y: -232} + m_AnchoredPosition: {x: 25, y: -232} m_SizeDelta: {x: 462, y: 20} m_Pivot: {x: 0, y: 0.5} --- !u!222 &4302969082872431126 @@ -3979,7 +3980,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 11.833334, y: -22.5} + m_AnchoredPosition: {x: 11.833328, y: -22.5} m_SizeDelta: {x: 29, y: 29} m_Pivot: {x: 0, y: 0.5} --- !u!222 &6140705160132066554 @@ -5630,6 +5631,82 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &2786814473229296994 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8963453696767061735} + - component: {fileID: 6061264204667389114} + - component: {fileID: 8713608475395669009} + m_Layer: 5 + m_Name: Image_WalletProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8963453696767061735 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2786814473229296994} + 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: 8517345997646397885} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 15, y: 0} + m_SizeDelta: {x: 40, y: 50} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &6061264204667389114 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2786814473229296994} + m_CullTransparentMesh: 1 +--- !u!114 &8713608475395669009 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2786814473229296994} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 84682006b5a7c6b45990f8e510ee7895, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &2796000207828150006 GameObject: m_ObjectHideFlags: 0 @@ -6559,7 +6636,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 56e0ba15cb38b4345825030a6c81d2dd, type: 3} m_Name: m_EditorClassIdentifier: - SupportedWallets: 07000000030000000000000001000000020000000600000005000000 + SupportedWallets: 0700000003000000000000000100000002000000060000000500000008000000 OnConnect: m_PersistentCalls: m_Calls: [] @@ -6604,8 +6681,8 @@ MonoBehaviour: elementIcon: {fileID: 0} reqReferences: {fileID: 0} isExpanded: 1 - _keyValues: 0700000004000000030000000000000001000000020000000600000005000000 - _keys: 0700000004000000030000000000000001000000020000000600000005000000 + _keyValues: 070000000400000003000000000000000100000002000000060000000500000008000000 + _keys: 070000000400000003000000000000000100000002000000060000000500000008000000 _values: - objectToShow: {fileID: 8888651} connectButton: {fileID: 532628331} @@ -6639,6 +6716,10 @@ MonoBehaviour: connectButton: {fileID: 205585821} emailInput: {fileID: 0} sprite: {fileID: 21300000, guid: f5316e85bf485624d9c61a8e374c41c3, type: 3} + - objectToShow: {fileID: 7609031273920898738} + connectButton: {fileID: 5658532676295466576} + emailInput: {fileID: 0} + sprite: {fileID: 21300000, guid: 84682006b5a7c6b45990f8e510ee7895, type: 3} NetworkIcons: - chain: ethereum sprite: {fileID: 21300000, guid: bf76ffa047029554199b8d79b2306f6d, type: 3} @@ -7555,7 +7636,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 30.2, y: -320.8} + m_AnchoredPosition: {x: 30.199997, y: -320.8} m_SizeDelta: {x: 369.754, y: 15} m_Pivot: {x: 0, y: 0.5} --- !u!222 &6741787654344541316 @@ -7901,7 +7982,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 30.2, y: -320.8} + m_AnchoredPosition: {x: 30.199997, y: -320.8} m_SizeDelta: {x: 369.754, y: 15} m_Pivot: {x: 0, y: 0.5} --- !u!222 &1513145485897341986 @@ -10155,6 +10236,141 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: [] +--- !u!1 &7210642170246977717 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4022726107017216203} + - component: {fileID: 6001838344396106368} + - component: {fileID: 9130022457588120008} + m_Layer: 5 + m_Name: Text_WalletProvider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4022726107017216203 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7210642170246977717} + 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: 8517345997646397885} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 75, y: 0} + m_SizeDelta: {x: 350, y: 50} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &6001838344396106368 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7210642170246977717} + m_CullTransparentMesh: 1 +--- !u!114 &9130022457588120008 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7210642170246977717} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: HyperPlay + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 078675f65f8a9144e90348ab75bb07e7, type: 2} + m_sharedMaterial: {fileID: -6451935136126618428, guid: 078675f65f8a9144e90348ab75bb07e7, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4293585384 + m_fontColor: {r: 0.9098039, g: 0.9137255, b: 0.91764706, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: -5 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &7317546527832520452 GameObject: m_ObjectHideFlags: 0 @@ -10327,7 +10543,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0} m_AnchorMax: {x: 0.5, y: 0} - m_AnchoredPosition: {x: 0, y: 33.413} + m_AnchoredPosition: {x: 0, y: 33.412994} m_SizeDelta: {x: 300, y: 36.84} m_Pivot: {x: 0.5, y: 0} --- !u!222 &5815581267129709697 @@ -10668,6 +10884,129 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: [] +--- !u!1 &7609031273920898738 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8517345997646397885} + - component: {fileID: 8563193338649668518} + - component: {fileID: 3378836405307586375} + - component: {fileID: 5658532676295466576} + m_Layer: 5 + m_Name: Hyperplay + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8517345997646397885 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7609031273920898738} + 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: 8963453696767061735} + - {fileID: 4022726107017216203} + m_Father: {fileID: 1105468536} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 256, y: -595} + m_SizeDelta: {x: 462, y: 60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8563193338649668518 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7609031273920898738} + m_CullTransparentMesh: 1 +--- !u!114 &3378836405307586375 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7609031273920898738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 9f6f8f3d15d68764a9ad34fe0383b2dd, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &5658532676295466576 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7609031273920898738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 2 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 21300000, guid: 55f30a94c64ab9741b5131e5387af49d, type: 3} + m_PressedSprite: {fileID: 21300000, guid: 55f30a94c64ab9741b5131e5387af49d, type: 3} + m_SelectedSprite: {fileID: 21300000, guid: 55f30a94c64ab9741b5131e5387af49d, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: 55f30a94c64ab9741b5131e5387af49d, type: 3} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 3378836405307586375} + m_OnClick: + m_PersistentCalls: + m_Calls: [] --- !u!1 &7707905477946381888 GameObject: m_ObjectHideFlags: 0 @@ -11245,7 +11584,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 25.000004, y: -232} + m_AnchoredPosition: {x: 25, y: -232} m_SizeDelta: {x: 462, y: 20} m_Pivot: {x: 0, y: 0.5} --- !u!222 &5402016393635430293 diff --git a/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_ConnectWallet.cs b/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_ConnectWallet.cs index cb284d6a..90a709c2 100644 --- a/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_ConnectWallet.cs +++ b/Assets/Thirdweb/Examples/Scripts/Prefabs/Prefab_ConnectWallet.cs @@ -40,6 +40,7 @@ public class Prefab_ConnectWallet : MonoBehaviour WalletProvider.WalletConnect, WalletProvider.SmartWallet, WalletProvider.LocalWallet, + WalletProvider.Hyperplay }; [Header("Additional event callbacks")] @@ -127,7 +128,8 @@ private void Start() || SupportedWallets.Contains(WalletProvider.Coinbase) || SupportedWallets.Contains(WalletProvider.WalletConnect) || SupportedWallets.Contains(WalletProvider.Injected) - || SupportedWallets.Contains(WalletProvider.SmartWallet); + || SupportedWallets.Contains(WalletProvider.SmartWallet) + || SupportedWallets.Contains(WalletProvider.Hyperplay); OrGameObject.SetActive(usingEmailWallet && usingNormalWallet); diff --git a/Assets/Thirdweb/Examples/Sprites/Wallets/Logo_HyperPlay.png b/Assets/Thirdweb/Examples/Sprites/Wallets/Logo_HyperPlay.png new file mode 100644 index 00000000..3396068c Binary files /dev/null and b/Assets/Thirdweb/Examples/Sprites/Wallets/Logo_HyperPlay.png differ diff --git a/Assets/Thirdweb/Examples/Sprites/Wallets/Logo_HyperPlay.png.meta b/Assets/Thirdweb/Examples/Sprites/Wallets/Logo_HyperPlay.png.meta new file mode 100644 index 00000000..80dc821c --- /dev/null +++ b/Assets/Thirdweb/Examples/Sprites/Wallets/Logo_HyperPlay.png.meta @@ -0,0 +1,159 @@ +fileFormatVersion: 2 +guid: 84682006b5a7c6b45990f8e510ee7895 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: