createAndInstallCanister static method

Future<CanisterActor> createAndInstallCanister(
  1. Service interfaceFactory,
  2. FieldOptions fields,
  3. CallConfig? config
)

Implementation

static Future<CanisterActor> createAndInstallCanister(
  Service interfaceFactory,
  FieldOptions fields,
  CallConfig? config,
) async {
  final canisterId = await createCanister(config);

  final newConfig = ActorConfig(
    agent: config?.agent,
    canisterId: canisterId,
    effectiveCanisterId: config?.effectiveCanisterId,
    pollingStrategyFactory: config?.pollingStrategyFactory,
  );
  install(fields, newConfig);

  return createActor(interfaceFactory, newConfig);
}