Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ProxyAgent

Hierarchy

  • ProxyAgent

Implements

Index

Constructors

Properties

_nextId: number = 0
_pendingCalls: Map<number, [((resolve: any) => void), ((reject: any) => void)]> = ...
rootKey: null = null

Methods

  • fetchRootKey(): Promise<ArrayBuffer>
  • By default, the agent is configured to talk to the main Internet Computer, and verifies responses using a hard-coded public key.

    This function will instruct the agent to ask the endpoint for its public key, and use that instead. This is required when talking to a local test instance, for example.

    Only use this when you are not talking to the main Internet Computer, otherwise you are prone to man-in-the-middle attacks! Do not call this function by default.

    Returns Promise<ArrayBuffer>

  • getPrincipal(): Promise<Principal>
  • Returns the principal ID associated with this agent (by default). It only shows the principal of the default identity in the agent, which is the principal used when calls don't specify it.

    Returns Promise<Principal>

  • status(): Promise<JsonObject>
  • Query the status endpoint of the replica. This normally has a few fields that corresponds to the version of the replica, its root public key, and any other information made public.

    Returns Promise<JsonObject>

    A JsonObject that is essentially a record of fields from the status endpoint.

Generated using TypeDoc