AffinidiTdk.IotaClient 1.1.0

dotnet add package AffinidiTdk.IotaClient --version 1.1.0
                    
NuGet\Install-Package AffinidiTdk.IotaClient -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AffinidiTdk.IotaClient" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AffinidiTdk.IotaClient" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="AffinidiTdk.IotaClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AffinidiTdk.IotaClient --version 1.1.0
                    
#r "nuget: AffinidiTdk.IotaClient, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AffinidiTdk.IotaClient@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AffinidiTdk.IotaClient&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=AffinidiTdk.IotaClient&version=1.1.0
                    
Install as a Cake Tool

<a id="top"></a>

Affinidi TDK .NET client for Iota

Affinidi TDK dotnet client for Affinidi IOTA

Getting Started

Prerequisites

Check your installed version:

dotnet --version

Installation

These are the steps to get you started with a dotnet project and integration with AffinidiTdk.IotaClient. Note: Steps 1 & 2 are optional if you have already created a project.

  1. Create a new project directory

*On macOS / Linux / Windows (Powershell) 😗

mkdir MyProject
cd MyProject
  1. Initialize a .NET Project (dotnet template: console)
dotnet new console
  1. Installing the TDK Client (from nuget.org)
dotnet add package AffinidiTdk.IotaClient

<p align="right">(<a href="#top">back to top</a>)</p>

Usage

  1. Import the required dependencies

The dependencies required may differ based on the Client Api used in your application.

using AffinidiTdk.AuthProvider;
using AffinidiTdk.IotaClient.Api;
using AffinidiTdk.IotaClient.Client;
using AffinidiTdk.IotaClient.Model;
  1. Create an AuthProvider
  • The AuthProvider is a separate package which you will need to install. Get it from nuget.org. NOTE: This step requires you to first create your Personal Access Token (PAT). Please refer to this link
var authProvider = new AuthProvider(new AuthProviderParams
{
    // Please generate your own Personal Access Tokens (PAT). 
    // Refer to https://docs.affinidi.com/dev-tools/affinidi-tdk/get-access-token/#create-a-personal-access-token-pat for the guide on creating your own PAT.    
    TokenId = "YOUR_TOKEN_ID",
    PrivateKey = "YOUR_PRIVATE_KEY",
    ProjectId = "YOUR_PROJECT_ID"
    // Passphrase = "YOUR_PASSPHRASE", // Required only if provided in the PAT
});
  1. Fetch the ProjectScopedToken from the AuthProvider
string projectScopedToken = await authProvider.FetchProjectScopedTokenAsync();
  1. Create an instance of the Client Configuration
  • In this step, you can set the projectScopedToken in the configuration.

Configuration config = new Configuration();

config.AddApiKey("authorization", projectScopedToken);

  1. Create an instance of the Client Api you intend to use
  • In this step, you should pass the config as a constructor argument in the Client Api. NOTE: Each Operation requires different input. Please refer to the <a href="#documentation">operation documentation</a> for the details.


CallbackApi api = new CallbackApi(config);

var callbackInput = new CallbackInput();

CallbackResponseOK result = api.IotOIDC4VPCallback(callbackInput);

Console.WriteLine(result.ToJson());


For more examples, please refer to the Documentation.

Token Refresh

When handling tokens, it is important that your project access token is managed properly to prevent failures due to expired tokens.

We have created an example code which handles the automatic refresh of tokens to ensure that the token used in the client APIs are fresh.

<p align="right">(<a href="#top">back to top</a>)</p>

Documentation

Client Api Documentation

ClientApi Operation Description
CallbackApi IotOIDC4VPCallback
ConfigurationsApi CreateIotaConfiguration
ConfigurationsApi DeleteIotaConfigurationById
ConfigurationsApi GetIotaConfigurationById
ConfigurationsApi GetIotaConfigurationMetaData
ConfigurationsApi ListIotaConfigurations
ConfigurationsApi UpdateIotaConfigurationById
DefaultApi ListLoggedConsents
IotaApi AwsExchangeCredentials
IotaApi AwsExchangeCredentialsProjectToken
IotaApi FetchIotaVpResponse
IotaApi InitiateDataSharingRequest
IotaApi IotaExchangeCredentials
PexQueryApi CreatePexQuery
PexQueryApi DeletePexQueries
PexQueryApi DeletePexQueryById
PexQueryApi GetPexQueryById
PexQueryApi ListPexQueries
PexQueryApi SavePexQueries
PexQueryApi UpdatePexQueryById

Note: Each Client API operation requires a different authorization token. Please check the operation details for the type of token required to use the operation properly.

Documentation For Models

<p align="right">(<a href="#top">back to top</a>)</p>

Support & Feedback

If you face any issues or have suggestions, please don't hesitate to contact us using this link.

Reporting technical issues

If you have a technical issue with the Affinidi TDK's codebase, you can also create an issue directly in GitHub.

  1. Ensure the bug was not already reported by searching on GitHub under Issues.

  2. If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.

<p align="right">(<a href="#top">back to top</a>)</p>

Contributing

We enjoy community contributions! Whether it’s bug fixes, feature requests, or improving docs, your input helps shape the Affinidi TDK.

<p align="right">(<a href="#top">back to top</a>)</p>

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 172 10/1/2025

Minor update