Interface GlobalInternetComputer

interface GlobalInternetComputer {
    ic: {
        agent: utils.agent.Agent;
        HttpAgent: typeof types.HttpAgent;
        IDL: any;
        features?: {
            authentication?: boolean;
        };
        canister: undefined | types.ActorSubclass;
    };
}

Properties

Properties

ic: {
    agent: utils.agent.Agent;
    HttpAgent: typeof types.HttpAgent;
    IDL: any;
    features?: {
        authentication?: boolean;
    };
    canister: undefined | types.ActorSubclass;
}

Type declaration

  • agent: utils.agent.Agent
  • HttpAgent: typeof types.HttpAgent
  • IDL: any
  • Optional features?: {
        authentication?: boolean;
    }

    Simple advertisement of features in whoever is managing this globalThis.ic. Use Case

    • Scripts that know they need an ic feature can detect using this and, if not present (e.g. old bootstrap version), they can dynamically include their own and continue operating (e.g. polyfill). This is useful when adding features to bootstrap. You can still deploy your canister to an ic with old bootstrap, then just dynamically reload your own new-version bootstrap if needed.
    • Optional authentication?: boolean

      This is falsy if authn isn't supported at all

  • canister: undefined | types.ActorSubclass

    The Actor for the canister being used for the frontend. Normally should correspond to the canister represented by the canister id in the URL.

    It does not have any functions configured.

    If a canister ID could not be found, no actor were created and this is undefined.