/AtomicAssetsClient

Client for AtomicHub/AtomicAssets REST API

Primary LanguageC#

AtomicAssetsClient

Client library for interacting with AtomicHub REST API in WAX network and EOS network (not tested yet).

NuGet

Features

  • Auto-detects request limits: requests queued (via SemaphoreSlim) and delayed if needed
  • Strongly typed request parameters and returned values (instead of strings everywhere)
  • Auto-request next page for list-type requests (and delays it if needed, of course)
  • Target framework: net6.0
  • Web and console ready (dependencies are only Microsoft.Extensions.Http and Microsoft.Extensions.Logging.Abstractions)
  • Uses HttpClient (add Polly policies of your choice)

Installation

dotnet add package AtomicAssetsClient

Usage

1. Register in Startup.cs

services.AddHttpClient();
services.Configure<AtomicClientOptions>(Configuration.GetSection("AtomicClientOptions"));
services.AddSingleton<IAtomicClient, AtomicClient>();

⚠ Important: register client as singletone for request limits to be handled correctly betweed different threads!

2. Use in your code

var templates = await atomicClient.GetTemplates(collectionName: "atomic").ConfigureAwait(false);

Advanced scenarios

Check AdvancedReadme.md to know how to configure HttpClient, how to switch to EOS network, etc.

Donate

Donate WAX