Skip to content

Commit e939167

Browse files
authored
Merge pull request #333 from immutable/feat/update-zkevm-api-2024-10-28-10-05-21
feat: update immutable zkEVM API package
2 parents f1c92aa + 60948a5 commit e939167

17 files changed

+1066
-1
lines changed

src/Packages/ZkEvmApi/Documentation~/ChainWithDetails.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Name | Type | Description | Notes
77
**Id** | **string** | The id of chain |
88
**Name** | **string** | The name of chain |
99
**RpcUrl** | **string** | URL for RPC node |
10+
**OperatorAllowlistAddress** | **string** | The address of the Operator Allowlist - https://docs.immutable.com/products/zkevm/minting/royalties/allowlist-spec/ |
11+
**MinterAddress** | **string** | The address of the minter used in the Minting API - https://docs.immutable.com/products/zkEVM/minting/minting-api#minting-api-prerequisites |
1012

1113
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1214

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Immutable.Api.ZkEvm.Model.Filter
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**Name** | **string** | Name of trait |
8+
**Values** | [**List<FilterValue>**](FilterValue.md) | List of 100 most common values for this trait sorted by number of associated NFTs |
9+
**OmittedValuesCount** | **int** | Indicated how many more distinct values exist |
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Immutable.Api.ZkEvm.Model.FilterResult
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**Chain** | [**Chain**](Chain.md) | |
8+
**ContractAddress** | **string** | ETH Address of collection that the asset belongs to |
9+
**Filters** | [**List<Filter>**](Filter.md) | List of all filters and the most common values |
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Immutable.Api.ZkEvm.Model.FilterValue
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**Value** | **string** | |
8+
**NftCount** | **string** | Number of NFTs that have this trait. Uint256 as string |
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Immutable.Api.ZkEvm.Model.ListFiltersResult
2+
List filters result
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**Result** | [**FilterResult**](FilterResult.md) | |
9+
**Page** | [**Page**](Page.md) | |
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+

src/Packages/ZkEvmApi/Documentation~/StacksApi.md

+100
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,110 @@ All URIs are relative to *https://api.sandbox.immutable.com*
44

