commitmentOf
commitmentOf(
substateId):Uint8Array<ArrayBufferLike> |null
Defined in: ootle/src/stealth/substate-parse.ts:73
Extract the 32-byte commitment from a UTXO substate id.
A UTXO id has exactly three _-separated segments, utxo_{resourceHex}_{commitmentHex},
and the commitment is the third. Returns null if the id is not a UTXO id (wrong
prefix, e.g. a component/vault id), does not have exactly three segments, has an empty
or non-hex resource segment, or has a commitment segment that is not exactly 32 bytes
of hex.
The commitment is never in the output body — always derive it from the id.
Parameters
Section titled “Parameters”substateId
Section titled “substateId”string
The full substate id string.
Returns
Section titled “Returns”Uint8Array<ArrayBufferLike> | null
The 32-byte commitment, or null if substateId is not a valid UTXO id.