diff --git a/.gitignore b/.gitignore index e5a49ee..94e4c84 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,5 @@ Resources.meta *.meta /TextMesh Pro /Ton Connect +README.MD.meta +LICENSE.MIT.meta diff --git a/LICENSE.MIT.meta b/LICENSE.MIT.meta deleted file mode 100644 index c51cb7a..0000000 --- a/LICENSE.MIT.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: b648b128b8051564889648ee695bb08b -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/README.MD.meta b/README.MD.meta deleted file mode 100644 index fcd34f5..0000000 --- a/README.MD.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: cf7049f875c2fb043b6ab01ebc61914b -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Uniton Connect/Runtime/Core/Bridges/TonConnectBridge.cs b/Uniton Connect/Runtime/Core/Bridges/TonConnectBridge.cs index 67eaf5b..230aa72 100644 --- a/Uniton Connect/Runtime/Core/Bridges/TonConnectBridge.cs +++ b/Uniton Connect/Runtime/Core/Bridges/TonConnectBridge.cs @@ -147,10 +147,10 @@ private static void OnWalletConnect(string walletInfo) return; } - OnWalletSuccessfullyConnected?.Invoke(walletConfig); - - UnitonConnectLogger.Log($"Wallet successfully connected, " + + UnitonConnectLogger.Log($"Wallet successfully connected, " + $"address: {WalletConnectUtils.GetNonBounceableAddress(walletConfig.Address)}"); + + OnWalletSuccessfullyConnected?.Invoke(walletConfig); } [MonoPInvokeCallback(typeof(Action))] @@ -254,15 +254,19 @@ internal static void UnSubscribe() } internal static void Init(string manifestUrl, - Action sdkInitialized, Action connectionRestored) + Action sdkInitialized, Action walletConnectionDetected, + Action walletConnectionDetectFailed, Action connectionRestored) { OnInitialized = sdkInitialized; OnWalletConnectionRestored = connectionRestored; + OnWalletSuccessfullyConnected = walletConnectionDetected; + OnWalletConnectFailed = walletConnectionDetectFailed; Init(manifestUrl, OnInitialize); InitTonWeb(); SubscribeToRestoreConnection(OnWalletConnectionRestore); + SubscribeToStatusChange(OnWalletConnect); } internal static void Connect( diff --git a/Uniton Connect/Runtime/Core/UnitonConnectSDK.cs b/Uniton Connect/Runtime/Core/UnitonConnectSDK.cs index c57b2c9..7fb5389 100644 --- a/Uniton Connect/Runtime/Core/UnitonConnectSDK.cs +++ b/Uniton Connect/Runtime/Core/UnitonConnectSDK.cs @@ -255,7 +255,8 @@ public void Initialize() if (IsSupporedPlatform()) { TonConnectBridge.Init(dAppManifestLink, - OnInitialize, OnWalletConnectionRestore); + OnInitialize, OnNativeWalletConnectionFinish, + OnNativeWalletConnectionFail, OnWalletConnectionRestore); } OnInitialize(); @@ -655,7 +656,7 @@ private async void RestoreConnectionAsync(RemoteStorage storage) return; } - OnWalletConnectionRestore(isSuccess); + OnWalletConnectionRestore(isSuccess, new WalletConfig()); } private IEnumerator ConfirmTransactionFromBlockchain(string transactionHash) @@ -886,7 +887,7 @@ private void ResetConnectionStorage(RemoteStorage storage) ProjectStorageConsts.DeleteConnectionKey(keyConnection); ProjectStorageConsts.DeleteConnectionKey(lastEventId); - OnWalletConnectionRestore(false); + OnWalletConnectionRestore(false, new WalletConfig()); } private void OpenWalletViaDeepLink(string deepLinkURL) @@ -985,8 +986,6 @@ private void OnWalletConnectionFinish(Wallet wallet) " the storage of the previous session has been cleaned up"); } - _isWalletConnected = true; - _isWalletConnected = _tonConnect.IsConnected; Wallet = new UserWallet(wallet.Account.Address.ToString(), null); @@ -996,23 +995,24 @@ private void OnWalletConnectionFinish(Wallet wallet) private void OnNativeWalletConnectionFinish(NewWalletConfig walletConfig) { - if (!IsWalletConnected) - { - OnNativeWalletDisconnect(true); - - UnitonConnectLogger.Log("Connection to the wallet has been successfully disconnected," + - " the storage of the previous session has been cleaned up"); - } - _isWalletConnected = true; _connectedWalletConfig = walletConfig; - var nonBouceableAddress = WalletConnectUtils.GetNonBounceableAddress(walletConfig.Address); + var nonBouceableAddress = WalletConnectUtils + .GetNonBounceableAddress(walletConfig.Address); + + var updatedConfig = new NewWalletConfig() + { + Address = nonBouceableAddress, + Chain = walletConfig.Chain, + PublicKey = walletConfig.PublicKey, + StateInit = walletConfig.StateInit, + }; - Wallet = new UserWallet(nonBouceableAddress, walletConfig); + Wallet = new UserWallet(nonBouceableAddress, updatedConfig); - OnNativeWalletConnectionFinished?.Invoke(walletConfig); + OnNativeWalletConnectionFinished?.Invoke(updatedConfig); } private void OnWalletConnectionFail(string errorMessage) @@ -1064,6 +1064,8 @@ private void OnNativeWalletDisconnect(bool isSuccess) { _isWalletConnected = false; + Wallet = new UserWallet(null, null); + OnNativeWalletDisconnected?.Invoke(isSuccess); } diff --git a/Uniton Connect/Samples/Prefabs/Base_WalletContainer.prefab b/Uniton Connect/Samples/Prefabs/Base_WalletContainer.prefab deleted file mode 100644 index f429d08..0000000 --- a/Uniton Connect/Samples/Prefabs/Base_WalletContainer.prefab +++ /dev/null @@ -1,275 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &235718961431420381 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7477437717502725281} - - component: {fileID: 990525174844384889} - - component: {fileID: 5560535011153534625} - m_Layer: 5 - m_Name: Name - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &7477437717502725281 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 235718961431420381} - 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: 6550509947240603746} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: -0.32000732, y: -66.695} - m_SizeDelta: {x: 99.34, y: 58.51} - m_Pivot: {x: 0.5, y: 0} ---- !u!222 &990525174844384889 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 235718961431420381} - m_CullTransparentMesh: 1 ---- !u!114 &5560535011153534625 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 235718961431420381} - 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: 0 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: Name - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, 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: 30 - m_fontSizeBase: 30 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 2 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - 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 &8874931049203746563 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6550509947240603746} - - component: {fileID: 7874476113791022906} - - component: {fileID: 1769072268161024473} - - component: {fileID: 1062143157236809048} - - component: {fileID: 8589778159642721567} - m_Layer: 5 - m_Name: Base_WalletContainer - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &6550509947240603746 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8874931049203746563} - 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: 7477437717502725281} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &7874476113791022906 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8874931049203746563} - m_CullTransparentMesh: 1 ---- !u!114 &1769072268161024473 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8874931049203746563} - 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: 0} - 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 &1062143157236809048 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8874931049203746563} - 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: 1 - 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: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 1769072268161024473} - m_OnClick: - m_PersistentCalls: - m_Calls: [] ---- !u!114 &8589778159642721567 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8874931049203746563} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 20f144a939c92f449b596229b458377c, type: 3} - m_Name: - m_EditorClassIdentifier: - _header: {fileID: 5560535011153534625} - _icon: {fileID: 1769072268161024473} - _connectButton: {fileID: 1062143157236809048} diff --git a/Uniton Connect/Samples/Scenes/UsageExample.unity b/Uniton Connect/Samples/Scenes/UsageExample.unity index 340ca40..1689c04 100644 --- a/Uniton Connect/Samples/Scenes/UsageExample.unity +++ b/Uniton Connect/Samples/Scenes/UsageExample.unity @@ -422,7 +422,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: @@ -728,6 +728,140 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: -20, y: -20} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &165741302 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 165741303} + - component: {fileID: 165741305} + - component: {fileID: 165741304} + m_Layer: 5 + m_Name: VersionDisplayBar + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &165741303 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 165741302} + 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: 219431314} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: -17.659973, y: 12.409973} + m_SizeDelta: {x: 306.45, y: 53.55} + m_Pivot: {x: 1, y: 0} +--- !u!114 &165741304 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 165741302} + 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: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: v. 0.2.9.6 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, 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: 50 + m_fontSizeBase: 50 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 4 + m_VerticalAlignment: 1024 + m_textAlignment: 65535 + m_characterSpacing: 0 + 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!222 &165741305 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 165741302} + m_CullTransparentMesh: 1 --- !u!1 &219431310 GameObject: m_ObjectHideFlags: 0 @@ -829,6 +963,7 @@ RectTransform: - {fileID: 1544404035} - {fileID: 2058162190} - {fileID: 1482803313} + - {fileID: 165741303} - {fileID: 569411083} - {fileID: 1422879011} - {fileID: 805753948} @@ -1493,7 +1628,7 @@ GameObject: - component: {fileID: 515026108} - component: {fileID: 515026109} m_Layer: 0 - m_Name: TestUIAdapter + m_Name: UIController m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1534,7 +1669,6 @@ MonoBehaviour: _sendTransactionButton: {fileID: 2132820827} _openNftCollectionButton: {fileID: 1544404037} _nftCollectionPanel: {fileID: 1422879015} - _loadWalletsAnimation: {fileID: 0} --- !u!1 &517745557 GameObject: m_ObjectHideFlags: 0 @@ -2310,7 +2444,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: @@ -4186,8 +4320,8 @@ 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: -1.3500977, y: 28.660156} - m_SizeDelta: {x: 1009.08, y: 431} + m_AnchoredPosition: {x: 0, y: 86} + m_SizeDelta: {x: 1006.27, y: 377.32} m_Pivot: {x: 0.5, y: 0} --- !u!222 &1482803315 CanvasRenderer: @@ -4658,7 +4792,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: @@ -5493,7 +5627,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: @@ -5974,7 +6108,7 @@ Animator: m_Avatar: {fileID: 0} m_Controller: {fileID: 9100000, guid: 5a8c75f763af2004bb7c837275ee012f, type: 2} m_CullingMode: 0 - m_UpdateMode: 0 + m_UpdateMode: 2 m_ApplyRootMotion: 0 m_LinearVelocityBlending: 0 m_StabilizeFeet: 0 diff --git a/Uniton Connect/Samples/Scripts/Buttons/Variants/Close/TestCloseChooseWalletButton.cs b/Uniton Connect/Samples/Scripts/Buttons/Variants/Close/TestCloseChooseWalletButton.cs deleted file mode 100644 index 928cef0..0000000 --- a/Uniton Connect/Samples/Scripts/Buttons/Variants/Close/TestCloseChooseWalletButton.cs +++ /dev/null @@ -1,18 +0,0 @@ -using UnityEngine; -using UnitonConnect.Core.Demo; - -namespace UnitonConnect.Core.Data -{ - public sealed class TestCloseChooseWalletButton : TestBaseButton - { - [SerializeField, Space] private TestWalletInterfaceAdapter _interfaceAdapter; - [SerializeField, Space] private TestChooseWalletPanel _panel; - - public sealed override void OnClick() - { - _interfaceAdapter.UnitonSDK.PauseConnection(); - - _panel.Close(); - } - } -} diff --git a/Uniton Connect/Samples/Scripts/Buttons/Variants/Close/TestCloseSelectedWalletButton.cs b/Uniton Connect/Samples/Scripts/Buttons/Variants/Close/TestCloseSelectedWalletButton.cs deleted file mode 100644 index 9bebc16..0000000 --- a/Uniton Connect/Samples/Scripts/Buttons/Variants/Close/TestCloseSelectedWalletButton.cs +++ /dev/null @@ -1,18 +0,0 @@ -using UnityEngine; -using UnitonConnect.Core.Demo; - -namespace UnitonConnect.Core.Data -{ - public sealed class TestCloseSelectedWalletButton : TestBaseButton - { - [SerializeField, Space] private TestWalletInterfaceAdapter _interfaceAdapter; - [SerializeField, Space] private TestSelectedWalletConnectionPanel _panel; - - public sealed override void OnClick() - { - _interfaceAdapter.UnitonSDK.PauseConnection(); - - _panel.Close(); - } - } -} \ No newline at end of file diff --git a/Uniton Connect/Samples/Scripts/Buttons/Variants/Open/TestOpenDeepLinkWalletConnectionButton.cs b/Uniton Connect/Samples/Scripts/Buttons/Variants/Open/TestOpenDeepLinkWalletConnectionButton.cs deleted file mode 100644 index 491b418..0000000 --- a/Uniton Connect/Samples/Scripts/Buttons/Variants/Open/TestOpenDeepLinkWalletConnectionButton.cs +++ /dev/null @@ -1,9 +0,0 @@ -using UnitonConnect.Core.Demo; - -namespace UnitonConnect.Core.Data -{ - public sealed class TestOpenDeepLinkWalletConnectionButton : TestBaseButton - { - public sealed override void OnClick() { } - } -} \ No newline at end of file diff --git a/Uniton Connect/Samples/Scripts/Buttons/Variants/Open/TestOpenChooseWalletPanelButton.cs b/Uniton Connect/Samples/Scripts/Buttons/Variants/Open/TestOpenModalConnectionWindowButton.cs similarity index 79% rename from Uniton Connect/Samples/Scripts/Buttons/Variants/Open/TestOpenChooseWalletPanelButton.cs rename to Uniton Connect/Samples/Scripts/Buttons/Variants/Open/TestOpenModalConnectionWindowButton.cs index b75e50c..83f30b8 100644 --- a/Uniton Connect/Samples/Scripts/Buttons/Variants/Open/TestOpenChooseWalletPanelButton.cs +++ b/Uniton Connect/Samples/Scripts/Buttons/Variants/Open/TestOpenModalConnectionWindowButton.cs @@ -3,7 +3,7 @@ namespace UnitonConnect.Core.Data { - public sealed class TestOpenChooseWalletPanelButton : TestBaseButton + public sealed class TestOpenModalConnectionWindowButton : TestBaseButton { [SerializeField, Space] private TestWalletInterfaceAdapter _interfaceAdapter; diff --git a/Uniton Connect/Samples/Scripts/Buttons/Variants/TestDisconnectButton.cs b/Uniton Connect/Samples/Scripts/Buttons/Variants/TestDisconnectButton.cs index b66ee01..6d824f9 100644 --- a/Uniton Connect/Samples/Scripts/Buttons/Variants/TestDisconnectButton.cs +++ b/Uniton Connect/Samples/Scripts/Buttons/Variants/TestDisconnectButton.cs @@ -1,6 +1,5 @@ using UnityEngine; using UnitonConnect.Core.Demo; -using UnitonConnect.Core.Utils.Debugging; namespace UnitonConnect.Core.Data { @@ -10,11 +9,11 @@ public sealed class TestDisconnectButton : TestBaseButton public sealed override void OnClick() { - UnitonConnectLogger.Log("The disconnecting process of the previously connected wallet has been started"); + Debug.Log("The disconnecting process of the previously connected wallet has been started"); _interfaceAdapter.UnitonSDK.Disconnect(); - UnitonConnectLogger.Log("Success disconnect"); + Debug.Log("Success disconnect"); } } diff --git a/Uniton Connect/Samples/Scripts/Panels/Variants/TestChooseWalletPanel.cs b/Uniton Connect/Samples/Scripts/Panels/Variants/TestChooseWalletPanel.cs deleted file mode 100644 index 553ce74..0000000 --- a/Uniton Connect/Samples/Scripts/Panels/Variants/TestChooseWalletPanel.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace UnitonConnect.Core.Demo -{ - public sealed class TestChooseWalletPanel : TestBasePanel { } -} \ No newline at end of file diff --git a/Uniton Connect/Samples/Scripts/Panels/Variants/TestSelectedWalletConnectionPanel.cs b/Uniton Connect/Samples/Scripts/Panels/Variants/TestSelectedWalletConnectionPanel.cs deleted file mode 100644 index 8ef7895..0000000 --- a/Uniton Connect/Samples/Scripts/Panels/Variants/TestSelectedWalletConnectionPanel.cs +++ /dev/null @@ -1,87 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; -using TonSdk.Connect; -using UnitonConnect.Core.Data; -using UnitonConnect.Core.Utils; -using UnitonConnect.Core.Utils.View; -using UnitonConnect.Core.Utils.Debugging; - -namespace UnitonConnect.Core.Demo -{ - public sealed class TestSelectedWalletConnectionPanel : TestBasePanel - { - [SerializeField, Space] private TestWalletInterfaceAdapter _userInterfaceAdapter; - [SerializeField, Space] private RawImage _qrCodeImage; - [SerializeField, Space] private TestOpenDeepLinkWalletConnectionButton _deepLinkButton; - - private Texture2D _qrCodeForConnect; - - private WalletConfig _currentConfig; - - private string _connectionUrl; - - private UnitonConnectSDK _unitonConnect => _userInterfaceAdapter.UnitonSDK; - - private void OnEnable() - { - _unitonConnect.OnWalletConnectionFinished += WalletConnectionFinished; - } - - private void OnDisable() - { - _unitonConnect.OnWalletConnectionFinished -= WalletConnectionFinished; - - _deepLinkButton.RemoveListeners(); - } - - private async void LoadConnectWalletContent() - { - _connectionUrl = await _unitonConnect.GenerateConnectURL(_currentConfig); - - UnitonConnectLogger.Log($"Generated connect link {_connectionUrl} " + - $"for wallet: {_currentConfig.Name}"); - - _qrCodeForConnect = WalletVisualUtils.GetQRCodeFromUrl(_connectionUrl); - - _deepLinkButton.SetListener(Connect); - - _qrCodeImage.texture = _qrCodeForConnect; - } - - private void WalletConnectionFinished(Wallet wallet) - { - Close(); - } - - public async void SetOptions(WalletConfig connectionConfig) - { - _currentConfig = connectionConfig; - - if (_unitonConnect.IsWalletConnected) - { - Debug.LogWarning($"The wallet named {connectionConfig.Name} is already connected," + - $" the process of disconnecting it from the session begins"); - - await _unitonConnect.DisconnectWallet(); - - return; - } - - LoadConnectWalletContent(); - } - - private async void Connect() - { - if (WalletConnectUtils.HasHttpBridge(_currentConfig)) - { - _unitonConnect.ConnectHttpBridgeWalletViaDeepLink( - _currentConfig, _connectionUrl); - } - else if (WalletConnectUtils.HasJSBridge(_currentConfig) && - _unitonConnect.IsUseWebWallets) - { - await _unitonConnect.ConnectJavaScriptBridgeWalletViaDeeplink(_currentConfig); - } - } - } -} \ No newline at end of file diff --git a/Uniton Connect/Samples/Scripts/Panels/Variants/TestWalletNftCollectionsPanel.cs b/Uniton Connect/Samples/Scripts/Panels/Variants/TestWalletNftCollectionsPanel.cs index c0b203c..2e0c759 100644 --- a/Uniton Connect/Samples/Scripts/Panels/Variants/TestWalletNftCollectionsPanel.cs +++ b/Uniton Connect/Samples/Scripts/Panels/Variants/TestWalletNftCollectionsPanel.cs @@ -5,7 +5,6 @@ using UnitonConnect.Core.Data; using UnitonConnect.Core.Utils; using UnitonConnect.Core.Utils.View; -using UnitonConnect.Core.Utils.Debugging; using UnitonConnect.Runtime.Data; using UnitonConnect.DeFi; @@ -104,7 +103,7 @@ private async Task> CreateNftViewContainer(NftCollectionData c { var iconUrl = nft.Get500x500ResolutionWebp(); - UnitonConnectLogger.Log($"Claimed icon by urL: {iconUrl}"); + Debug.Log($"Claimed icon by urL: {iconUrl}"); var nftIcon = await WalletVisualUtils.GetIconFromProxyServerAsync(iconUrl); var nftName = nft.Metadata.ItemName; @@ -117,7 +116,7 @@ private async Task> CreateNftViewContainer(NftCollectionData c nftVisual.Add(newNftView); - UnitonConnectLogger.Log($"Created NFT View with name: {nftName}"); + Debug.Log($"Created NFT View with name: {nftName}"); } return nftVisual; diff --git a/Uniton Connect/Samples/Scripts/TestWalletInterfaceAdapter.cs b/Uniton Connect/Samples/Scripts/TestWalletInterfaceAdapter.cs index 4c21078..d71a361 100644 --- a/Uniton Connect/Samples/Scripts/TestWalletInterfaceAdapter.cs +++ b/Uniton Connect/Samples/Scripts/TestWalletInterfaceAdapter.cs @@ -19,7 +19,6 @@ public sealed class TestWalletInterfaceAdapter : MonoBehaviour [SerializeField] private Button _sendTransactionButton; [SerializeField] private Button _openNftCollectionButton; [SerializeField, Space] private TestWalletNftCollectionsPanel _nftCollectionPanel; - [SerializeField, Space] private GameObject _loadWalletsAnimation; private string _latestTransactionHash; diff --git a/Uniton Connect/Samples/Scripts/Visual/TestWalletView.cs b/Uniton Connect/Samples/Scripts/Visual/TestWalletView.cs deleted file mode 100644 index 00cd30b..0000000 --- a/Uniton Connect/Samples/Scripts/Visual/TestWalletView.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; -using TMPro; -using TonSdk.Connect; -using UnitonConnect.Core.Utils.View; -using UnitonConnect.Core.Data.Common; -using UnitonConnect.Core.Utils; - -namespace UnitonConnect.Core.Demo -{ - public sealed class TestWalletView : MonoBehaviour - { - - } -} \ No newline at end of file diff --git a/WebGLTemplates.meta b/WebGLTemplates.meta deleted file mode 100644 index c174428..0000000 --- a/WebGLTemplates.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cfb031131db87ee408b14bb7ef61d4ec -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/WebGLTemplates/Uniton/index.html b/WebGLTemplates/Uniton/index.html index 766c6c2..cd0663a 100644 --- a/WebGLTemplates/Uniton/index.html +++ b/WebGLTemplates/Uniton/index.html @@ -3,7 +3,7 @@ - Unity WebGL Player | {{{ PRODUCT_NAME }}} + {{{ PRODUCT_NAME }}} diff --git a/WebGLTemplates/Uniton/index.js b/WebGLTemplates/Uniton/index.js index a45a539..74f4e06 100644 --- a/WebGLTemplates/Uniton/index.js +++ b/WebGLTemplates/Uniton/index.js @@ -124,7 +124,7 @@ window.addEventListener("load", function () Telegram.WebApp.ready(); Telegram.WebApp.expand(); - console.log("Telegram web app has been expanded to full screen"); + console.log("Telegram Web App has been expanded to full screen"); var version = Telegram.WebApp.version; var versionFloat = parseFloat(version);