Solana.Unity.Soar 0.1.0

dotnet add package Solana.Unity.Soar --version 0.1.0
NuGet\Install-Package Solana.Unity.Soar -Version 0.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="Solana.Unity.Soar" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Solana.Unity.Soar --version 0.1.0
#r "nuget: Solana.Unity.Soar, 0.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.
// Install Solana.Unity.Soar as a Cake Addin
#addin nuget:?package=Solana.Unity.Soar&version=0.1.0

// Install Solana.Unity.Soar as a Cake Tool
#tool nuget:?package=Solana.Unity.Soar&version=0.1.0

<p align="center"> <img src="https://raw.githubusercontent.com/magicblock-labs/Solana.Unity.Soar/main/assets/icon.png" margin="auto" height="100"/> </p>

<p align="center"> <a href="https://github.com/magicblock-labs/Solana.Unity.Soar/actions/workflows/dotnet.yml"> <img src="https://github.com/magicblock-labs/Solana.Unity.Soar/actions/workflows/dotnet.yml/badge.svg" alt="GitHub Workflow Build Status (master)" ></a> <a href=""> <img src="https://img.shields.io/github/license/magicblock-labs/Solana.Unity.Soar?style=flat-square" alt="Code License"></a> <a href="https://twitter.com/intent/follow?screen_name=magicblock"> <img src="https://img.shields.io/twitter/follow/magicblock?style=flat-square&logo=twitter" alt="Follow on Twitter"></a> <a href="https://discord.com/invite/MBkdC3gxcv"> <img alt="Discord" src="https://img.shields.io/discord/849407317761064961?style=flat-square" alt="Join the discussion!"></a> </p>

What is Solana.Unity.Soar?

Solana.Unity.Soar is the Unity SDK for integrating with the Soar protocol.

Refer to the documentation for more information on how to use the SDK.

Most of the code of Solana.Unity.Soar was auto-generated using the Solana.Unity Anchor tool from the Soar IDL.

Features

Requirements

  • net 2.1

Dependencies

  • Solana.Unity.Programs
  • Solana.Unity.Rpc
  • Solana.Unity.Wallet

Examples

Create a player profile on Soar

var tx = new Transaction()
{
    FeePayer = Web3.Account,
    Instructions = new List<TransactionInstruction>(),
    RecentBlockHash = await Web3.BlockHash()
};

var accountsInitUser = new InitializeUserAccounts()
{
    Payer = Web3.Account,
    User = userPda,
    SystemProgram = SystemProgram.ProgramIdKey
};
var initUserIx = KamikazeJoeProgram.InitializeUser(accounts: accountsInitUser, _kamikazeJoeProgramId);
tx.Add(initUserIx);
await Web3.Wallet.SignAndSendTransaction(tx);

The following example refer to the Kamikaze Joe example, specifically the claim win instruction, which submit the score trough CPI:


var game = (await KamikazeJoeClient.GetGameAsync(_gameInstanceId, Commitment.Confirmed)).ParsedResult;
var soar = (await KamikazeJoeClient.GetLeaderboardAsync(FindSoarPda())).ParsedResult;

var tx = new Transaction()
{
    FeePayer = Web3.Account,
    Instructions = new List<TransactionInstruction>(),
    RecentBlockHash = await Web3.BlockHash()
};

var playerAccount = SoarPda.PlayerPda(game.GameState.WonValue.Winner);

var claimPrizeAccounts = new ClaimPrizeSoarAccounts()
{
    Payer = Web3.Account,
    User = FindUserPda(game.GameState.WonValue.Winner),
    Receiver = game.GameState.WonValue.Winner,
    Game = _gameInstanceId,
    Vault = FindVaultPda(),
    LeaderboardInfo = FindSoarPda(),
    SoarGame = soar.Game,
    SoarLeaderboard = soar.LeaderboardField,
    SoarPlayerAccount = playerAccount,
    SoarPlayerScores = SoarPda.PlayerScoresPda(playerAccount, soar.LeaderboardField),
    SoarTopEntries = soar.TopEntries,
    SoarProgram = SoarProgram.ProgramIdKey,
    SystemProgram = SystemProgram.ProgramIdKey
};

var claimPrizeIx = KamikazeJoeProgram.ClaimPrizeSoar(accounts: claimPrizeAccounts, _kamikazeJoeProgramId);
tx.Instructions.Add(claimPrizeIx);
await SignAndSendTransaction(tx);

Contribution

We encourage everyone to contribute, submit issues, PRs, discuss. Every kind of help is welcome.

License

This project is licensed under the MIT License - see the LICENSE file for details

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 176 10/19/2023