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

    Function writeData

    • Write one record into a scope under an open write session.

      Parameters

      • params: WriteDataParams

      Returns Promise<WriteDataResult>

      The ingest answer (scope, collectedAt, status, and lineage.sources when the write carried lineage).

      Sends POST /v1/data/:scope with Authorization: Bearer <session token> and X-Vana-Write-Signature, a Web3Signed proof over the stored representation carrying the session's grantId as a signed claim. JSON writes send data as compact JSON with Content-Type: application/json; binary writes send the bytes with their Content-Type, X-Filename, and sign binaryWriteSignedBytes. lineage is the record's top-level lineage field for JSON and the lineage field of X-Vana-Metadata for binary, so the proof covers it either way.

      Before sending: no payload, a reserved key, a malformed lineage id, or non-object data.

      Before sending: the session token has passed its lifetime.

      401 (proof or session rejected).

      403 (grant no longer authorises the write).

      Any LINEAGE_* rejection: 422 LINEAGE_SOURCE_UNKNOWN (details.unknown), 400 LINEAGE_INVALID / LINEAGE_SCOPE_UNDER_SOURCE_PREFIX, 502 LINEAGE_SOURCE_LOOKUP_FAILED.

      Any other non-2xx.

      fetch threw on every attempt.