Skip to content

Commit 2497790

Browse files
authored
Merge pull request #647 from immutable/feat/update-zkevm-api-2026-01-08-10-06-45
feat: update immutable zkEVM API package
2 parents 437c0f4 + 273468d commit 2497790

File tree

6 files changed

+407
-0
lines changed

6 files changed

+407
-0
lines changed

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

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,105 @@ All URIs are relative to *https://api.sandbox.immutable.com*
44

55
| Method | HTTP request | Description |
66
|--------|--------------|-------------|
7+
| [**GetProfileByAuthenticatedWallet**](PassportProfileApi.md#getprofilebyauthenticatedwallet) | **GET** /passport-profile/v1/profile | Get profile for authenticated user |
78
| [**GetUserInfo**](PassportProfileApi.md#getuserinfo) | **GET** /passport-profile/v1/user/info | Get all info for a Passport user |
89
| [**LinkWalletV2**](PassportProfileApi.md#linkwalletv2) | **POST** /passport-profile/v2/linked-wallets | Link wallet v2 |
910
| [**SendPhoneOtp**](PassportProfileApi.md#sendphoneotp) | **POST** /passport-profile/v1/phone-otp | Send phone OTP code for user supplied phone number |
1011
| [**UpdateUsername**](PassportProfileApi.md#updateusername) | **POST** /passport-profile/v1/username | Update username |
1112
| [**VerifyPhoneOtp**](PassportProfileApi.md#verifyphoneotp) | **POST** /passport-profile/v1/phone-otp/verify | Verify phone OTP code against user phone number |
1213

14+
<a id="getprofilebyauthenticatedwallet"></a>
15+
# **GetProfileByAuthenticatedWallet**
16+
> ProfileResponse GetProfileByAuthenticatedWallet ()
17+
18+
Get profile for authenticated user
19+
20+
Get profile for the authenticated user's Passport wallet
21+
22+
### Example
23+
```csharp
24+
using System.Collections.Generic;
25+
using System.Diagnostics;
26+
using Immutable.Api.ZkEvm.Api;
27+
using Immutable.Api.ZkEvm.Client;
28+
using Immutable.Api.ZkEvm.Model;
29+
30+
namespace Example
31+
{
32+
public class GetProfileByAuthenticatedWalletExample
33+
{
34+
public static void Main()
35+
{
36+
Configuration config = new Configuration();
37+
config.BasePath = "https://api.sandbox.immutable.com";
38+
// Configure Bearer token for authorization: BearerAuth
39+
config.AccessToken = "YOUR_BEARER_TOKEN";
40+
41+
var apiInstance = new PassportProfileApi(config);
42+
43+
try
44+
{
45+
// Get profile for authenticated user
46+
ProfileResponse result = apiInstance.GetProfileByAuthenticatedWallet();
47+
Debug.WriteLine(result);
48+
}
49+
catch (ApiException e)
50+
{
51+
Debug.Print("Exception when calling PassportProfileApi.GetProfileByAuthenticatedWallet: " + e.Message);
52+
Debug.Print("Status Code: " + e.ErrorCode);
53+
Debug.Print(e.StackTrace);
54+
}
55+
}
56+
}
57+
}
58+
```
59+
60+
#### Using the GetProfileByAuthenticatedWalletWithHttpInfo variant
61+
This returns an ApiResponse object which contains the response data, status code and headers.
62+
63+
```csharp
64+
try
65+
{
66+
// Get profile for authenticated user
67+
ApiResponse<ProfileResponse> response = apiInstance.GetProfileByAuthenticatedWalletWithHttpInfo();
68+
Debug.Write("Status Code: " + response.StatusCode);
69+
Debug.Write("Response Headers: " + response.Headers);
70+
Debug.Write("Response Body: " + response.Data);
71+
}
72+
catch (ApiException e)
73+
{
74+
Debug.Print("Exception when calling PassportProfileApi.GetProfileByAuthenticatedWalletWithHttpInfo: " + e.Message);
75+
Debug.Print("Status Code: " + e.ErrorCode);
76+
Debug.Print(e.StackTrace);
77+
}
78+
```
79+
80+
### Parameters
81+
This endpoint does not need any parameter.
82+
### Return type
83+
84+
[**ProfileResponse**](ProfileResponse.md)
85+
86+
### Authorization
87+
88+
[BearerAuth](../README.md#BearerAuth)
89+
90+
### HTTP request headers
91+
92+
- **Content-Type**: Not defined
93+
- **Accept**: application/json
94+
95+
96+
### HTTP response details
97+
| Status code | Description | Response headers |
98+
|-------------|-------------|------------------|
99+
| **200** | OK | - |
100+
| **401** | UnauthorizedError | - |
101+
| **429** | TooManyRequestsError | - |
102+
| **500** | InternalServerError | - |
103+
104+
[[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)
105+
13106
<a id="getuserinfo"></a>
14107
# **GetUserInfo**
15108
> UserInfo GetUserInfo ()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Immutable.Api.ZkEvm.Model.ProfileResponse
2+
Get profile by wallet response
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**Username** | **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+

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

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,25 @@ public interface IPassportProfileApiSync : IApiAccessor
2828
{
2929
#region Synchronous Operations
3030
/// <summary>
31+
/// Get profile for authenticated user
32+
/// </summary>
33+
/// <remarks>
34+
/// Get profile for the authenticated user&#39;s Passport wallet
35+
/// </remarks>
36+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
37+
/// <returns>ProfileResponse</returns>
38+
ProfileResponse GetProfileByAuthenticatedWallet();
39+
40+
/// <summary>
41+
/// Get profile for authenticated user
42+
/// </summary>
43+
/// <remarks>
44+
/// Get profile for the authenticated user&#39;s Passport wallet
45+
/// </remarks>
46+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
47+
/// <returns>ApiResponse of ProfileResponse</returns>
48+
ApiResponse<ProfileResponse> GetProfileByAuthenticatedWalletWithHttpInfo();
49+
/// <summary>
3150
/// Get all info for a Passport user
3251
/// </summary>
3352
/// <remarks>
@@ -140,6 +159,27 @@ public interface IPassportProfileApiAsync : IApiAccessor
140159
{
141160
#region Asynchronous Operations
142161
/// <summary>
162+
/// Get profile for authenticated user
163+
/// </summary>
164+
/// <remarks>
165+
/// Get profile for the authenticated user&#39;s Passport wallet
166+
/// </remarks>
167+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
168+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
169+
/// <returns>Task of ProfileResponse</returns>
170+
System.Threading.Tasks.Task<ProfileResponse> GetProfileByAuthenticatedWalletAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
171+
172+
/// <summary>
173+
/// Get profile for authenticated user
174+
/// </summary>
175+
/// <remarks>
176+
/// Get profile for the authenticated user&#39;s Passport wallet
177+
/// </remarks>
178+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
179+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
180+
/// <returns>Task of ApiResponse (ProfileResponse)</returns>
181+
System.Threading.Tasks.Task<ApiResponse<ProfileResponse>> GetProfileByAuthenticatedWalletWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
182+
/// <summary>
143183
/// Get all info for a Passport user
144184
/// </summary>
145185
/// <remarks>
@@ -396,6 +436,130 @@ public Immutable.Api.ZkEvm.Client.ExceptionFactory ExceptionFactory
396436
set { _exceptionFactory = value; }
397437
}
398438

439+
/// <summary>
440+
/// Get profile for authenticated user Get profile for the authenticated user&#39;s Passport wallet
441+
/// </summary>
442+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
443+
/// <returns>ProfileResponse</returns>
444+
public ProfileResponse GetProfileByAuthenticatedWallet()
445+
{
446+
Immutable.Api.ZkEvm.Client.ApiResponse<ProfileResponse> localVarResponse = GetProfileByAuthenticatedWalletWithHttpInfo();
447+
return localVarResponse.Data;
448+
}
449+
450+
/// <summary>
451+
/// Get profile for authenticated user Get profile for the authenticated user&#39;s Passport wallet
452+
/// </summary>
453+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
454+
/// <returns>ApiResponse of ProfileResponse</returns>
455+
public Immutable.Api.ZkEvm.Client.ApiResponse<ProfileResponse> GetProfileByAuthenticatedWalletWithHttpInfo()
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+
474+
// authentication (BearerAuth) required
475+
// bearer authentication required
476+
if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization"))
477+
{
478+
localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
479+
}
480+
481+
// make the HTTP request
482+
var localVarResponse = this.Client.Get<ProfileResponse>("/passport-profile/v1/profile", localVarRequestOptions, this.Configuration);
483+
484+
if (this.ExceptionFactory != null)
485+
{
486+
Exception _exception = this.ExceptionFactory("GetProfileByAuthenticatedWallet", localVarResponse);
487+
if (_exception != null) throw _exception;
488+
}
489+
490+
return localVarResponse;
491+
}
492+
493+
/// <summary>
494+
/// Get profile for authenticated user Get profile for the authenticated user&#39;s Passport wallet
495+
/// </summary>
496+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
497+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
498+
/// <returns>Task of ProfileResponse</returns>
499+
public async System.Threading.Tasks.Task<ProfileResponse> GetProfileByAuthenticatedWalletAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
500+
{
501+
var task = GetProfileByAuthenticatedWalletWithHttpInfoAsync(cancellationToken);
502+
#if UNITY_EDITOR || !UNITY_WEBGL
503+
Immutable.Api.ZkEvm.Client.ApiResponse<ProfileResponse> localVarResponse = await task.ConfigureAwait(false);
504+
#else
505+
Immutable.Api.ZkEvm.Client.ApiResponse<ProfileResponse> localVarResponse = await task;
506+
#endif
507+
return localVarResponse.Data;
508+
}
509+
510+
/// <summary>
511+
/// Get profile for authenticated user Get profile for the authenticated user&#39;s Passport wallet
512+
/// </summary>
513+
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
514+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
515+
/// <returns>Task of ApiResponse (ProfileResponse)</returns>
516+
public async System.Threading.Tasks.Task<Immutable.Api.ZkEvm.Client.ApiResponse<ProfileResponse>> GetProfileByAuthenticatedWalletWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
517+
{
518+
519+
Immutable.Api.ZkEvm.Client.RequestOptions localVarRequestOptions = new Immutable.Api.ZkEvm.Client.RequestOptions();
520+
521+
string[] _contentTypes = new string[] {
522+
};
523+
524+
// to determine the Accept header
525+
string[] _accepts = new string[] {
526+
"application/json"
527+
};
528+
529+
530+
var localVarContentType = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
531+
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
532+
533+
var localVarAccept = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderAccept(_accepts);
534+
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
535+
536+
537+
// authentication (BearerAuth) required
538+
// bearer authentication required
539+
if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization"))
540+
{
541+
localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
542+
}
543+
544+
// make the HTTP request
545+
546+
var task = this.AsynchronousClient.GetAsync<ProfileResponse>("/passport-profile/v1/profile", localVarRequestOptions, this.Configuration, cancellationToken);
547+
548+
#if UNITY_EDITOR || !UNITY_WEBGL
549+
var localVarResponse = await task.ConfigureAwait(false);
550+
#else
551+
var localVarResponse = await task;
552+
#endif
553+
554+
if (this.ExceptionFactory != null)
555+
{
556+
Exception _exception = this.ExceptionFactory("GetProfileByAuthenticatedWallet", localVarResponse);
557+
if (_exception != null) throw _exception;
558+
}
559+
560+
return localVarResponse;
561+
}
562+
399563
/// <summary>
400564
/// Get all info for a Passport user Get all the info for an authenticated Passport user
401565
/// </summary>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* Immutable zkEVM API
3+
*
4+
* Immutable Multi Rollup API
5+
*
6+
* The version of the OpenAPI document: 1.0.0
7+
* Contact: support@immutable.com
8+
* Generated by: https://github.com/openapitools/openapi-generator.git
9+
*/
10+
11+
12+
using System;
13+
using System.Collections;
14+
using System.Collections.Generic;
15+
using System.Collections.ObjectModel;
16+
using System.Linq;
17+
using System.IO;
18+
using System.Runtime.Serialization;
19+
using System.Text;
20+
using System.Text.RegularExpressions;
21+
using Newtonsoft.Json;
22+
using Newtonsoft.Json.Converters;
23+
using Newtonsoft.Json.Linq;
24+
using OpenAPIDateConverter = Immutable.Api.ZkEvm.Client.OpenAPIDateConverter;
25+
26+
namespace Immutable.Api.ZkEvm.Model
27+
{
28+
/// <summary>
29+
/// Get profile by wallet response
30+
/// </summary>
31+
[DataContract(Name = "ProfileResponse")]
32+
public partial class ProfileResponse
33+
{
34+
/// <summary>
35+
/// Initializes a new instance of the <see cref="ProfileResponse" /> class.
36+
/// </summary>
37+
[JsonConstructorAttribute]
38+
protected ProfileResponse() { }
39+
/// <summary>
40+
/// Initializes a new instance of the <see cref="ProfileResponse" /> class.
41+
/// </summary>
42+
/// <param name="username">username (required).</param>
43+
public ProfileResponse(string username = default(string))
44+
{
45+
// to ensure "username" is required (not null)
46+
if (username == null)
47+
{
48+
throw new ArgumentNullException("username is a required property for ProfileResponse and cannot be null");
49+
}
50+
this.Username = username;
51+
}
52+
53+
/// <summary>
54+
/// Gets or Sets Username
55+
/// </summary>
56+
[DataMember(Name = "username", IsRequired = true, EmitDefaultValue = true)]
57+
public string Username { get; set; }
58+
59+
/// <summary>
60+
/// Returns the string presentation of the object
61+
/// </summary>
62+
/// <returns>String presentation of the object</returns>
63+
public override string ToString()
64+
{
65+
StringBuilder sb = new StringBuilder();
66+
sb.Append("class ProfileResponse {\n");
67+
sb.Append(" Username: ").Append(Username).Append("\n");
68+
sb.Append("}\n");
69+
return sb.ToString();
70+
}
71+
72+
/// <summary>
73+
/// Returns the JSON string presentation of the object
74+
/// </summary>
75+
/// <returns>JSON string presentation of the object</returns>
76+
public virtual string ToJson()
77+
{
78+
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
79+
}
80+
81+
}
82+
83+
}

src/Packages/ZkEvmApi/Runtime/Model/ProfileResponse.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)