Creates an instance of TransferHash. Supports both hex strings (with or without the transfer prefix) and Uint8Array representations of the hash.
A hex string or Uint8Array representing the hash.
The origin prefix used to identify transfer-related hashes, defaulting to transfer-
.
Static
ByteThe fixed length of the hash in bytes.
Static
StringThe fixed length of the hash string representation in hexadecimal characters.
Static
createCreates an array of Hash instances from a byte array.
An array of Hash instances created from the byte array.
Error if the byte array length is not a multiple of the hash length.
The byte array containing multiple hash values.
Static
fromStatic
fromCreates a Hash instance from a byte array.
A result object containing the new Hash instance and the remaining bytes.
Error if the byte array length does not match the expected hash length.
The byte array representing the hash.
Static
fromStatic
fromJSONInstantiates a TransferHash from a JSON-compatible string, allowing for easy deserialization. The string should represent the TransferHash in prefixed hex format.
A new TransferHash instance initialized from the JSON string.
The JSON string representing the TransferHash.
Static
Private
initializeParses a source string to extract the hash bytes and verify if it includes the transfer prefix.
An object containing the hash bytes and the detected origin prefix.
The source string representing the transfer hash, optionally prefixed.
Generated using TypeDoc
Represents a transfer hash, extending the
Hash
class, with an additional prefix specific to transfer entities. This prefix aids in identifying transfer-related hashes within the system.