Creates an instance of URef.
Error if the data length is not equal to ByteHashLen
or if the access rights are unsupported.
The data (hash) of the URef, expected to be exactly 32 bytes.
The access permissions for the URef, specified by the UrefAccess
enum.
The access permissions assigned to this URef, defined by the UrefAccess
enum.
The unique data (hash) associated with the URef, represented as a 32-byte array.
Sets or updates the access permissions for the URef.
The new access permission to set, defined by the UrefAccess
enum.
Static
fromCreates a URef instance from an ArrayBuffer, extracting the hash data and access byte.
A new URef instance.
Error if the ArrayBuffer size is smaller than expected.
The ArrayBuffer containing the URef data.
Static
fromCreates a URef from a byte array representation, expecting the hash data and access byte.
A new URef instance wrapped in an IResultWithBytes
object.
Error if the byte array length does not match the expected URef structure.
The byte array containing the URef data and access byte.
Static
fromJSONStatic
fromParses a URef from a prefixed string format, which includes its data and access permissions.
A new URef instance.
ErrIncorrectUrefFormat if the string format does not match the expected URef format.
The string containing the URef data, starting with the URef prefix.
Generated using TypeDoc
Represents an Unforgeable Reference (URef) in the system, identified by a unique hash and associated with specific access permissions. A URef is used to control permissions and securely reference data in smart contracts.