Skip to content

Commit

Permalink
Merge pull request #340 from immutable/feat/update-zkevm-api-2024-11-…
Browse files Browse the repository at this point in the history
…03-10-04-48

feat: update immutable zkEVM API package
  • Loading branch information
nattb8 authored Nov 3, 2024
2 parents bc67558 + 37ca624 commit daf0a1b
Show file tree
Hide file tree
Showing 8 changed files with 445 additions and 478 deletions.
100 changes: 100 additions & 0 deletions src/Packages/ZkEvmApi/Documentation~/MetadataApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All URIs are relative to *https://api.sandbox.immutable.com*
| [**GetMetadata**](MetadataApi.md#getmetadata) | **GET** /v1/chains/{chain_name}/collections/{contract_address}/metadata/{metadata_id} | Get metadata by ID |
| [**ListMetadata**](MetadataApi.md#listmetadata) | **GET** /v1/chains/{chain_name}/collections/{contract_address}/metadata | Get a list of metadata from the given contract |
| [**ListMetadataForChain**](MetadataApi.md#listmetadataforchain) | **GET** /v1/chains/{chain_name}/metadata | Get a list of metadata from the given chain |
| [**ListStacks**](MetadataApi.md#liststacks) | **GET** /v1/chains/{chain_name}/stacks | List NFT stack bundles by stack_id. Response will include Market, Listings & Stack Count information for each stack |
| [**RefreshMetadataByID**](MetadataApi.md#refreshmetadatabyid) | **POST** /v1/chains/{chain_name}/collections/{contract_address}/metadata/refresh-metadata | Refresh stacked metadata |
| [**RefreshNFTMetadataByTokenID**](MetadataApi.md#refreshnftmetadatabytokenid) | **POST** /v1/chains/{chain_name}/collections/{contract_address}/nfts/refresh-metadata | Refresh NFT metadata |

Expand Down Expand Up @@ -310,6 +311,105 @@ No authorization required

[[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)
List NFT stack bundles by stack_id. Response will include Market, Listings & Stack Count information for each stack

List NFT stack bundles by stack_id. This endpoint functions similarly to `ListMetadataByID` but extends the response to include Market, Listings & Stack Count information for each stack.

### 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 ListStacksExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.sandbox.immutable.com";
var apiInstance = new MetadataApi(config);
var chainName = imtbl-zkevm-testnet; // string | The name of chain
var stackId = new List<Guid>(); // List<Guid> | List of stack_id to filter by
try
{
// List NFT stack bundles by stack_id. Response will include Market, Listings & Stack Count information for each stack
List<StackBundle> result = apiInstance.ListStacks(chainName, stackId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling MetadataApi.ListStacks: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```

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

```csharp
try
{
// List NFT stack bundles by stack_id. Response will include Market, Listings & Stack Count information for each stack
ApiResponse<List<StackBundle>> response = apiInstance.ListStacksWithHttpInfo(chainName, stackId);
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 MetadataApi.ListStacksWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```

### Parameters

| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **chainName** | **string** | The name of chain | |
| **stackId** | [**List&lt;Guid&gt;**](Guid.md) | List of stack_id to filter by | |

### Return type

[**List&lt;StackBundle&gt;**](StackBundle.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="refreshmetadatabyid"></a>
# **RefreshMetadataByID**
> MetadataRefreshRateLimitResult RefreshMetadataByID (string chainName, string contractAddress, RefreshMetadataByIDRequest refreshMetadataByIDRequest)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# Immutable.Api.ZkEvm.Api.StacksApi
# Immutable.Api.ZkEvm.Api.MetadataSearchApi

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 |
| [**ListFilters**](MetadataSearchApi.md#listfilters) | **GET** /v1/chains/{chain_name}/search/filters/{contract_address} | Get list of metadata attribute filters |
| [**SearchNFTs**](MetadataSearchApi.md#searchnfts) | **GET** /v1/chains/{chain_name}/search/nfts | Search NFTs |
| [**SearchStacks**](MetadataSearchApi.md#searchstacks) | **GET** /v1/chains/{chain_name}/search/stacks | Search NFT stacks |

<a id="listfilters"></a>
# **ListFilters**
> ListFiltersResult ListFilters (string chainName, string contractAddress)
Experimental: Get list of metadata attribute filters
Get list of metadata attribute filters

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

### Example
```csharp
Expand All @@ -33,19 +32,19 @@ namespace Example
{
Configuration config = new Configuration();
config.BasePath = "https://api.sandbox.immutable.com";
var apiInstance = new StacksApi(config);
var apiInstance = new MetadataSearchApi(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
// 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("Exception when calling MetadataSearchApi.ListFilters: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand All @@ -60,15 +59,15 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
// Experimental: Get list of metadata attribute filters
// 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("Exception when calling MetadataSearchApi.ListFiltersWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand All @@ -95,105 +94,6 @@ No authorization required
- **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)
Experimental: List NFT stacks by stack_id

![Experimental](https://img.shields.io/badge/status-experimental-yellow) NFT stacks

### 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 ListStacksExample
{
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 stackId = new List<Guid>(); // List<Guid> | List of stack_id to filter by
try
{
// Experimental: List NFT stacks by stack_id
List<StackBundle> result = apiInstance.ListStacks(chainName, stackId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StacksApi.ListStacks: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```

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

```csharp
try
{
// Experimental: List NFT stacks by stack_id
ApiResponse<List<StackBundle>> response = apiInstance.ListStacksWithHttpInfo(chainName, stackId);
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.ListStacksWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```

### Parameters

| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **chainName** | **string** | The name of chain | |
| **stackId** | [**List&lt;Guid&gt;**](Guid.md) | List of stack_id to filter by | |

### Return type

[**List&lt;StackBundle&gt;**](StackBundle.md)

### Authorization

No authorization required

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
Expand All @@ -211,9 +111,9 @@ No authorization required
# **SearchNFTs**
> SearchNFTsResult SearchNFTs (string chainName, List<string> contractAddress, string? accountAddress = null, List<Guid>? stackId = null, bool? onlyIncludeOwnerListings = null, int? pageSize = null, string? pageCursor = null)
Experimental: Search NFTs
Search NFTs

![Experimental](https://img.shields.io/badge/status-experimental-yellow) Search NFTs
Search NFTs

### Example
```csharp
Expand All @@ -231,7 +131,7 @@ namespace Example
{
Configuration config = new Configuration();
config.BasePath = "https://api.sandbox.immutable.com";
var apiInstance = new StacksApi(config);
var apiInstance = new MetadataSearchApi(config);
var chainName = imtbl-zkevm-testnet; // string | The name of chain
var contractAddress = new List<string>(); // List<string> | List of contract addresses to filter by
var accountAddress = 0xe9b00a87700f660e46b6f5deaa1232836bcc07d3; // string? | Account address to filter by (optional)
Expand All @@ -242,13 +142,13 @@ namespace Example
try
{
// Experimental: Search NFTs
// Search NFTs
SearchNFTsResult result = apiInstance.SearchNFTs(chainName, contractAddress, accountAddress, stackId, onlyIncludeOwnerListings, pageSize, pageCursor);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StacksApi.SearchNFTs: " + e.Message);
Debug.Print("Exception when calling MetadataSearchApi.SearchNFTs: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand All @@ -263,15 +163,15 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
// Experimental: Search NFTs
// Search NFTs
ApiResponse<SearchNFTsResult> response = apiInstance.SearchNFTsWithHttpInfo(chainName, contractAddress, accountAddress, stackId, onlyIncludeOwnerListings, pageSize, pageCursor);
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.SearchNFTsWithHttpInfo: " + e.Message);
Debug.Print("Exception when calling MetadataSearchApi.SearchNFTsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand Down Expand Up @@ -320,9 +220,9 @@ No authorization required
# **SearchStacks**
> SearchStacksResult SearchStacks (string chainName, List<string> contractAddress, string? accountAddress = null, bool? onlyIncludeOwnerListings = null, bool? onlyIfHasActiveListings = null, string? traits = null, string? keyword = null, string? sortBy = null, int? pageSize = null, string? pageCursor = null)
Experimental: Search NFT stacks
Search NFT stacks

![Experimental](https://img.shields.io/badge/status-experimental-yellow) Search NFT stacks
Search NFT stacks

### Example
```csharp
Expand All @@ -340,7 +240,7 @@ namespace Example
{
Configuration config = new Configuration();
config.BasePath = "https://api.sandbox.immutable.com";
var apiInstance = new StacksApi(config);
var apiInstance = new MetadataSearchApi(config);
var chainName = imtbl-zkevm-testnet; // string | The name of chain
var contractAddress = new List<string>(); // List<string> | List of contract addresses to filter by
var accountAddress = 0xe9b00a87700f660e46b6f5deaa1232836bcc07d3; // string? | Account address to filter by (optional)
Expand All @@ -354,13 +254,13 @@ namespace Example
try
{
// Experimental: Search NFT stacks
// Search NFT stacks
SearchStacksResult result = apiInstance.SearchStacks(chainName, contractAddress, accountAddress, onlyIncludeOwnerListings, onlyIfHasActiveListings, traits, keyword, sortBy, pageSize, pageCursor);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StacksApi.SearchStacks: " + e.Message);
Debug.Print("Exception when calling MetadataSearchApi.SearchStacks: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand All @@ -375,15 +275,15 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
// Experimental: Search NFT stacks
// Search NFT stacks
ApiResponse<SearchStacksResult> response = apiInstance.SearchStacksWithHttpInfo(chainName, contractAddress, accountAddress, onlyIncludeOwnerListings, onlyIfHasActiveListings, traits, keyword, sortBy, pageSize, pageCursor);
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.SearchStacksWithHttpInfo: " + e.Message);
Debug.Print("Exception when calling MetadataSearchApi.SearchStacksWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand Down
Loading

0 comments on commit daf0a1b

Please sign in to comment.