getAllActors static method

List<CanisterActor> getAllActors(
  1. List<String> canisterIds,
  2. List<Service> idlServices
)

Implementation

static List<CanisterActor> getAllActors(
    List<String> canisterIds, List<Service> idlServices) {
  List<CanisterActor> actorsList = [];

  for (int i = 0; i < canisterIds.length; i++) {
    String canisterId = canisterIds[i];
    Service idlService = idlServices[i];

    HttpAgent actorAgent =
        newAgent == null ? DelegationValidation.validationAgent! : newAgent!;

    CanisterActor newActor = CanisterActor(
        ActorConfig(
          canisterId: Principal.fromText(canisterId),
          agent: actorAgent,
        ),
        idlService);

    actorsList.add(newActor);
  }

  return actorsList;
}