CashToken constructor
CashToken({
- required Uint8List categoryId,
- CashTokenCapability capability = CashTokenCapability.none,
- Uint8List? commitment,
- 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');
}
}