Skip to content

Commit daf0a1b

Browse files
authored
Merge pull request #340 from immutable/feat/update-zkevm-api-2024-11-03-10-04-48
feat: update immutable zkEVM API package
2 parents bc67558 + 37ca624 commit daf0a1b

File tree

8 files changed

+445
-478
lines changed

8 files changed

+445
-478
lines changed

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

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All URIs are relative to *https://api.sandbox.immutable.com*
77
| [**GetMetadata**](MetadataApi.md#getmetadata) | **GET** /v1/chains/{chain_name}/collections/{contract_address}/metadata/{metadata_id} | Get metadata by ID |
88
| [**ListMetadata**](MetadataApi.md#listmetadata) | **GET** /v1/chains/{chain_name}/collections/{contract_address}/metadata | Get a list of metadata from the given contract |
99
| [**ListMetadataForChain**](MetadataApi.md#listmetadataforchain) | **GET** /v1/chains/{chain_name}/metadata | Get a list of metadata from the given chain |
10+
| [**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 |
1011
| [**RefreshMetadataByID**](MetadataApi.md#refreshmetadatabyid) | **POST** /v1/chains/{chain_name}/collections/{contract_address}/metadata/refresh-metadata | Refresh stacked metadata |
1112
| [**RefreshNFTMetadataByTokenID**](MetadataApi.md#refreshnftmetadatabytokenid) | **POST** /v1/chains/{chain_name}/collections/{contract_address}/nfts/refresh-metadata | Refresh NFT metadata |
1213

@@ -310,6 +311,105 @@ No authorization required
310311

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

314+
<a id="liststacks"></a>
315+
# **ListStacks**
316+
> List&lt;StackBundle&gt; ListStacks (string chainName, List<Guid> stackId)
317+
318+
List NFT stack bundles by stack_id. Response will include Market, Listings & Stack Count information for each stack
319+
320+
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.
321+
322+
### Example
323+
```csharp
324+
using System.Collections.Generic;
325+
using System.Diagnostics;
326+
using Immutable.Api.ZkEvm.Api;
327+
using Immutable.Api.ZkEvm.Client;
328+
using Immutable.Api.ZkEvm.Model;
329+
330+
namespace Example
331+
{
332+
public class ListStacksExample
333+
{
334+
public static void Main()
335+
{
336+
Configuration config = new Configuration();
337+
config.BasePath = "https://api.sandbox.immutable.com";
338+
var apiInstance = new MetadataApi(config);
339+
var chainName = imtbl-zkevm-testnet; // string | The name of chain
340+
var stackId = new List<Guid>(); // List<Guid> | List of stack_id to filter by
341+
342+
try
343+
{
344+
// List NFT stack bundles by stack_id. Response will include Market, Listings & Stack Count information for each stack
345+
List<StackBundle> result = apiInstance.ListStacks(chainName, stackId);
346+
Debug.WriteLine(result);
347+
}
348+
catch (ApiException e)
349+
{
350+
Debug.Print("Exception when calling MetadataApi.ListStacks: " + e.Message);
351+
Debug.Print("Status Code: " + e.ErrorCode);
352+
Debug.Print(e.StackTrace);
353+
}
354+
}
355+
}
356+
}
357+
```
358+
359+
#### Using the ListStacksWithHttpInfo variant
360+
This returns an ApiResponse object which contains the response data, status code and headers.
361+
362+
```csharp
363+
try
364+
{
365+
// List NFT stack bundles by stack_id. Response will include Market, Listings & Stack Count information for each stack
366+
ApiResponse<List<StackBundle>> response = apiInstance.ListStacksWithHttpInfo(chainName, stackId);
367+
Debug.Write("Status Code: " + response.StatusCode);
368+
Debug.Write("Response Headers: " + response.Headers);
369+
Debug.Write("Response Body: " + response.Data);
370+
}
371+
catch (ApiException e)
372+
{
373+
Debug.Print("Exception when calling MetadataApi.ListStacksWithHttpInfo: " + e.Message);
374+
Debug.Print("Status Code: " + e.ErrorCode);
375+
Debug.Print(e.StackTrace);
376+
}
377+
```
378+
379+
### Parameters
380+
381+
| Name | Type | Description | Notes |
382+
|------|------|-------------|-------|
383+
| **chainName** | **string** | The name of chain | |
384+
| **stackId** | [**List&lt;Guid&gt;**](Guid.md) | List of stack_id to filter by | |
385+
386+
### Return type
387+
388+
[**List&lt;StackBundle&gt;**](StackBundle.md)
389+
390+
### Authorization
391+
392+
No authorization required
393+
394+
### HTTP request headers
395+
396+
- **Content-Type**: Not defined
397+
- **Accept**: application/json
398+
399+
400+
### HTTP response details
401+
| Status code | Description | Response headers |
402+
|-------------|-------------|------------------|
403+
| **200** | 200 response | - |
404+
| **400** | Bad Request (400) | - |
405+
| **401** | Unauthorised Request (401) | - |
406+
| **403** | Forbidden Request (403) | - |
407+
| **404** | The specified resource was not found (404) | - |
408+
| **429** | Too Many Requests (429) | * Retry-After - <br> |
409+
| **500** | Internal Server Error (500) | - |
410+
411+
[[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)
412+
313413
<a id="refreshmetadatabyid"></a>
314414
# **RefreshMetadataByID**
315415
> MetadataRefreshRateLimitResult RefreshMetadataByID (string chainName, string contractAddress, RefreshMetadataByIDRequest refreshMetadataByIDRequest)

src/Packages/ZkEvmApi/Documentation~/StacksApi.md renamed to src/Packages/ZkEvmApi/Documentation~/MetadataSearchApi.md

Lines changed: 25 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
# Immutable.Api.ZkEvm.Api.StacksApi
1+
# Immutable.Api.ZkEvm.Api.MetadataSearchApi
22

33
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 |
8-
| [**ListStacks**](StacksApi.md#liststacks) | **GET** /experimental/chains/{chain_name}/stacks | Experimental: List NFT stacks by stack_id |
9-
| [**SearchNFTs**](StacksApi.md#searchnfts) | **GET** /experimental/chains/{chain_name}/search/nfts | Experimental: Search NFTs |
10-
| [**SearchStacks**](StacksApi.md#searchstacks) | **GET** /experimental/chains/{chain_name}/search/stacks | Experimental: Search NFT stacks |
7+
| [**ListFilters**](MetadataSearchApi.md#listfilters) | **GET** /v1/chains/{chain_name}/search/filters/{contract_address} | Get list of metadata attribute filters |
8+
| [**SearchNFTs**](MetadataSearchApi.md#searchnfts) | **GET** /v1/chains/{chain_name}/search/nfts | Search NFTs |
9+
| [**SearchStacks**](MetadataSearchApi.md#searchstacks) | **GET** /v1/chains/{chain_name}/search/stacks | Search NFT stacks |
1110

1211
<a id="listfilters"></a>
1312
# **ListFilters**
1413
> ListFiltersResult ListFilters (string chainName, string contractAddress)
1514
16-
Experimental: Get list of metadata attribute filters
15+
Get list of metadata attribute filters
1716

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

2019
### Example
2120
```csharp
@@ -33,19 +32,19 @@ namespace Example
3332
{
3433
Configuration config = new Configuration();
3534
config.BasePath = "https://api.sandbox.immutable.com";
36-
var apiInstance = new StacksApi(config);
35+
var apiInstance = new MetadataSearchApi(config);
3736
var chainName = imtbl-zkevm-testnet; // string | The name of chain
3837
var contractAddress = 0xe9b00a87700f660e46b6f5deaa1232836bcc07d3; // string | Contract addresses for collection
3938
4039
try
4140
{
42-
// Experimental: Get list of metadata attribute filters
41+
// Get list of metadata attribute filters
4342
ListFiltersResult result = apiInstance.ListFilters(chainName, contractAddress);
4443
Debug.WriteLine(result);
4544
}
4645
catch (ApiException e)
4746
{
48-
Debug.Print("Exception when calling StacksApi.ListFilters: " + e.Message);
47+
Debug.Print("Exception when calling MetadataSearchApi.ListFilters: " + e.Message);
4948
Debug.Print("Status Code: " + e.ErrorCode);
5049
Debug.Print(e.StackTrace);
5150
}
@@ -60,15 +59,15 @@ This returns an ApiResponse object which contains the response data, status code
6059
```csharp
6160
try
6261
{
63-
// Experimental: Get list of metadata attribute filters
62+
// Get list of metadata attribute filters
6463
ApiResponse<ListFiltersResult> response = apiInstance.ListFiltersWithHttpInfo(chainName, contractAddress);
6564
Debug.Write("Status Code: " + response.StatusCode);
6665
Debug.Write("Response Headers: " + response.Headers);
6766
Debug.Write("Response Body: " + response.Data);
6867
}
6968
catch (ApiException e)
7069
{
71-
Debug.Print("Exception when calling StacksApi.ListFiltersWithHttpInfo: " + e.Message);
70+
Debug.Print("Exception when calling MetadataSearchApi.ListFiltersWithHttpInfo: " + e.Message);
7271
Debug.Print("Status Code: " + e.ErrorCode);
7372
Debug.Print(e.StackTrace);
7473
}
@@ -95,105 +94,6 @@ No authorization required
9594
- **Accept**: application/json
9695

9796

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-
111-
<a id="liststacks"></a>
112-
# **ListStacks**
113-
> List&lt;StackBundle&gt; ListStacks (string chainName, List<Guid> stackId)
114-
115-
Experimental: List NFT stacks by stack_id
116-
117-
![Experimental](https://img.shields.io/badge/status-experimental-yellow) NFT stacks
118-
119-
### Example
120-
```csharp
121-
using System.Collections.Generic;
122-
using System.Diagnostics;
123-
using Immutable.Api.ZkEvm.Api;
124-
using Immutable.Api.ZkEvm.Client;
125-
using Immutable.Api.ZkEvm.Model;
126-
127-
namespace Example
128-
{
129-
public class ListStacksExample
130-
{
131-
public static void Main()
132-
{
133-
Configuration config = new Configuration();
134-
config.BasePath = "https://api.sandbox.immutable.com";
135-
var apiInstance = new StacksApi(config);
136-
var chainName = imtbl-zkevm-testnet; // string | The name of chain
137-
var stackId = new List<Guid>(); // List<Guid> | List of stack_id to filter by
138-
139-
try
140-
{
141-
// Experimental: List NFT stacks by stack_id
142-
List<StackBundle> result = apiInstance.ListStacks(chainName, stackId);
143-
Debug.WriteLine(result);
144-
}
145-
catch (ApiException e)
146-
{
147-
Debug.Print("Exception when calling StacksApi.ListStacks: " + e.Message);
148-
Debug.Print("Status Code: " + e.ErrorCode);
149-
Debug.Print(e.StackTrace);
150-
}
151-
}
152-
}
153-
}
154-
```
155-
156-
#### Using the ListStacksWithHttpInfo variant
157-
This returns an ApiResponse object which contains the response data, status code and headers.
158-
159-
```csharp
160-
try
161-
{
162-
// Experimental: List NFT stacks by stack_id
163-
ApiResponse<List<StackBundle>> response = apiInstance.ListStacksWithHttpInfo(chainName, stackId);
164-
Debug.Write("Status Code: " + response.StatusCode);
165-
Debug.Write("Response Headers: " + response.Headers);
166-
Debug.Write("Response Body: " + response.Data);
167-
}
168-
catch (ApiException e)
169-
{
170-
Debug.Print("Exception when calling StacksApi.ListStacksWithHttpInfo: " + e.Message);
171-
Debug.Print("Status Code: " + e.ErrorCode);
172-
Debug.Print(e.StackTrace);
173-
}
174-
```
175-
176-
### Parameters
177-
178-
| Name | Type | Description | Notes |
179-
|------|------|-------------|-------|
180-
| **chainName** | **string** | The name of chain | |
181-
| **stackId** | [**List&lt;Guid&gt;**](Guid.md) | List of stack_id to filter by | |
182-
183-
### Return type
184-
185-
[**List&lt;StackBundle&gt;**](StackBundle.md)
186-
187-
### Authorization
188-
189-
No authorization required
190-
191-
### HTTP request headers
192-
193-
- **Content-Type**: Not defined
194-
- **Accept**: application/json
195-
196-
19797
### HTTP response details
19898
| Status code | Description | Response headers |
19999
|-------------|-------------|------------------|
@@ -211,9 +111,9 @@ No authorization required
211111
# **SearchNFTs**
212112
> SearchNFTsResult SearchNFTs (string chainName, List<string> contractAddress, string? accountAddress = null, List<Guid>? stackId = null, bool? onlyIncludeOwnerListings = null, int? pageSize = null, string? pageCursor = null)
213113
214-
Experimental: Search NFTs
114+
Search NFTs
215115

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

218118
### Example
219119
```csharp
@@ -231,7 +131,7 @@ namespace Example
231131
{
232132
Configuration config = new Configuration();
233133
config.BasePath = "https://api.sandbox.immutable.com";
234-
var apiInstance = new StacksApi(config);
134+
var apiInstance = new MetadataSearchApi(config);
235135
var chainName = imtbl-zkevm-testnet; // string | The name of chain
236136
var contractAddress = new List<string>(); // List<string> | List of contract addresses to filter by
237137
var accountAddress = 0xe9b00a87700f660e46b6f5deaa1232836bcc07d3; // string? | Account address to filter by (optional)
@@ -242,13 +142,13 @@ namespace Example
242142
243143
try
244144
{
245-
// Experimental: Search NFTs
145+
// Search NFTs
246146
SearchNFTsResult result = apiInstance.SearchNFTs(chainName, contractAddress, accountAddress, stackId, onlyIncludeOwnerListings, pageSize, pageCursor);
247147
Debug.WriteLine(result);
248148
}
249149
catch (ApiException e)
250150
{
251-
Debug.Print("Exception when calling StacksApi.SearchNFTs: " + e.Message);
151+
Debug.Print("Exception when calling MetadataSearchApi.SearchNFTs: " + e.Message);
252152
Debug.Print("Status Code: " + e.ErrorCode);
253153
Debug.Print(e.StackTrace);
254154
}
@@ -263,15 +163,15 @@ This returns an ApiResponse object which contains the response data, status code
263163
```csharp
264164
try
265165
{
266-
// Experimental: Search NFTs
166+
// Search NFTs
267167
ApiResponse<SearchNFTsResult> response = apiInstance.SearchNFTsWithHttpInfo(chainName, contractAddress, accountAddress, stackId, onlyIncludeOwnerListings, pageSize, pageCursor);
268168
Debug.Write("Status Code: " + response.StatusCode);
269169
Debug.Write("Response Headers: " + response.Headers);
270170
Debug.Write("Response Body: " + response.Data);
271171
}
272172
catch (ApiException e)
273173
{
274-
Debug.Print("Exception when calling StacksApi.SearchNFTsWithHttpInfo: " + e.Message);
174+
Debug.Print("Exception when calling MetadataSearchApi.SearchNFTsWithHttpInfo: " + e.Message);
275175
Debug.Print("Status Code: " + e.ErrorCode);
276176
Debug.Print(e.StackTrace);
277177
}
@@ -320,9 +220,9 @@ No authorization required
320220
# **SearchStacks**
321221
> 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)
322222
323-
Experimental: Search NFT stacks
223+
Search NFT stacks
324224

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

327227
### Example
328228
```csharp
@@ -340,7 +240,7 @@ namespace Example
340240
{
341241
Configuration config = new Configuration();
342242
config.BasePath = "https://api.sandbox.immutable.com";
343-
var apiInstance = new StacksApi(config);
243+
var apiInstance = new MetadataSearchApi(config);
344244
var chainName = imtbl-zkevm-testnet; // string | The name of chain
345245
var contractAddress = new List<string>(); // List<string> | List of contract addresses to filter by
346246
var accountAddress = 0xe9b00a87700f660e46b6f5deaa1232836bcc07d3; // string? | Account address to filter by (optional)
@@ -354,13 +254,13 @@ namespace Example
354254
355255
try
356256
{
357-
// Experimental: Search NFT stacks
257+
// Search NFT stacks
358258
SearchStacksResult result = apiInstance.SearchStacks(chainName, contractAddress, accountAddress, onlyIncludeOwnerListings, onlyIfHasActiveListings, traits, keyword, sortBy, pageSize, pageCursor);
359259
Debug.WriteLine(result);
360260
}
361261
catch (ApiException e)
362262
{
363-
Debug.Print("Exception when calling StacksApi.SearchStacks: " + e.Message);
263+
Debug.Print("Exception when calling MetadataSearchApi.SearchStacks: " + e.Message);
364264
Debug.Print("Status Code: " + e.ErrorCode);
365265
Debug.Print(e.StackTrace);
366266
}
@@ -375,15 +275,15 @@ This returns an ApiResponse object which contains the response data, status code
375275
```csharp
376276
try
377277
{
378-
// Experimental: Search NFT stacks
278+
// Search NFT stacks
379279
ApiResponse<SearchStacksResult> response = apiInstance.SearchStacksWithHttpInfo(chainName, contractAddress, accountAddress, onlyIncludeOwnerListings, onlyIfHasActiveListings, traits, keyword, sortBy, pageSize, pageCursor);
380280
Debug.Write("Status Code: " + response.StatusCode);
381281
Debug.Write("Response Headers: " + response.Headers);
382282
Debug.Write("Response Body: " + response.Data);
383283
}
384284
catch (ApiException e)
385285
{
386-
Debug.Print("Exception when calling StacksApi.SearchStacksWithHttpInfo: " + e.Message);
286+
Debug.Print("Exception when calling MetadataSearchApi.SearchStacksWithHttpInfo: " + e.Message);
387287
Debug.Print("Status Code: " + e.ErrorCode);
388288
Debug.Print(e.StackTrace);
389289
}

0 commit comments

Comments
 (0)