Skip to content

Commit ab63f76

Browse files
committed
Update Web3Api.Core, Web3Api, SDK
1 parent 9cb25f7 commit ab63f76

34 files changed

+3117
-2761
lines changed

Assembly-CSharp-Editor.csproj

Lines changed: 207 additions & 204 deletions
Large diffs are not rendered by default.

Assembly-CSharp.Player.csproj

Lines changed: 182 additions & 182 deletions
Large diffs are not rendered by default.

Assembly-CSharp.csproj

Lines changed: 193 additions & 193 deletions
Large diffs are not rendered by default.

Assets/Scripts/Moralis/Moralis.Web3Api.Core/Interfaces/INativeApi.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public interface INativeApi
8888
/// </summary>
8989
/// <param name="address">address</param>
9090
/// <param name="topic">The topic of the event</param>
91+
/// <param name="abi">ABI of the specific event</param>
9192
/// <param name="chain">The chain to query</param>
9293
/// <param name="subdomain">The subdomain of the moralis server to use (Only use when selecting local devchain as chain)</param>
9394
/// <param name="providerUrl">web3 provider url to user when using local dev chain</param>
@@ -110,18 +111,19 @@ public interface INativeApi
110111
/// <param name="offset">offset</param>
111112
/// <param name="limit">limit</param>
112113
/// <returns>Returns a collection of events by topic</returns>
113-
List<LogEvent> GetContractEvents (string address, string topic, ChainList chain, string subdomain=null, string providerUrl=null, int? fromBlock=null, int? toBlock=null, string fromDate=null, string toDate=null, int? offset=null, int? limit=null);
114+
List<LogEvent> GetContractEvents (string address, string topic, object abi, ChainList chain, string subdomain=null, string providerUrl=null, int? fromBlock=null, int? toBlock=null, string fromDate=null, string toDate=null, int? offset=null, int? limit=null);
114115

115116
/// <summary>
116117
/// Runs a given function of a contract abi and returns readonly data
117118
/// </summary>
118119
/// <param name="address">address</param>
119120
/// <param name="functionName">function_name</param>
121+
/// <param name="abi">Body</param>
120122
/// <param name="chain">The chain to query</param>
121123
/// <param name="subdomain">The subdomain of the moralis server to use (Only use when selecting local devchain as chain)</param>
122124
/// <param name="providerUrl">web3 provider url to user when using local dev chain</param>
123125
/// <returns>Returns response of the function executed</returns>
124-
string RunContractFunction (string address, string functionName, ChainList chain, string subdomain=null, string providerUrl=null);
126+
string RunContractFunction (string address, string functionName, RunContractDto abi, ChainList chain, string subdomain=null, string providerUrl=null);
125127

126128
}
127129
}

Assets/Scripts/Moralis/Moralis.Web3Api.Core/Interfaces/IStorageApi.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ public interface IStorageApi
1414
/// Uploads multiple files and place them in a folder directory
1515
///
1616
/// </summary>
17-
Type UploadFolder ();
17+
/// <param name="abi">Array of JSON and Base64 Supported</param>
18+
/// <returns>Returns the path to the uploaded files</returns>
19+
List<IpfsFile> UploadFolder (List<IpfsFileRequest> abi);
1820

1921
}
2022
}

Assets/Scripts/Moralis/Moralis.Web3Api.Core/Models/ChainList.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public enum ChainList
2020
bsc = 0x38,
2121
bsc_testnet = 0x61,
2222
avalanche = 0xa86a,
23+
avalanche_testnet = 0xa869,
2324
fantom = 0xfa
2425
};
2526

