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 ;
232using System . Collections . Generic ;
333using RestSharp ;
434using 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