Delegation.fromMap constructor

Delegation.fromMap(
  1. Map map
)

Implementation

factory Delegation.fromMap(Map map) {
  return Delegation(
      map["pubkey"] is String
          ? (map["pubkey"] as String).toU8a()
          : Uint8List.fromList(map["pubkey"]),
      map["expiration"] is BigInt
          ? map["expiration"]
          : (map["expiration"] as String).hexToBn(),
      map["targets"] != null
          ? (map["targets"] as List).map((e) => Principal.fromHex(e)).toList()
          : null);
}