parsePlutus static method

PlutusData parsePlutus(
  1. dynamic value,
  2. PlutusJsonSchema schame
)

Implementation

static PlutusData parsePlutus(dynamic value, PlutusJsonSchema schame) {
  _validateType(value);
  if (schame == PlutusJsonSchema.basicConversions) {
    if (value is int || value is BigInt) {
      return _encodeNumbers(value);
    } else if (value is String) {
      return _encodeString(value: value, schame: schame, isKey: false);
    } else if (value is List) {
      return _encodeArray(value, schame);
    }
    return _encodeMap(value, schame);
  }

  return _parseDetailed(value, schame);
}