Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/CareBoo/unity-algorand-sdk
An Algorand SDK for Unity. Use the Algorand blockchain in your video game.
https://github.com/CareBoo/unity-algorand-sdk
Last synced: 3 months ago
JSON representation
An Algorand SDK for Unity. Use the Algorand blockchain in your video game.
- Host: GitHub
- URL: https://github.com/CareBoo/unity-algorand-sdk
- Owner: CareBoo
- License: mit
- Created: 2021-04-19T04:48:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-26T02:36:05.000Z (8 months ago)
- Last Synced: 2024-03-24T05:21:21.361Z (3 months ago)
- Language: C#
- Size: 103 MB
- Stars: 30
- Watchers: 4
- Forks: 15
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Lists
- awesome-algorand - unity-algorand-sdk - An Algorand SDK for Unity. Use the Algorand blockchain in your video game. (Development Tools / Languages)
README
Algorand SDK for Unity
Integrate your game with [Algorand](https://www.algorand.com/), a Pure Proof-of-Stake blockchain overseen by the Algorand Foundation.
Create Algorand transactions, Algorand accounts, and use Algorand's [REST APIs](https://developer.algorand.org/docs/rest-apis/restendpoints/).## Table of Contents
- [Table of Contents](#table-of-contents)
- [Requirements](#requirements)
- [Common Usages](#common-usages)
- [Make a payment transaction](#make-a-payment-transaction)
- [Sign the transaction with an account](#sign-the-transaction-with-an-account)
- [Sign the transaction with `kmd`](#sign-the-transaction-with-kmd)
- [Send the signed transaction](#send-the-signed-transaction)
- [Installation](#installation)
- [Unity Asset Store](#unity-asset-store)
- [Asset Package](#asset-package)
- [Open UPM](#open-upm)
- [Manually Adding UPM Scopes](#manually-adding-upm-scopes)
- [Getting Started](#getting-started)
- [Documentation Site](#documentation-site)
- [Samples](#samples)## Requirements
This package supports the following build targets and Unity versions:
| Unity Version | Windows | Mac OS | Linux | Android | iOS | WebGL |
| :-----------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
| 2021.3 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| 2022.3 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |- :white_check_mark: All APIs are supported.
- :x: Not supported. Use at your own risk.## Common Usages
### Make a payment transaction:
```csharp
using Algorand.Unity;var sender = "";
var receiver = "";
var algod = new AlgodClient("https://testnet-api.algonode.cloud");
var suggestedTxnParams = await algod.GetSuggestedParams();
var microAlgosToSend = 1_000_000L;
var paymentTxn = Transaction.Payment(sender, suggestedTxnParams, receiver, microAlgosToSend);
```#### Sign the transaction with an account:
```csharp
var account = Account.GenerateAccount();
var signedTxn = account.SignTxn(paymentTxn);
```#### Sign the transaction with `kmd`:
```csharp
var kmd = new KmdClient("");
var walletToken = await kmd.InitWalletHandleToken("", "");
var signedTxn = await kmd.SignTransaction(paymentTxn.Sender, paymentTxn.ToSignatureMessage(), walletToken, "");
```#### Send the signed transaction:
```csharp
await algod.SendTransaction(signedTxn);
```## Installation
### Unity Asset Store
[Algorand SDK for Unity](https://u3d.as/31Er) is now available!
### Asset Package
Each release contains a `.unitypackage` package file that can be installed into a project.
1. [Download the latest release.](https://github.com/CareBoo/unity-algorand-sdk/releases/latest)
2. [Import the `.unitypackage` file into your project.](https://docs.unity3d.com/Manual/AssetPackagesImport.html)### Open UPM
The easiest way to install as a package is to use Open UPM as it manages your scopes automatically.
You can [install Open UPM here](https://openupm.com/docs/getting-started.html).
Then use the Open UPM CLI at the root of your Unity project to install.```sh
> cd
> openupm add com.careboo.unity-algorand-sdk
```### Manually Adding UPM Scopes
If you don't want to use Open UPM, it's straightforward to manually add the UPM registry scopes
required for this package. See [Unity's official documentation on Scoped Registries](https://docs.unity3d.com/Manual/upm-scoped.html).
Modify your scopes to include the following:```json
{
"scopedRegistries": [
{
"name": "package.openupm.com",
"url": "https://package.openupm.com",
"scopes": [
"com.careboo.unity-algorand-sdk",
"com.cysharp.unitask"
]
}
]
}
```## Getting Started
Read [Getting Started](docs/getting_started.md) to learn the basic workflows for developing on Algorand.
### Documentation Site
Docs for this version were generated at https://careboo.github.io/unity-algorand-sdk/5.0.
### Samples
Some of the samples are built on WebGL and hosted on GitHub Pages.
- [Your First Transaction](https://careboo.github.io/unity-algorand-sdk/your-first-transaction)
- [Local Wallet](https://careboo.github.io/unity-algorand-sdk/local-wallet)