arkiv-sdk
    Preparing search index...

    Type Alias ArkivUpdate

    Specification for updating existing entities in Arkiv.

    Updates replace the entire entity content including data and annotations. The entity owner can modify the expiration time to extend or reduce the entity's lifetime. Only the entity owner can perform update operations.

    Using the new expiresIn API (recommended):

    const updateSpec: ArkivUpdate = {
    entityKey: "0x1234567890abcdef12345678",
    data: new TextEncoder().encode(JSON.stringify({ message: "Updated content" })),
    expiresIn: ExpirationTime.fromDays(7),
    stringAnnotations: [
    new Annotation("status", "updated"),
    new Annotation("version", "2.0")
    ],
    numericAnnotations: [
    new Annotation("last_modified", Date.now())
    ]
    };

    Using legacy BTL (deprecated):

    const updateSpec: ArkivUpdate = {
    entityKey: "0x1234567890abcdef12345678",
    data: new TextEncoder().encode(JSON.stringify({ message: "Updated content" })),
    btl: 2000, // Deprecated: use expiresIn instead
    stringAnnotations: [],
    numericAnnotations: []
    };
    type ArkivUpdate = {
        btl?: number;
        data: Uint8Array;
        entityKey: Hex;
        expiresIn?: number | ExpirationTime;
        numericAnnotations: NumericAnnotation[];
        stringAnnotations: StringAnnotation[];
    }
    Index

    Properties

    btl?: number

    Use expiresIn instead. BTL will be removed in a future version. New Block-to-Live value for the entity

    data: Uint8Array

    The new binary data to store in the entity

    entityKey: Hex

    The hexadecimal key of the entity to update

    expiresIn?: number | ExpirationTime

    New expiration time for the entity in seconds, or ExpirationTime object (preferred over btl). When using number, it represents duration in seconds (not blocks).

    numericAnnotations: NumericAnnotation[]

    New numeric-valued metadata annotations

    stringAnnotations: StringAnnotation[]

    New string-valued metadata annotations