Vana SDK - v0.1.0
    Preparing search index...

    Interface UploadParams

    High-level parameters for uploading user data with automatic encryption and blockchain registration.

    This is the primary interface for uploading user data through the simplified vana.data.upload() method. It handles the complete workflow including encryption, storage, and blockchain registration.

    When using permissions with encryption enabled (default), you must provide the public key for each permission recipient.

    // Basic file upload
    const result = await vana.data.upload({
    content: "My personal data",
    filename: "diary.txt"
    });

    // Upload with schema validation
    const result = await vana.data.upload({
    content: { name: "John", age: 30 },
    filename: "profile.json",
    schemaId: 1
    });

    // Upload with permissions for an app (encrypted - requires publicKey)
    const result = await vana.data.upload({
    content: "Data for AI analysis",
    filename: "analysis.txt",
    permissions: [{
    grantee: "0x1234...",
    operation: "llm_inference",
    parameters: { model: "gpt-4" },
    publicKey: "0x04..." // Required when encrypt is true (default)
    }]
    });

    // Upload without encryption (publicKey optional)
    const result = await vana.data.upload({
    content: "Public data",
    filename: "public.txt",
    encrypt: false,
    permissions: [{
    grantee: "0x1234...",
    operation: "read",
    parameters: {}
    }]
    });
    interface UploadParams {
        content: string | Blob | Buffer<ArrayBufferLike>;
        filename?: string;
        schemaId?: number;
        permissions?: PermissionParams[];
        encrypt?: boolean;
        providerName?: string;
    }
    Index

    Properties

    content: string | Blob | Buffer<ArrayBufferLike>

    Raw file data as string, Blob, or Buffer.

    filename?: string

    Optional filename for the uploaded file.

    schemaId?: number

    Optional schema ID for data validation.

    permissions?: PermissionParams[]

    Optional permissions to grant during upload.

    encrypt?: boolean

    Whether to encrypt the data (defaults to true).

    providerName?: string

    Optional storage provider name.