Vana SDK - v2.2.2
    Preparing search index...

    Class ReadOnlyError

    Thrown when attempting to perform write operations without a wallet client.

    This error occurs when trying to execute operations that require wallet interaction (signing, encrypting, or submitting transactions) while the SDK is initialized in read-only mode without a wallet client. To perform write operations, the SDK must be initialized with a wallet client.

    Common operations that require a wallet:

    • Signing transactions or typed data
    • Encrypting or decrypting files
    • Granting or revoking permissions
    • Uploading data to IPFS
    • Submitting blockchain transactions
    try {
    // This will throw if no wallet client is provided
    await vana.data.decryptFile({ fileId: 'abc123' });
    } catch (error) {
    if (error instanceof ReadOnlyError) {
    console.error(`Cannot ${error.operation}: ${error.message}`);
    // Initialize with wallet client to enable write operations
    const vanaWithWallet = Vana({
    walletClient: createWalletClient(...)
    });
    }
    }

    Hierarchy (View Summary)

    Index

    Properties

    operation: string

    The operation that was attempted

    suggestion: string

    Suggested solution for fixing the error