VenlyAPI.Core 3.1.0

dotnet add package VenlyAPI.Core --version 3.1.0
                    
NuGet\Install-Package VenlyAPI.Core -Version 3.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="VenlyAPI.Core" Version="3.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VenlyAPI.Core" Version="3.1.0" />
                    
Directory.Packages.props
<PackageReference Include="VenlyAPI.Core" />
                    
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 VenlyAPI.Core --version 3.1.0
                    
#r "nuget: VenlyAPI.Core, 3.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 VenlyAPI.Core@3.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=VenlyAPI.Core&version=3.1.0
                    
Install as a Cake Addin
#tool nuget:?package=VenlyAPI.Core&version=3.1.0
                    
Install as a Cake Tool

VenlyAPI.Core for .NET (Server/Backend)

VenlyAPI.Core is the official .NET client for Venly's backend services. It provides typed access to Venly Wallet, Token, and Pay APIs with first-class async support and a simple initialization model for server-side apps and services.

  • Wallet: users, wallets, balances, transactions, NFTs, signatures
  • Token: ERC-20 and ERC-1155 contracts, minting, media, metadata
  • Pay: fiat on/off ramp providers, checkout sessions, webhooks

Requirements

  • .NET 6.0 or .NET Standard 2.1

Install

dotnet add package VenlyAPI.Core

Or include a PackageReference:

<ItemGroup>
  <PackageReference Include="VenlyAPI.Core" Version="x.y.z" />
</ItemGroup>

Quickstart

Initialize the API with your client credentials and desired environment.

using Venly;
using Venly.Backends;
using Venly.Models.Shared;

var clientId = Environment.GetEnvironmentVariable("VENLY_CLIENT_ID");
var clientSecret = Environment.GetEnvironmentVariable("VENLY_CLIENT_SECRET");

// Provided server-side provider using OAuth2 client credentials
var provider = new DefaultServerProvider(clientId, clientSecret);

// Initialize and verify authentication (throws on error)
await VenlyAPI.Initialize(provider, eVyEnvironment.Sandbox).AwaitResult();

// Optional: retrieve API info (version/environment)
var info = VenlyAPI.GetApiInfo();
Console.WriteLine($"Venly Core {info.CoreVersion} on {info.ActiveEnvironment}");

Calling patterns

Use await with exceptions on failure, or callback-style chaining.

  • Await pattern (throws VyException on failure):
var wallet = await VenlyAPI.Wallet.GetWallet("<wallet-id>").AwaitResult();
  • Callback chaining (no exceptions, handle success/fail explicitly):
VenlyAPI.Wallet.GetWallet("<wallet-id>")
    .OnSuccess(w => Console.WriteLine(w.Id))
    .OnFail(ex => Console.Error.WriteLine(ex.Message))
    .Finally(() => Console.WriteLine("Done"));

Signing methods (VyUserAuth)

Some endpoints require a user signing method to authorize the call (PIN, Password, Biometric, etc.). Provide both the SigningMethod ID and its corresponding value via VyUserAuth.

  • Create a VyUserAuth from the user's PIN signing method:
using Venly.Models.Shared;
using Venly.Models.Wallet; // for TryGetPinAuth extension and models

var user = await VenlyAPI.Wallet.GetUser("<user-id>").AwaitResult();

// Option A: helper extension to build VyUserAuth from the user's PIN
if (!user.TryGetPinAuth("123456", out var userAuth))
    throw new InvalidOperationException("User has no PIN signing method configured.");

// Option B: manual construction from a specific signing method
// var pinMethod = user.SigningMethods.First(m => m.Type == eVySigningMethodType.Pin);
// var userAuth = new VyUserAuth(pinMethod.Id, "123456");
  • Use VyUserAuth in endpoints that require signing:
// Create a wallet for the user
var newWallet = await VenlyAPI.Wallet
    .CreateWallet(new VyCreateWalletRequest { /* chain, description, etc. */ }, userAuth)
    .AwaitResult();

// Execute a prepared/confirmed transaction
var txResult = await VenlyAPI.Wallet
    .ExecuteTransaction("<transaction-request-id>", new VyConfirmTransactionRequest { /* fields */ }, userAuth)
    .AwaitResult();

// Create and sign a signature request (e.g., message/EIP-712)
var sig = await VenlyAPI.Wallet
    .CreateSignature(new VyCreateSignatureRequest { /* message or typed data */ }, userAuth)
    .AwaitResult();

Note: VyUserAuth automatically maps to the required header format internally; you only need to pass it to methods that accept a VyUserAuth parameter.

Common operations

  • Wallet: get native balance by address
using Venly.Models.Shared;

var balance = await VenlyAPI.Wallet
    .GetNativeBalance(eVyChain.Ethereum, "0xYourAddress")
    .AwaitResult();
  • Wallet: check transaction status
var status = await VenlyAPI.Wallet
    .GetTransactionStatus(eVyChain.Ethereum, "0xTxHash")
    .AwaitResult();
  • Token: list your ERC-20 contracts
var contracts = await VenlyAPI.Token.GetErc20Contracts().AwaitResult();
  • Pay: create a checkout session
var session = await VenlyAPI.Pay
    .CheckoutSession(new VyCheckoutSessionRequest { /* set fields */ })
    .AwaitResult();
Console.WriteLine(session.Url); // Send this URL to your end-user

Request/response DTOs like VyCheckoutSessionRequest, VyCreateWalletRequest, etc., are included under Venly.Models.* namespaces.

Environments

Select eVyEnvironment.Sandbox for testing and eVyEnvironment.Production for live usage when calling VenlyAPI.Initialize(...).

Error handling

  • Await-style calls using .AwaitResult() throw on failure with a VyException containing API/HTTP context.
  • Callback-style calls expose errors via .OnFail(Exception ex) without throwing.

Threading and schedulers

The SDK uses a custom task wrapper (VyTask/VyTask<T>). Server applications typically do not need special scheduler configuration. If needed, set a foreground scheduler with:

VenlyAPI.SetForegroundTaskScheduler(TaskScheduler.FromCurrentSynchronizationContext());

Security

  • Treat clientSecret like a password. Do not embed secrets in client/mobile apps.
  • Prefer secure secret storage (environment variables, key vaults, etc.).

License

See LICENSE.txt in this repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on VenlyAPI.Core:

Package Downloads
VenlyAPI.Companion.PlayFab-Azure

VenlySDK-PlayFab compagnion library that can be used within Azure CloudFunctions

VenlyAPI.Companion.Beamable

VenlySDK-Beamable compagnion library that can be used within Microservices

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.0 214 10/20/2025
3.0.0 332 9/16/2025
2.0.74 306 11/27/2024
2.0.73 206 6/21/2024
2.0.72 217 6/21/2024
1.0.10 326 3/13/2024
1.0.9 556 12/13/2023
1.0.8 781 7/24/2023 1.0.8 is deprecated because it has critical bugs.
1.0.7 764 7/4/2023
1.0.6 800 6/27/2023
1.0.5 750 6/2/2023