signDataItem()
Othent JS SDK signDataItem() function
The signDataItem()
function allows you to create and sign a DataItem
object, compatible with arbundles
. These data items can then be submitted to an ANS-104 compatible bundler.
Bug: Using signDataItem()
and then calling dataItem.isValid()
always returns false
, so the example below will never submit the data item to a bundler. Track the progress on this GitHub issue.
This function assumes (and requires) a user is authenticated. See requireAuth()
.
Tip: The function returns a buffer (ArrayBufferLike
) of the signed data item. You'll need to manually load it into an arbundles
DataItem
instance as seen in the example usage:
API
dataItem: DataItem
dataItem: DataItem
The bundled data item's data (not arbundle
's DateItem
instance) to sign.
return Promise<ArrayBufferLike>
return Promise<ArrayBufferLike>
A Promise
containing an ArrayBuffer
with the DataItem
's signed data, which can be loaded into a arbundle
's DateItem
instance for validation.
Example usage
Last updated