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

    Class SerializationError

    Thrown when data serialization or deserialization operations fail.

    This error occurs when the SDK cannot properly serialize parameters for blockchain transactions, IPFS storage, or API calls. Common causes include circular references in objects, unsupported data types, or malformed JSON. It's typically encountered during grant file creation, storage operations, or when preparing transaction data.

    try {
    // Object with circular reference causes serialization error
    const obj = { name: 'test' };
    obj.self = obj; // Circular reference

    await vana.data.upload({
    content: obj,
    filename: 'data.json'
    });
    } catch (error) {
    if (error instanceof SerializationError) {
    console.error('Data serialization failed:', error.message);
    // Clean data before retry
    const cleanedData = removeCircularReferences(obj);
    await vana.data.upload({
    content: cleanedData,
    filename: 'data.json'
    });
    }
    }

    Hierarchy (View Summary)