Initializes a new VanaCore client instance with the provided configuration.
The platform adapter for environment-specific operations
The configuration object specifying wallet or chain settings
The constructor validates the configuration, initializes storage providers if configured, creates wallet and public clients, and sets up all SDK controllers with shared context.
IMPORTANT: This constructor will validate storage requirements at runtime to fail fast. Methods that require storage will throw runtime errors if storage is not configured.
Readonly
permissionsManages gasless data access permissions and trusted server registry.
Readonly
dataHandles user data file operations.
Readonly
schemasManages data schemas and refiners.
Readonly
serverProvides personal server setup and trusted server interactions.
Readonly
protocolOffers low-level access to Vana protocol smart contracts.
Validates that storage is available for storage-dependent operations. This method enforces the fail-fast principle by checking storage availability at method call time rather than during expensive operations.
Type guard to check if this instance has storage enabled at compile time. Use this when you need TypeScript to understand that storage is available.
True if storage is configured, with type narrowing
Retrieves comprehensive runtime configuration information.
The current runtime configuration including chain, storage, and relayer settings
Sets the platform adapter for environment-specific operations. This is useful for testing and advanced use cases where you need to override the default platform detection.
The platform adapter to use
Gets the current platform adapter. This is useful for advanced use cases where you need to access the platform adapter directly.
The current platform adapter
Encrypts data using the Vana protocol standard encryption. This method automatically uses the correct platform adapter for the current environment.
The data to encrypt (string or Blob)
The key to use as encryption key
The encrypted data as Blob
Decrypts data that was encrypted using the Vana protocol. This method automatically uses the correct platform adapter for the current environment.
The encrypted data (string or Blob)
The wallet signature to use as decryption key
The decrypted data as Blob
Provides the core SDK functionality for interacting with the Vana network.
Remarks
This environment-agnostic class contains all SDK logic and accepts a platform adapter to handle environment-specific operations. It initializes all controllers and manages shared context between them.
The class uses TypeScript overloading to enforce storage requirements at compile time. When storage is required for certain operations, the constructor will fail fast at runtime.
For public usage, use the platform-specific Vana classes that extend this core:
Vana({config)
from the main package importExample