Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.02 KB

README.md

File metadata and controls

54 lines (36 loc) · 1.02 KB

Coins SDK for .NET

This library provides a virtual currency backed by a Blockmason Link project.

Installing

Add the following line to your project file:

<PackageReference Include="Blockmason.Coins" Version="1.0.0"/>

Sign up for Blockmason Link and copy/paste the contents of Blockmason.Coins.sol into your project.

Usage

Import this library:

using Blockmason.Coins;

Create a treasury to manage your coins:

// Replace with your Link project's Client ID and Client Secret
Treasury treasury = new Treasury("<client-id>", "<client-secret>");

Mint some coins for one of your users:

// This library just needs a numeric user ID to keep track of who owns what
Coin coin = await treasury.Mint(userId, amount);

Burn coins from the supply:

await treasury.Burn(userId, amount);

Transfer a stack of coins between two users:

await treasury.Transfer(coin, toUserId);

A Coin has a Holder and an Amount.