Skip to main content

Toolbelt API Reference

This reference summarizes the primary runtime components, namespaces, and extension points in the Solana Toolbelt for Unity.

Key namespaces

The Toolbelt package uses the following namespaces throughout its runtime and services:

  • Solana.Unity.Toolbelt — core Toolbelt services (for example OwnerGovernedAssetLedgerService).
  • Solana.Unity.Toolbelt.Wallet — wallet session and verification helpers.
  • Solana.Unity.SDK — Solana Unity SDK primitives and Web3 integration.
  • Solana.Unity.Rpc — RPC clients, messages, and request types.

ToolbeltRuntime and SolanaConfiguration are Unity-facing entry points and live in the global namespace, while most services and models live under Solana.Unity.Toolbelt.

Key classes & components

ToolbeltRuntime (MonoBehaviour)

ToolbeltRuntime is the entry point that wires the Toolbelt into your Unity scene. It:

  • Resolves the active SolanaConfiguration asset.
  • Ensures a Web3 instance is available and configured.
  • Finds core managers like WalletManager and SolanaNftAccessManager.
  • Resolves runtime services (uploaders, storage, UI bridge) via interfaces.

SolanaConfiguration (ScriptableObject)

SolanaConfiguration stores runtime configuration and service setup, including:

  • RPC endpoint configuration and retry policy.
  • OGAL program ID, namespace, and collection mint settings.
  • Service registration and helper construction (e.g., OGAL service builders).
  • Toolbelt service provider wiring through InitializeToolbeltServices and runtime service rebuilds.

WalletManager

WalletManager orchestrates wallet connections, sessions, and transaction flows. It centralizes:

  • Session persistence and rehydration.
  • Wallet verification flows.
  • Transaction submission via configured RPC endpoints.

OwnerGovernedAssetLedgerService

OwnerGovernedAssetLedgerService (Solana.Unity.Toolbelt) wraps OGAL program calls, providing:

  • Mint and update flows for object manifests.
  • PDA derivation helpers for config, auth, and manifests.
  • Validation utilities for collections and creators.

SolanaNftAccessManager

SolanaNftAccessManager validates OGAL NFTs at runtime to gate gameplay access.

LevelEditorMintService

LevelEditorMintService handles creator-side asset serialization and mint requests for UGC workflows.

Initialization flow

  1. Add the Web3 prefab (Runtime/Toolbelt/Web3.prefab) to your scene.
  2. Create or reference a SolanaConfiguration asset in your project.
  3. Ensure ToolbeltRuntime is present (the prefab includes it) so it can:
    • Resolve the configuration.
    • Configure the RPC/WebSocket endpoints.
    • Initialize the wallet and OGAL services.
  4. Verify services are wired by checking the Toolbelt runtime logs and ensuring required behaviors are present:
    • WalletManager
    • SolanaNftAccessManager
    • ISolanaStorageService implementation

Extension points

Toolbelt services are designed to be swappable. Common extension points include:

  • Service provider registration: implement or override IToolbeltServiceProvider to control service wiring.
  • Storage and uploaders:
    • ISolanaStorageService for storage backends.
    • ILevelJsonUploader for level/UGC uploads.
    • INftStorageUploader for asset bundles and metadata uploads.
  • UI bridge: implement IToolbeltUiBridge to integrate custom UI flows.
  • Pricing data: supply custom pricing assets when using pricing-aware flows.

These interfaces are resolved by ToolbeltRuntime at startup, enabling you to replace or extend default behavior without forking the core package.