Retrieves the address and ABI for a specific Vana protocol contract.
The name of the Vana contract to retrieve (use const assertion for full typing)
An object containing the contract's address and fully typed ABI
Creates a fully typed contract instance ready for blockchain interaction.
The name of the Vana contract (use const assertion for full typing)
A fully typed contract instance with read/write methods and event handling
This method creates a contract instance with complete type safety for all contract methods including read operations, write operations, and event handling. The instance is pre-configured with the correct address, ABI, and wallet client for immediate use. All method parameters and return types are fully typed based on the contract ABI.
// Create typed contract instance
const dataRegistry = vana.protocol.createContract("DataRegistry" as const);
// Full type safety for all operations
const fileCount = await dataRegistry.read.filesCount(); // Type: bigint
const txHash = await dataRegistry.write.addFile(["ipfs://..."]); // Typed parameters
// Listen to events with full typing
const logs = await dataRegistry.getEvents.FileAdded();
Gets all available contract names that can be used with getContract(). Returns only contracts that are actually deployed on the current chain.
Array of all available contract names for the current chain
Checks if a specific contract is available on the current chain.
The contract name to check
Whether the contract is deployed on the current chain
Gets the contract factory instance for advanced usage. This provides access to additional contract management methods.
The contract factory instance
Gets the current chain ID from the wallet client.
The chain ID
Gets the current chain name from the wallet client.
The chain name
Provides direct, low-level access to all Vana protocol smart contracts.
Remarks
This controller serves as the designated "escape hatch" for advanced developers who need to interact directly with the underlying blockchain contracts. It provides access to contract addresses, ABIs, and factory methods for creating typed contract instances. Most developers should use the higher-level DataController and PermissionsController instead of this advanced API.
The controller automatically handles chain detection and provides only contracts that are deployed on the current network. All contract instances are fully typed for enhanced developer experience and type safety.
Use this controller when:
Most developers should use instead:
vana.data.*
for file management operationsvana.permissions.*
for access control workflowsExample
See
[URL_PLACEHOLDER] | Vana Protocol Contracts for contract specifications