Interface UpdateAgentParameters

interface UpdateAgentParameters {
    fetch?: {
        (input, init?): Promise<Response>;
        (input, init?): Promise<Response>;
    };
    fetchOptions?: Record<string, unknown>;
    callOptions?: Record<string, unknown>;
    host?: string;
    identity?: types.Identity | Promise<types.Identity>;
    credentials?: {
        name: string;
        password?: string;
    };
    useQueryNonces?: boolean;
    retryTimes?: number;
    backoffStrategy?: BackoffStrategyFactory;
    verifyQuerySignatures?: boolean;
    logToConsole?: boolean;
    rootKey?: ArrayBuffer;
    agent?: types.HttpAgent;
}

Hierarchy (view full)

Properties

fetch?: {
    (input, init?): Promise<Response>;
    (input, init?): Promise<Response>;
}

Type declaration

fetchOptions?: Record<string, unknown>
callOptions?: Record<string, unknown>
host?: string
credentials?: {
    name: string;
    password?: string;
}

Type declaration

  • name: string
  • Optional password?: string
useQueryNonces?: boolean

Adds a unique Nonce with each query. Enabling will prevent queries from being answered with a cached response.

Example

const agent = new HttpAgent({ useQueryNonces: true });
agent.addTransform(makeNonceTransform(makeNonce);

Default

false
retryTimes?: number

Number of times to retry requests before throwing an error

Default

3
backoffStrategy?: BackoffStrategyFactory

The strategy to use for backoff when retrying requests

verifyQuerySignatures?: boolean

Whether the agent should verify signatures signed by node keys on query responses. Increases security, but adds overhead and must make a separate request to cache the node keys for the canister's subnet.

Default

true
logToConsole?: boolean

Whether to log to the console. Defaults to false.

rootKey?: ArrayBuffer

Alternate root key to use for verifying certificates. If not provided, the default IC root key will be used.