Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update immutable zkEVM API package #332

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Packages/ZkEvmApi/Documentation~/Filter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Immutable.Api.ZkEvm.Model.Filter

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | Name of trait |
**Values** | [**List<FilterValue>**](FilterValue.md) | List of 100 most common values for this trait sorted by number of associated NFTs |
**OmittedValuesCount** | **int** | Indicated how many more distinct values exist |

[[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 changes: 12 additions & 0 deletions src/Packages/ZkEvmApi/Documentation~/FilterResult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Immutable.Api.ZkEvm.Model.FilterResult

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Chain** | [**Chain**](Chain.md) | |
**ContractAddress** | **string** | ETH Address of collection that the asset belongs to |
**Filters** | [**List<Filter>**](Filter.md) | List of all filters and the most common values |

[[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 changes: 11 additions & 0 deletions src/Packages/ZkEvmApi/Documentation~/FilterValue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Immutable.Api.ZkEvm.Model.FilterValue

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Value** | **string** | |
**NftCount** | **string** | Number of NFTs that have this trait. Uint256 as string |

[[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 changes: 12 additions & 0 deletions src/Packages/ZkEvmApi/Documentation~/ListFiltersResult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Immutable.Api.ZkEvm.Model.ListFiltersResult
List filters result

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Result** | [**FilterResult**](FilterResult.md) | |
**Page** | [**Page**](Page.md) | |

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

100 changes: 100 additions & 0 deletions src/Packages/ZkEvmApi/Documentation~/StacksApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,110 @@ All URIs are relative to *https://api.sandbox.immutable.com*

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

<a id="listfilters"></a>
# **ListFilters**
> ListFiltersResult ListFilters (string chainName, string contractAddress)

Experimental: Get list of metadata attribute filters

![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters

### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Immutable.Api.ZkEvm.Api;
using Immutable.Api.ZkEvm.Client;
using Immutable.Api.ZkEvm.Model;

namespace Example
{
public class ListFiltersExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.sandbox.immutable.com";
var apiInstance = new StacksApi(config);
var chainName = imtbl-zkevm-testnet; // string | The name of chain
var contractAddress = 0xe9b00a87700f660e46b6f5deaa1232836bcc07d3; // string | Contract addresses for collection

try
{
// Experimental: Get list of metadata attribute filters
ListFiltersResult result = apiInstance.ListFilters(chainName, contractAddress);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StacksApi.ListFilters: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```

#### Using the ListFiltersWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.

```csharp
try
{
// Experimental: Get list of metadata attribute filters
ApiResponse<ListFiltersResult> response = apiInstance.ListFiltersWithHttpInfo(chainName, contractAddress);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StacksApi.ListFiltersWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```

### Parameters

| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **chainName** | **string** | The name of chain | |
| **contractAddress** | **string** | Contract addresses for collection | |

### Return type

[**ListFiltersResult**](ListFiltersResult.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | 200 response | - |
| **400** | Bad Request (400) | - |
| **401** | Unauthorised Request (401) | - |
| **403** | Forbidden Request (403) | - |
| **404** | The specified resource was not found (404) | - |
| **429** | Too Many Requests (429) | * Retry-After - <br> |
| **500** | Internal Server Error (500) | - |

[[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)

<a id="liststacks"></a>
# **ListStacks**
> List&lt;StackBundle&gt; ListStacks (string chainName, List<Guid> stackId)
Expand Down
188 changes: 188 additions & 0 deletions src/Packages/ZkEvmApi/Runtime/Api/StacksApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@ public interface IStacksApiSync : IApiAccessor
{
#region Synchronous Operations
/// <summary>
/// Experimental: Get list of metadata attribute filters
/// </summary>
/// <remarks>
/// ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
/// </remarks>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="chainName">The name of chain</param>
/// <param name="contractAddress">Contract addresses for collection</param>
/// <returns>ListFiltersResult</returns>
ListFiltersResult ListFilters(string chainName, string contractAddress);

/// <summary>
/// Experimental: Get list of metadata attribute filters
/// </summary>
/// <remarks>
/// ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
/// </remarks>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="chainName">The name of chain</param>
/// <param name="contractAddress">Contract addresses for collection</param>
/// <returns>ApiResponse of ListFiltersResult</returns>
ApiResponse<ListFiltersResult> ListFiltersWithHttpInfo(string chainName, string contractAddress);
/// <summary>
/// Experimental: List NFT stacks by stack_id
/// </summary>
/// <remarks>
Expand Down Expand Up @@ -132,6 +155,31 @@ public interface IStacksApiAsync : IApiAccessor
{
#region Asynchronous Operations
/// <summary>
/// Experimental: Get list of metadata attribute filters
/// </summary>
/// <remarks>
/// ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
/// </remarks>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="chainName">The name of chain</param>
/// <param name="contractAddress">Contract addresses for collection</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ListFiltersResult</returns>
System.Threading.Tasks.Task<ListFiltersResult> ListFiltersAsync(string chainName, string contractAddress, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));

/// <summary>
/// Experimental: Get list of metadata attribute filters
/// </summary>
/// <remarks>
/// ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
/// </remarks>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="chainName">The name of chain</param>
/// <param name="contractAddress">Contract addresses for collection</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (ListFiltersResult)</returns>
System.Threading.Tasks.Task<ApiResponse<ListFiltersResult>> ListFiltersWithHttpInfoAsync(string chainName, string contractAddress, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
/// <summary>
/// Experimental: List NFT stacks by stack_id
/// </summary>
/// <remarks>
Expand Down Expand Up @@ -376,6 +424,146 @@ public Immutable.Api.ZkEvm.Client.ExceptionFactory ExceptionFactory
set { _exceptionFactory = value; }
}

/// <summary>
/// Experimental: Get list of metadata attribute filters ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
/// </summary>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="chainName">The name of chain</param>
/// <param name="contractAddress">Contract addresses for collection</param>
/// <returns>ListFiltersResult</returns>
public ListFiltersResult ListFilters(string chainName, string contractAddress)
{
Immutable.Api.ZkEvm.Client.ApiResponse<ListFiltersResult> localVarResponse = ListFiltersWithHttpInfo(chainName, contractAddress);
return localVarResponse.Data;
}

/// <summary>
/// Experimental: Get list of metadata attribute filters ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
/// </summary>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="chainName">The name of chain</param>
/// <param name="contractAddress">Contract addresses for collection</param>
/// <returns>ApiResponse of ListFiltersResult</returns>
public Immutable.Api.ZkEvm.Client.ApiResponse<ListFiltersResult> ListFiltersWithHttpInfo(string chainName, string contractAddress)
{
// verify the required parameter 'chainName' is set
if (chainName == null)
throw new Immutable.Api.ZkEvm.Client.ApiException(400, "Missing required parameter 'chainName' when calling StacksApi->ListFilters");

// verify the required parameter 'contractAddress' is set
if (contractAddress == null)
throw new Immutable.Api.ZkEvm.Client.ApiException(400, "Missing required parameter 'contractAddress' when calling StacksApi->ListFilters");

Immutable.Api.ZkEvm.Client.RequestOptions localVarRequestOptions = new Immutable.Api.ZkEvm.Client.RequestOptions();

string[] _contentTypes = new string[] {
};

// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};

var localVarContentType = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);

var localVarAccept = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);

localVarRequestOptions.PathParameters.Add("chain_name", Immutable.Api.ZkEvm.Client.ClientUtils.ParameterToString(chainName)); // path parameter
localVarRequestOptions.PathParameters.Add("contract_address", Immutable.Api.ZkEvm.Client.ClientUtils.ParameterToString(contractAddress)); // path parameter


// make the HTTP request
var localVarResponse = this.Client.Get<ListFiltersResult>("/experimental/chains/{chain_name}/search/filters/{contract_address}", localVarRequestOptions, this.Configuration);

if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("ListFilters", localVarResponse);
if (_exception != null) throw _exception;
}

return localVarResponse;
}

/// <summary>
/// Experimental: Get list of metadata attribute filters ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
/// </summary>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="chainName">The name of chain</param>
/// <param name="contractAddress">Contract addresses for collection</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ListFiltersResult</returns>
public async System.Threading.Tasks.Task<ListFiltersResult> ListFiltersAsync(string chainName, string contractAddress, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
var task = ListFiltersWithHttpInfoAsync(chainName, contractAddress, cancellationToken);
#if UNITY_EDITOR || !UNITY_WEBGL
Immutable.Api.ZkEvm.Client.ApiResponse<ListFiltersResult> localVarResponse = await task.ConfigureAwait(false);
#else
Immutable.Api.ZkEvm.Client.ApiResponse<ListFiltersResult> localVarResponse = await task;
#endif
return localVarResponse.Data;
}

/// <summary>
/// Experimental: Get list of metadata attribute filters ![Experimental](https://img.shields.io/badge/status-experimental-yellow) Get list of metadata filters
/// </summary>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="chainName">The name of chain</param>
/// <param name="contractAddress">Contract addresses for collection</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (ListFiltersResult)</returns>
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))
{
// verify the required parameter 'chainName' is set
if (chainName == null)
throw new Immutable.Api.ZkEvm.Client.ApiException(400, "Missing required parameter 'chainName' when calling StacksApi->ListFilters");

// verify the required parameter 'contractAddress' is set
if (contractAddress == null)
throw new Immutable.Api.ZkEvm.Client.ApiException(400, "Missing required parameter 'contractAddress' when calling StacksApi->ListFilters");


Immutable.Api.ZkEvm.Client.RequestOptions localVarRequestOptions = new Immutable.Api.ZkEvm.Client.RequestOptions();

string[] _contentTypes = new string[] {
};

// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};


var localVarContentType = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);

var localVarAccept = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);

localVarRequestOptions.PathParameters.Add("chain_name", Immutable.Api.ZkEvm.Client.ClientUtils.ParameterToString(chainName)); // path parameter
localVarRequestOptions.PathParameters.Add("contract_address", Immutable.Api.ZkEvm.Client.ClientUtils.ParameterToString(contractAddress)); // path parameter


// make the HTTP request

var task = this.AsynchronousClient.GetAsync<ListFiltersResult>("/experimental/chains/{chain_name}/search/filters/{contract_address}", localVarRequestOptions, this.Configuration, cancellationToken);

#if UNITY_EDITOR || !UNITY_WEBGL
var localVarResponse = await task.ConfigureAwait(false);
#else
var localVarResponse = await task;
#endif

if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("ListFilters", localVarResponse);
if (_exception != null) throw _exception;
}

return localVarResponse;
}

/// <summary>
/// Experimental: List NFT stacks by stack_id ![Experimental](https://img.shields.io/badge/status-experimental-yellow) NFT stacks
/// </summary>
Expand Down
Loading