55
| Method | HTTP request | Description |
66
|--------|--------------|-------------|
7+
| [**ListFilters**](StacksApi.md#listfilters) | **GET** /experimental/chains/{chain_name}/search/filters/{contract_address} | Experimental: Get list of metadata attribute filters |
78
| [**ListStacks**](StacksApi.md#liststacks) | **GET** /experimental/chains/{chain_name}/stacks | Experimental: List NFT stacks by stack_id |
89
| [**SearchNFTs**](StacksApi.md#searchnfts) | **GET** /experimental/chains/{chain_name}/search/nfts | Experimental: Search NFTs |
910
| [**SearchStacks**](StacksApi.md#searchstacks) | **GET** /experimental/chains/{chain_name}/search/stacks | Experimental: Search NFT stacks |
1011

12+
<a id="listfilters"></a>
13+
# **ListFilters**
14+
> ListFiltersResult ListFilters (string chainName, string contractAddress)
15+
16+
Experimental: Get list of metadata attribute filters
17+
18+
![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
19+
20+
### Example
21+
```csharp
22+
using System.Collections.Generic;
23+
using System.Diagnostics;
24+
using Immutable.Api.ZkEvm.Api;
25+
using Immutable.Api.ZkEvm.Client;
26+
using Immutable.Api.ZkEvm.Model;
27+
28+
namespace Example
29+
{
30+
public class ListFiltersExample
31+
{
32+
public static void Main()
33+
{
34+
Configuration config = new Configuration();
35+
config.BasePath = "https://api.sandbox.immutable.com";
36+
var apiInstance = new StacksApi(config);
37+
var chainName = imtbl-zkevm-testnet; // string | The name of chain
38+
var contractAddress = 0xe9b00a87700f660e46b6f5deaa1232836bcc07d3; // string | Contract addresses for collection
39+
40+
try
41+
{
42+
// Experimental: Get list of metadata attribute filters
43+
ListFiltersResult result = apiInstance.ListFilters(chainName, contractAddress);
44+
Debug.WriteLine(result);
45+
}
46+
catch (ApiException e)
47+
{
48+
Debug.Print("Exception when calling StacksApi.ListFilters: " + e.Message);
49+
Debug.Print("Status Code: " + e.ErrorCode);
50+
Debug.Print(e.StackTrace);
51+
}
52+
}
53+
}
54+
}
55+
```
56+
57+
#### Using the ListFiltersWithHttpInfo variant
58+
This returns an ApiResponse object which contains the response data, status code and headers.
59+
60+
```csharp
61+
try
62+
{
63+
// Experimental: Get list of metadata attribute filters
64+
ApiResponse<ListFiltersResult> response = apiInstance.ListFiltersWithHttpInfo(chainName, contractAddress);
65+
Debug.Write("Status Code: " + response.StatusCode);
66+
Debug.Write("Response Headers: " + response.Headers);
67+
Debug.Write("Response Body: " + response.Data);
68+
}
69+
catch (ApiException e)
70+
{
71+
Debug.Print("Exception when calling StacksApi.ListFiltersWithHttpInfo: " + e.Message);
72+
Debug.Print("Status Code: " + e.ErrorCode);
73+
Debug.Print(e.StackTrace);
74+
}
75+
```
76+
77+
### Parameters
78+
79+
| Name | Type | Description | Notes |
80+
|------|------|-------------|-------|
81+
| **chainName** | **string** | The name of chain | |
82+
| **contractAddress** | **string** | Contract addresses for collection | |
83+
84+
### Return type
85+
86+
[**ListFiltersResult**](ListFiltersResult.md)
87+
88+
### Authorization
89+
90+
No authorization required
91+
92+
### HTTP request headers
93+
94+
- **Content-Type**: Not defined
95+
- **Accept**: application/json
96+
97+
98+
### HTTP response details
99+
| Status code | Description | Response headers |
100+
|-------------|-------------|------------------|
101+
| **200** | 200 response | - |
102+
| **400** | Bad Request (400) | - |
103+
| **401** | Unauthorised Request (401) | - |
104+
| **403** | Forbidden Request (403) | - |
105+
| **404** | The specified resource was not found (404) | - |
106+
| **429** | Too Many Requests (429) | * Retry-After - <br> |
107+
| **500** | Internal Server Error (500) | - |
108+
109+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
110+
11111
<a id="liststacks"></a>
12112
# **ListStacks**
13113
> List&lt;StackBundle&gt; ListStacks (string chainName, List<Guid> stackId)

src/Packages/ZkEvmApi/Runtime/Api/StacksApi.cs

+188
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,29 @@ public interface IStacksApiSync : IApiAccessor
2828
{
2929
#region Synchronous Operations
3030
/// <summary>
31+
/// Experimental: Get list of metadata attribute filters
32+
/// </summary>
33+
/// <remarks>
34+
/// ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
35+
/// </remarks>
36+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
37+
/// <param name="chainName">The name of chain</param>
38+
/// <param name="contractAddress">Contract addresses for collection</param>
39+
/// <returns>ListFiltersResult</returns>
40+
ListFiltersResult ListFilters(string chainName, string contractAddress);
41+
42+
/// <summary>
43+
/// Experimental: Get list of metadata attribute filters
44+
/// </summary>
45+
/// <remarks>
46+
/// ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
47+
/// </remarks>
48+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
49+
/// <param name="chainName">The name of chain</param>
50+
/// <param name="contractAddress">Contract addresses for collection</param>
51+
/// <returns>ApiResponse of ListFiltersResult</returns>
52+
ApiResponse<ListFiltersResult> ListFiltersWithHttpInfo(string chainName, string contractAddress);
53+
/// <summary>
3154
/// Experimental: List NFT stacks by stack_id
3255
/// </summary>
3356
/// <remarks>
@@ -132,6 +155,31 @@ public interface IStacksApiAsync : IApiAccessor
132155
{
133156
#region Asynchronous Operations
134157
/// <summary>
158+
/// Experimental: Get list of metadata attribute filters
159+
/// </summary>
160+
/// <remarks>
161+
/// ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
162+
/// </remarks>
163+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
164+
/// <param name="chainName">The name of chain</param>
165+
/// <param name="contractAddress">Contract addresses for collection</param>
166+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
167+
/// <returns>Task of ListFiltersResult</returns>
168+
System.Threading.Tasks.Task<ListFiltersResult> ListFiltersAsync(string chainName, string contractAddress, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
169+
170+
/// <summary>
171+
/// Experimental: Get list of metadata attribute filters
172+
/// </summary>
173+
/// <remarks>
174+
/// ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
175+
/// </remarks>
176+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
177+
/// <param name="chainName">The name of chain</param>
178+
/// <param name="contractAddress">Contract addresses for collection</param>
179+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
180+
/// <returns>Task of ApiResponse (ListFiltersResult)</returns>
181+
System.Threading.Tasks.Task<ApiResponse<ListFiltersResult>> ListFiltersWithHttpInfoAsync(string chainName, string contractAddress, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
182+
/// <summary>
135183
/// Experimental: List NFT stacks by stack_id
136184
/// </summary>
137185
/// <remarks>
@@ -376,6 +424,146 @@ public Immutable.Api.ZkEvm.Client.ExceptionFactory ExceptionFactory
376424
set { _exceptionFactory = value; }
377425
}
378426

427+
/// <summary>
428+
/// Experimental: Get list of metadata attribute filters ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
429+
/// </summary>
430+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
431+
/// <param name="chainName">The name of chain</param>
432+
/// <param name="contractAddress">Contract addresses for collection</param>
433+
/// <returns>ListFiltersResult</returns>
434+
public ListFiltersResult ListFilters(string chainName, string contractAddress)
435+
{
436+
Immutable.Api.ZkEvm.Client.ApiResponse<ListFiltersResult> localVarResponse = ListFiltersWithHttpInfo(chainName, contractAddress);
437+
return localVarResponse.Data;
438+
}
439+
440+
/// <summary>
441+
/// Experimental: Get list of metadata attribute filters ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
442+
/// </summary>
443+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
444+
/// <param name="chainName">The name of chain</param>
445+
/// <param name="contractAddress">Contract addresses for collection</param>
446+
/// <returns>ApiResponse of ListFiltersResult</returns>
447+
public Immutable.Api.ZkEvm.Client.ApiResponse<ListFiltersResult> ListFiltersWithHttpInfo(string chainName, string contractAddress)
448+
{
449+
// verify the required parameter 'chainName' is set
450+
if (chainName == null)
451+
throw new Immutable.Api.ZkEvm.Client.ApiException(400, "Missing required parameter 'chainName' when calling StacksApi->ListFilters");
452+
453+
// verify the required parameter 'contractAddress' is set
454+
if (contractAddress == null)
455+
throw new Immutable.Api.ZkEvm.Client.ApiException(400, "Missing required parameter 'contractAddress' when calling StacksApi->ListFilters");
456+
457+
Immutable.Api.ZkEvm.Client.RequestOptions localVarRequestOptions = new Immutable.Api.ZkEvm.Client.RequestOptions();
458+
459+
string[] _contentTypes = new string[] {
460+
};
461+
462+
// to determine the Accept header
463+
string[] _accepts = new string[] {
464+
"application/json"
465+
};
466+
467+
var localVarContentType = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
468+
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
469+
470+
var localVarAccept = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderAccept(_accepts);
471+
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
472+
473+
localVarRequestOptions.PathParameters.Add("chain_name", Immutable.Api.ZkEvm.Client.ClientUtils.ParameterToString(chainName)); // path parameter
474+
localVarRequestOptions.PathParameters.Add("contract_address", Immutable.Api.ZkEvm.Client.ClientUtils.ParameterToString(contractAddress)); // path parameter
475+
476+
477+
// make the HTTP request
478+
var localVarResponse = this.Client.Get<ListFiltersResult>("/experimental/chains/{chain_name}/search/filters/{contract_address}", localVarRequestOptions, this.Configuration);
479+
480+
if (this.ExceptionFactory != null)
481+
{
482+
Exception _exception = this.ExceptionFactory("ListFilters", localVarResponse);
483+
if (_exception != null) throw _exception;
484+
}
485+
486+
return localVarResponse;
487+
}
488+
489+
/// <summary>
490+
/// Experimental: Get list of metadata attribute filters ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
491+
/// </summary>
492+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
493+
/// <param name="chainName">The name of chain</param>
494+
/// <param name="contractAddress">Contract addresses for collection</param>
495+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
496+
/// <returns>Task of ListFiltersResult</returns>
497+
public async System.Threading.Tasks.Task<ListFiltersResult> ListFiltersAsync(string chainName, string contractAddress, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
498+
{
499+
var task = ListFiltersWithHttpInfoAsync(chainName, contractAddress, cancellationToken);
500+
#if UNITY_EDITOR || !UNITY_WEBGL
501+
Immutable.Api.ZkEvm.Client.ApiResponse<ListFiltersResult> localVarResponse = await task.ConfigureAwait(false);
502+
#else
503+
Immutable.Api.ZkEvm.Client.ApiResponse<ListFiltersResult> localVarResponse = await task;
504+
#endif
505+
return localVarResponse.Data;
506+
}
507+
508+
/// <summary>
509+
/// Experimental: Get list of metadata attribute filters ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
510+
/// </summary>
511+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
512+
/// <param name="chainName">The name of chain</param>
513+
/// <param name="contractAddress">Contract addresses for collection</param>
514+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
515+
/// <returns>Task of ApiResponse (ListFiltersResult)</returns>
516+
public async System.Threading.Tasks.Task<Immutable.Api.ZkEvm.Client.ApiResponse<ListFiltersResult>> ListFiltersWithHttpInfoAsync(string chainName, string contractAddress, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
517+
{
518+
// verify the required parameter 'chainName' is set
519+
if (chainName == null)
520+
throw new Immutable.Api.ZkEvm.Client.ApiException(400, "Missing required parameter 'chainName' when calling StacksApi->ListFilters");
521+
522+
// verify the required parameter 'contractAddress' is set
523+
if (contractAddress == null)
524+
throw new Immutable.Api.ZkEvm.Client.ApiException(400, "Missing required parameter 'contractAddress' when calling StacksApi->ListFilters");
525+
526+
527+
Immutable.Api.ZkEvm.Client.RequestOptions localVarRequestOptions = new Immutable.Api.ZkEvm.Client.RequestOptions();
528+
529+
string[] _contentTypes = new string[] {
530+
};
531+
532+
// to determine the Accept header
533+
string[] _accepts = new string[] {
534+
"application/json"
535+
};
536+
537+
538+
var localVarContentType = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
539+
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
540+
541+
var localVarAccept = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderAccept(_accepts);
542+
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
543+
544+
localVarRequestOptions.PathParameters.Add("chain_name", Immutable.Api.ZkEvm.Client.ClientUtils.ParameterToString(chainName)); // path parameter
545+
localVarRequestOptions.PathParameters.Add("contract_address", Immutable.Api.ZkEvm.Client.ClientUtils.ParameterToString(contractAddress)); // path parameter
546+
547+
548+
// make the HTTP request
549+
550+
var task = this.AsynchronousClient.GetAsync<ListFiltersResult>("/experimental/chains/{chain_name}/search/filters/{contract_address}", localVarRequestOptions, this.Configuration, cancellationToken);
551+
552+
#if UNITY_EDITOR || !UNITY_WEBGL
553+
var localVarResponse = await task.ConfigureAwait(false);
554+
#else
555+
var localVarResponse = await task;
556+
#endif
557+
558+
if (this.ExceptionFactory != null)
559+
{
560+
Exception _exception = this.ExceptionFactory("ListFilters", localVarResponse);
561+
if (_exception != null) throw _exception;
562+
}
563+
564+
return localVarResponse;
565+
}
566+
379567
/// <summary>
380568
/// Experimental: List NFT stacks by stack_id ![Experimental](https://img.shields.io/badge/status-experimental-yellow) NFT stacks
381569
/// </summary>

0 commit comments

Comments
 (0)