WebGLGetGasPrice.cs 312 B

12345678910111213
  1. using UnityEngine;
  2. using Web3Unity.Scripts.Library.Ethers.Providers;
  3. #if UNITY_WEBGL
  4. public class WebGLGetGasPrice : MonoBehaviour
  5. {
  6. public async void GetGasPrice()
  7. {
  8. var provider = new JsonRpcProvider("YOUR_NODE");
  9. Debug.Log("Gas Price: " + await provider.GetGasPrice());
  10. }
  11. }
  12. #endif