signDataItem()

Othent JS SDK signDataItem() function

The signDataItem() function allows you to create and sign a DataItem object, compatible with arbundlesarrow-up-right. These data items can then be submitted to an ANS-104arrow-up-right compatible bundler.

triangle-exclamation
circle-exclamation
circle-info

Tip: The function returns a buffer (ArrayBufferLike) of the signed data item. You'll need to manually load it into an arbundlesarrow-up-right DataItem instance as seen in the example usagearrow-up-right:

API

signDataItem(dataItem: DataItem): Promise<ArrayBufferLike>;

dataItem: DataItem

The bundled data item's data (not arbundle's DateItem instancearrow-up-right) to sign.

interface DataItem {
    data: string | Uint8Array;
    target?: string;
    anchor?: string;
    tags?: {
        name: string;
        value: string;
    }[];
}

return Promise<ArrayBufferLike>

A Promise containing an ArrayBuffer with the DataItem's signed data, which can be loaded into a arbundle's DateItem instancearrow-up-right for validation.

Example usage

Last updated