chainsafe-test/Assets/Web3Unity/Scripts/Prefabs/WebGL/WebGLGetBlockNumber.cs
2023-11-28 11:36:18 +05:30

13 lines
324 B
C#

using UnityEngine;
using Web3Unity.Scripts.Library.Ethers.Providers;
#if UNITY_WEBGL
public class WebGLGetBlockNumber : MonoBehaviour
{
public async void GetBlockNumber()
{
var provider = new JsonRpcProvider("YOUR_NODE");
Debug.Log("Block Number: " + await provider.GetBlockNumber());
}
}
#endif