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 exampleOwnerGovernedAssetLedgerService).Solana.Unity.Toolbelt.Wallet— wallet session and verification helpers.Solana.Unity.SDK— Solana Unity SDK primitives andWeb3integration.Solana.Unity.Rpc— RPC clients, messages, and request types.
ToolbeltRuntimeandSolanaConfigurationare Unity-facing entry points and live in the global namespace, while most services and models live underSolana.Unity.Toolbelt.
Key classes & components
ToolbeltRuntime (MonoBehaviour)
ToolbeltRuntime is the entry point that wires the Toolbelt into your Unity scene. It:
- Resolves the active
SolanaConfigurationasset. - Ensures a
Web3instance is available and configured. - Finds core managers like
WalletManagerandSolanaNftAccessManager. - 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
InitializeToolbeltServicesand 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
- Add the Web3 prefab (
Runtime/Toolbelt/Web3.prefab) to your scene. - Create or reference a
SolanaConfigurationasset in your project. - Ensure
ToolbeltRuntimeis present (the prefab includes it) so it can:- Resolve the configuration.
- Configure the RPC/WebSocket endpoints.
- Initialize the wallet and OGAL services.
- Verify services are wired by checking the Toolbelt runtime logs and ensuring required behaviors are present:
WalletManagerSolanaNftAccessManagerISolanaStorageServiceimplementation
Extension points
Toolbelt services are designed to be swappable. Common extension points include:
- Service provider registration: implement or override
IToolbeltServiceProviderto control service wiring. - Storage and uploaders:
ISolanaStorageServicefor storage backends.ILevelJsonUploaderfor level/UGC uploads.INftStorageUploaderfor asset bundles and metadata uploads.
- UI bridge: implement
IToolbeltUiBridgeto 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.