Skip to content

liquiidio/AtomicMarketApiClient

Repository files navigation

Liquiid logo

AtomicMarketApiClient

.NET and Unity3D-compatible (Desktop, Mobile, WebGL) ApiClient for AtomicMarket

Installation

Requires Unity 2019.1+ with .NET 4.x+ Runtime

This package can be included into your project by either:

  1. Installing the package via Unity's Package Manager (UPM) in the editor (recommended).
  2. Importing the .unitypackage which you can download here.
  3. Manually add the files in this repo.
  4. Installing it via NuGet.

1. Installing via Unity Package Manager (UPM).

In your Unity project:

  1. Open the Package Manager Window/Tab

    image

  2. Click on + icon and then click on "Add Package From Git URL"

    image

  3. Enter URL: https://github.com/liquiidio/AtomicMarketApiClient.git#upm


2. Importing the Unity Package.

Download the UnityPackage here.

Then in your Unity project:

  1. Open up the import a custom package window

    image

  2. Navigate to where you downloaded the file and open it.

    image

  3. Check all the relevant files needed (if this is a first time import, just select ALL) and click on import.

    image


3. Install manually.

Download the latest Release.

Then in your Unity project, copy the sources from AtomicMarketApiClient into your Unity Assets directory.


4. Install via NuGet (for Standard .NET users only - No Unity3D)

.NET CLI

> dotnet add package Liquiid.io.AtomicMarket

Package Manager

PM> Install-Package Liquiid.io.AtomicMarket


Usage

.NET and Unity3D-compatible (Desktop, Mobile, WebGL) ApiClient for the different APIs. Endpoints have its own set of parameters that you may build up and pass in to the relevant function.


Examples

Example calling the /v1/assets endpoint

Initialise the Assets API

     var assetsApi = AtomicAssetsApiFactory.Version1.AssetsApi;

Call the assets endpoint

     var assets = await assetsApi.Assets();

Print all asset ids

     assets.Data.ToList().ForEach(a => Console.WriteLine(a.AssetId));
Example output

1099567200114

1099567200113

1099567200112

1099567200111

1099567200110

1099567200109

1099567200108

1099567200107

1099567200106
...

Example calling the /v1/assets endpoint with parameters

Initialise the Assets API

     var assetsApi = AtomicAssetsApiFactory.Version1.AssetsApi;

Build up the AssetsParameters with the AssetsUriParameterBuilder

     var builder = new AssetsUriParameterBuilder().WithLimit(1);

Call the assets endpoint, passing in the builder

     var assets = await assetsApi.Assets(builder);

Print all asset ids

assets.Data.ToList().ForEach(a => Console.WriteLine(a.AssetId));
Example output

1099567200114

1099567200113

1099567200112

1099567200111

1099567200110

1099567200109

1099567200108

1099567200107

1099567200106

....