CashToken constructor

CashToken({
  1. required Uint8List categoryId,
  2. CashTokenCapability capability = CashTokenCapability.none,
  3. Uint8List? commitment,
  4. BigInt? amount,
})

Implementation

CashToken({
  required Uint8List categoryId,
  this.capability = CashTokenCapability.none,
  this.commitment,
  BigInt? amount,
}) : amount = amount ?? BigInt.zero,
     categoryId = Uint8List.fromList(categoryId) {
  if (categoryId.length != 32) {
    throw ArgumentError('categoryId must be 32 bytes');
  }
  if (commitment != null && commitment!.length > 40) {
    throw ArgumentError('commitment must be at most 40 bytes');
  }
}