Assets/Scripts/Moralis/Moralis.Web3Api.Core/Models/Erc20Price.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ namespace Moralis.Web3Api.Models
1111
public class Erc20Price
1212
{
1313
/// <summary>
14-
/// $ref: #/components/schemas/nativeErc20Price
1514
/// </summary>
1615
[DataMember(Name = "nativePrice", EmitDefaultValue = false)]
1716
[JsonProperty(PropertyName = "nativePrice")]
18-
public string NativePrice { get; set; }
17+
public NativeErc20Price NativePrice { get; set; }
1918

2019
/// <summary>
2120
/// format: double

Assets/Scripts/Moralis/Moralis.Web3Api/Api/AccountApi.cs

Lines changed: 61 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
1-
using System;
1+
/**
2+
* Module: AccountApi.cs
3+
* Description: Represents a collection of functions to interact with the API endpoints
4+
* Author: Moralis Web3 Technology AB, 559307-5988 - David B. Goodrich
5+
*
6+
* NOTE: THIS FILE HAS BEEN AUTOMATICALLY GENERATED. ANY CHANGES MADE TO THIS
7+
* FILE WILL BE LOST
8+
*
9+
* MIT License
10+
*
11+
* Copyright (c) 2021 Moralis Web3 Technology AB, 559307-5988
12+
*
13+
* Permission is hereby granted, free of charge, to any person obtaining a copy
14+
* of this software and associated documentation files (the 'Software'), to deal
15+
* in the Software without restriction, including without limitation the rights
16+
* to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
17+
* copies of the Software, and to permit persons to whom the Software is
18+
* furnished to do so, subject to the following conditions:
19+
*
20+
* The above copyright notice and this permission notice shall be included in all
21+
* copies or substantial portions of the Software.
22+
*
23+
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29+
* SOFTWARE.
30+
*/
31+
using System;
232
using System.Collections.Generic;
333
using RestSharp;
434
using Newtonsoft.Json;
@@ -91,7 +121,7 @@ public TransactionCollection GetTransactions (string address, ChainList chain, s
91121
{
92122

93123
// Verify the required parameter 'address' is set
94-
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetNFTs");
124+
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetTransactions");
95125

96126
var postBody = new Dictionary<String, String>();
97127
var queryParams = new Dictionary<String, String>();
@@ -104,10 +134,10 @@ public TransactionCollection GetTransactions (string address, ChainList chain, s
104134
path = path.Replace("{" + "address" + "}", ApiClient.ParameterToString(address));
105135
if(chain != null) queryParams.Add("chain", ApiClient.ParameterToString(chain));
106136
if(subdomain != null) queryParams.Add("subdomain", ApiClient.ParameterToString(subdomain));
107-
if(fromBlock != null) queryParams.Add("fromBlock", ApiClient.ParameterToString(fromBlock));
108-
if(toBlock != null) queryParams.Add("toBlock", ApiClient.ParameterToString(toBlock));
109-
if(fromDate != null) queryParams.Add("fromDate", ApiClient.ParameterToString(fromDate));
110-
if(toDate != null) queryParams.Add("toDate", ApiClient.ParameterToString(toDate));
137+
if(fromBlock != null) queryParams.Add("from_block", ApiClient.ParameterToString(fromBlock));
138+
if(toBlock != null) queryParams.Add("to_block", ApiClient.ParameterToString(toBlock));
139+
if(fromDate != null) queryParams.Add("from_date", ApiClient.ParameterToString(fromDate));
140+
if(toDate != null) queryParams.Add("to_date", ApiClient.ParameterToString(toDate));
111141
if(offset != null) queryParams.Add("offset", ApiClient.ParameterToString(offset));
112142
if(limit != null) queryParams.Add("limit", ApiClient.ParameterToString(limit));
113143

@@ -119,9 +149,9 @@ public TransactionCollection GetTransactions (string address, ChainList chain, s
119149
IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.GET, queryParams, bodyData, headerParams, formParams, fileParams, authSettings);
120150

121151
if (((int)response.StatusCode) >= 400)
122-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.Content, response.Content);
152+
throw new ApiException((int)response.StatusCode, "Error calling GetTransactions: " + response.Content, response.Content);
123153
else if (((int)response.StatusCode) == 0)
124-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.ErrorMessage, response.ErrorMessage);
154+
throw new ApiException((int)response.StatusCode, "Error calling GetTransactions: " + response.ErrorMessage, response.ErrorMessage);
125155

126156
return (TransactionCollection)ApiClient.Deserialize(response.Content, typeof(TransactionCollection), response.Headers);
127157
}
@@ -137,7 +167,7 @@ public NativeBalance GetNativeBalance (string address, ChainList chain, string p
137167
{
138168

139169
// Verify the required parameter 'address' is set
140-
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetNFTs");
170+
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetNativeBalance");
141171

142172
var postBody = new Dictionary<String, String>();
143173
var queryParams = new Dictionary<String, String>();
@@ -150,7 +180,7 @@ public NativeBalance GetNativeBalance (string address, ChainList chain, string p
150180
path = path.Replace("{" + "address" + "}", ApiClient.ParameterToString(address));
151181
if(chain != null) queryParams.Add("chain", ApiClient.ParameterToString(chain));
152182
if(providerUrl != null) queryParams.Add("providerUrl", ApiClient.ParameterToString(providerUrl));
153-
if(toBlock != null) queryParams.Add("toBlock", ApiClient.ParameterToString(toBlock));
183+
if(toBlock != null) queryParams.Add("to_block", ApiClient.ParameterToString(toBlock));
154184

155185
// Authentication setting, if any
156186
String[] authSettings = new String[] { "ApiKeyAuth" };
@@ -160,9 +190,9 @@ public NativeBalance GetNativeBalance (string address, ChainList chain, string p
160190
IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.GET, queryParams, bodyData, headerParams, formParams, fileParams, authSettings);
161191

162192
if (((int)response.StatusCode) >= 400)
163-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.Content, response.Content);
193+
throw new ApiException((int)response.StatusCode, "Error calling GetNativeBalance: " + response.Content, response.Content);
164194
else if (((int)response.StatusCode) == 0)
165-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.ErrorMessage, response.ErrorMessage);
195+
throw new ApiException((int)response.StatusCode, "Error calling GetNativeBalance: " + response.ErrorMessage, response.ErrorMessage);
166196

167197
return (NativeBalance)ApiClient.Deserialize(response.Content, typeof(NativeBalance), response.Headers);
168198
}
@@ -178,7 +208,7 @@ public List<Erc20TokenBalance> GetTokenBalances (string address, ChainList chain
178208
{
179209

180210
// Verify the required parameter 'address' is set
181-
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetNFTs");
211+
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetTokenBalances");
182212

183213
var postBody = new Dictionary<String, String>();
184214
var queryParams = new Dictionary<String, String>();
@@ -191,7 +221,7 @@ public List<Erc20TokenBalance> GetTokenBalances (string address, ChainList chain
191221
path = path.Replace("{" + "address" + "}", ApiClient.ParameterToString(address));
192222
if(chain != null) queryParams.Add("chain", ApiClient.ParameterToString(chain));
193223
if(subdomain != null) queryParams.Add("subdomain", ApiClient.ParameterToString(subdomain));
194-
if(toBlock != null) queryParams.Add("toBlock", ApiClient.ParameterToString(toBlock));
224+
if(toBlock != null) queryParams.Add("to_block", ApiClient.ParameterToString(toBlock));
195225

196226
// Authentication setting, if any
197227
String[] authSettings = new String[] { "ApiKeyAuth" };
@@ -201,9 +231,9 @@ public List<Erc20TokenBalance> GetTokenBalances (string address, ChainList chain
201231
IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.GET, queryParams, bodyData, headerParams, formParams, fileParams, authSettings);
202232

203233
if (((int)response.StatusCode) >= 400)
204-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.Content, response.Content);
234+
throw new ApiException((int)response.StatusCode, "Error calling GetTokenBalances: " + response.Content, response.Content);
205235
else if (((int)response.StatusCode) == 0)
206-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.ErrorMessage, response.ErrorMessage);
236+
throw new ApiException((int)response.StatusCode, "Error calling GetTokenBalances: " + response.ErrorMessage, response.ErrorMessage);
207237

208238
return (List<Erc20TokenBalance>)ApiClient.Deserialize(response.Content, typeof(List<Erc20TokenBalance>), response.Headers);
209239
}
@@ -236,7 +266,7 @@ public List<Erc20Transaction> GetTokenTransfers (string address, ChainList chain
236266
{
237267

238268
// Verify the required parameter 'address' is set
239-
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetNFTs");
269+
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetTokenTransfers");
240270

241271
var postBody = new Dictionary<String, String>();
242272
var queryParams = new Dictionary<String, String>();
@@ -249,10 +279,10 @@ public List<Erc20Transaction> GetTokenTransfers (string address, ChainList chain
249279
path = path.Replace("{" + "address" + "}", ApiClient.ParameterToString(address));
250280
if(chain != null) queryParams.Add("chain", ApiClient.ParameterToString(chain));
251281
if(subdomain != null) queryParams.Add("subdomain", ApiClient.ParameterToString(subdomain));
252-
if(fromBlock != null) queryParams.Add("fromBlock", ApiClient.ParameterToString(fromBlock));
253-
if(toBlock != null) queryParams.Add("toBlock", ApiClient.ParameterToString(toBlock));
254-
if(fromDate != null) queryParams.Add("fromDate", ApiClient.ParameterToString(fromDate));
255-
if(toDate != null) queryParams.Add("toDate", ApiClient.ParameterToString(toDate));
282+
if(fromBlock != null) queryParams.Add("from_block", ApiClient.ParameterToString(fromBlock));
283+
if(toBlock != null) queryParams.Add("to_block", ApiClient.ParameterToString(toBlock));
284+
if(fromDate != null) queryParams.Add("from_date", ApiClient.ParameterToString(fromDate));
285+
if(toDate != null) queryParams.Add("to_date", ApiClient.ParameterToString(toDate));
256286
if(offset != null) queryParams.Add("offset", ApiClient.ParameterToString(offset));
257287
if(limit != null) queryParams.Add("limit", ApiClient.ParameterToString(limit));
258288

@@ -264,9 +294,9 @@ public List<Erc20Transaction> GetTokenTransfers (string address, ChainList chain
264294
IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.GET, queryParams, bodyData, headerParams, formParams, fileParams, authSettings);
265295

266296
if (((int)response.StatusCode) >= 400)
267-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.Content, response.Content);
297+
throw new ApiException((int)response.StatusCode, "Error calling GetTokenTransfers: " + response.Content, response.Content);
268298
else if (((int)response.StatusCode) == 0)
269-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.ErrorMessage, response.ErrorMessage);
299+
throw new ApiException((int)response.StatusCode, "Error calling GetTokenTransfers: " + response.ErrorMessage, response.ErrorMessage);
270300

271301
return (List<Erc20Transaction>)ApiClient.Deserialize(response.Content, typeof(List<Erc20Transaction>), response.Headers);
272302
}
@@ -332,7 +362,7 @@ public NftTransferCollection GetNFTTransfers (string address, ChainList chain, s
332362
{
333363

334364
// Verify the required parameter 'address' is set
335-
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetNFTs");
365+
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetNFTTransfers");
336366

337367
var postBody = new Dictionary<String, String>();
338368
var queryParams = new Dictionary<String, String>();
@@ -357,9 +387,9 @@ public NftTransferCollection GetNFTTransfers (string address, ChainList chain, s
357387
IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.GET, queryParams, bodyData, headerParams, formParams, fileParams, authSettings);
358388

359389
if (((int)response.StatusCode) >= 400)
360-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.Content, response.Content);
390+
throw new ApiException((int)response.StatusCode, "Error calling GetNFTTransfers: " + response.Content, response.Content);
361391
else if (((int)response.StatusCode) == 0)
362-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.ErrorMessage, response.ErrorMessage);
392+
throw new ApiException((int)response.StatusCode, "Error calling GetNFTTransfers: " + response.ErrorMessage, response.ErrorMessage);
363393

364394
return (NftTransferCollection)ApiClient.Deserialize(response.Content, typeof(NftTransferCollection), response.Headers);
365395
}
@@ -381,10 +411,10 @@ public NftOwnerCollection GetNFTsForContract (string address, string tokenAddres
381411
{
382412

383413
// Verify the required parameter 'address' is set
384-
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetNFTs");
414+
if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetNFTsForContract");
385415

386416
// Verify the required parameter 'tokenAddress' is set
387-
if (tokenAddress == null) throw new ApiException(400, "Missing required parameter 'tokenAddress' when calling GetNFTs");
417+
if (tokenAddress == null) throw new ApiException(400, "Missing required parameter 'tokenAddress' when calling GetNFTsForContract");
388418

389419
var postBody = new Dictionary<String, String>();
390420
var queryParams = new Dictionary<String, String>();
@@ -394,7 +424,7 @@ public NftOwnerCollection GetNFTsForContract (string address, string tokenAddres
394424

395425
var path = "/{address}/nft/{token_address}";
396426
path = path.Replace("{format}", "json");
397-
path = path.Replace("{" + "address" + "}", ApiClient.ParameterToString(address)); path = path.Replace("{" + "tokenAddress" + "}", ApiClient.ParameterToString(tokenAddress));
427+
path = path.Replace("{" + "address" + "}", ApiClient.ParameterToString(address)); path = path.Replace("{" + "token_address" + "}", ApiClient.ParameterToString(tokenAddress));
398428
if(chain != null) queryParams.Add("chain", ApiClient.ParameterToString(chain));
399429
if(format != null) queryParams.Add("format", ApiClient.ParameterToString(format));
400430
if(offset != null) queryParams.Add("offset", ApiClient.ParameterToString(offset));
@@ -408,9 +438,9 @@ public NftOwnerCollection GetNFTsForContract (string address, string tokenAddres
408438
IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.GET, queryParams, bodyData, headerParams, formParams, fileParams, authSettings);
409439

410440
if (((int)response.StatusCode) >= 400)
411-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.Content, response.Content);
441+
throw new ApiException((int)response.StatusCode, "Error calling GetNFTsForContract: " + response.Content, response.Content);
412442
else if (((int)response.StatusCode) == 0)
413-
throw new ApiException((int)response.StatusCode, "Error calling GetNFTs: " + response.ErrorMessage, response.ErrorMessage);
443+
throw new ApiException((int)response.StatusCode, "Error calling GetNFTsForContract: " + response.ErrorMessage, response.ErrorMessage);
414444

415445
return (NftOwnerCollection)ApiClient.Deserialize(response.Content, typeof(NftOwnerCollection), response.Headers);
416446
}

0 commit comments

Comments
 (0)