createAgent static method

Future<AgentFactory> createAgent({
  1. required String canisterId,
  2. required String url,
  3. required Service idl,
  4. Identity? identity,
  5. bool? debug = true,
})

Implementation

static Future<AgentFactory> createAgent({
  required String canisterId,
  required String url,
  required Service idl,
  Identity? identity,
  bool? debug = true,
}) async {
  final agentFactory = AgentFactory(
    canisterId: canisterId,
    url: url,
    idl: idl,
    identity: identity ?? const AnonymousIdentity(),
    debug: debug,
  );
  await agentFactory.initAgent(url);
  agentFactory.setActor();
  return agentFactory;
}