Skip to content

Commit

Permalink
Merge pull request #30 from ChainSafe/rm-gas-tx
Browse files Browse the repository at this point in the history
rm gas limit and price
  • Loading branch information
leon-do authored Nov 4, 2021
2 parents 700a010 + f390591 commit a39f174
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 226 deletions.
45 changes: 0 additions & 45 deletions Web3Unity/Prefabs/EVM/GasLimit.prefab

This file was deleted.

7 changes: 0 additions & 7 deletions Web3Unity/Prefabs/EVM/GasLimit.prefab.meta

This file was deleted.

45 changes: 0 additions & 45 deletions Web3Unity/Prefabs/EVM/GasPrice.prefab

This file was deleted.

7 changes: 0 additions & 7 deletions Web3Unity/Prefabs/EVM/GasPrice.prefab.meta

This file was deleted.

67 changes: 0 additions & 67 deletions Web3Unity/Scripts/Library/EVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,73 +113,6 @@ public static async Task<string> Nonce(string _chain, string _network, string _a
return data.response;
}

public static async Task<string> GasPrice(string _chain, string _network, string _rpc = "")
{
WWWForm form = new WWWForm();
form.AddField("chain", _chain);
form.AddField("network", _network);
form.AddField("rpc", _rpc);
string url = host + "/gasPrice";
UnityWebRequest webRequest = UnityWebRequest.Post(url, form);
await webRequest.SendWebRequest();
StringResponse data = JsonUtility.FromJson<StringResponse>(System.Text.Encoding.UTF8.GetString(webRequest.downloadHandler.data));
return data.response;
}

public static async Task<string> GasLimit(string _chain, string _network, string _account, string _amount, string _transaction, string _rpc = "")
{
WWWForm form = new WWWForm();
form.AddField("chain", _chain);
form.AddField("network", _network);
form.AddField("rpc", _rpc);
string url = host + "/gasLimit";
UnityWebRequest webRequest = UnityWebRequest.Post(url, form);
await webRequest.SendWebRequest();
StringResponse data = JsonUtility.FromJson<StringResponse>(System.Text.Encoding.UTF8.GetString(webRequest.downloadHandler.data));
return data.response;
}

public static async Task<string> CreateTransaction(string _chain, string _network, string _networkId, string _account, string _to, string _value, string _data, string _gasPrice = "", string _gasLimit = "", string _rpc = "")
{
WWWForm form = new WWWForm();
form.AddField("chain", _chain);
form.AddField("network", _network);
form.AddField("networkId", _networkId);
form.AddField("account", _account);
form.AddField("to", _to);
form.AddField("value", _value);
form.AddField("data", _data);
form.AddField("gasPrice", _gasPrice);
form.AddField("gasLimit", _gasLimit);
form.AddField("rpc", _rpc);
string url = host + "/createTransaction";
UnityWebRequest webRequest = UnityWebRequest.Post(url, form);
await webRequest.SendWebRequest();
StringResponse data = JsonUtility.FromJson<StringResponse>(System.Text.Encoding.UTF8.GetString(webRequest.downloadHandler.data));
return data.response;
}

public static async Task<string> BroadcastTransaction(string _chain, string _network, string _networkId, string _account, string _to, string _value, string _data, string _signature, string _gasPrice, string _gasLimit, string _rpc)
{
WWWForm form = new WWWForm();
form.AddField("chain", _chain);
form.AddField("network", _network);
form.AddField("networkId", _networkId);
form.AddField("account", _account);
form.AddField("to", _to);
form.AddField("value", _value);
form.AddField("data", _data);
form.AddField("signature", _signature);
form.AddField("gasPrice", _gasPrice);
form.AddField("gasLimit", _gasLimit);
form.AddField("rpc", _rpc);
string url = host + "/broadcastTransaction";
UnityWebRequest webRequest = UnityWebRequest.Post(url, form);
await webRequest.SendWebRequest();
StringResponse data = JsonUtility.FromJson<StringResponse>(System.Text.Encoding.UTF8.GetString(webRequest.downloadHandler.data));
return data.response;
}

public static async Task<string> CreateContractData(string _abi, string _method, string _args)
{
WWWForm form = new WWWForm();
Expand Down
18 changes: 0 additions & 18 deletions Web3Unity/Scripts/Prefabs/EVM/GasLimitExample.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Web3Unity/Scripts/Prefabs/EVM/GasLimitExample.cs.meta

This file was deleted.

15 changes: 0 additions & 15 deletions Web3Unity/Scripts/Prefabs/EVM/GasPriceExample.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Web3Unity/Scripts/Prefabs/EVM/GasPriceExample.cs.meta

This file was deleted.

0 comments on commit a39f174

Please sign in to comment.