Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface HttpAgentOptions

Hierarchy

  • HttpAgentOptions

Index

Properties

backoffStrategy?: BackoffStrategyFactory

The strategy to use for backoff when retrying requests

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

Type declaration

  • name: string
  • Optional password?: string
fetch?: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | Request | URL, init?: RequestInit): Promise<Response> }

Type declaration

    • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
    • (input: string | Request | URL, init?: RequestInit): Promise<Response>
    • Parameters

      • input: RequestInfo | URL
      • Optional init: RequestInit

      Returns Promise<Response>

    • Parameters

      • input: string | Request | URL
      • Optional init: RequestInit

      Returns Promise<Response>

fetchOptions?: Record<string, unknown>
host?: string
identity?: Identity | Promise<Identity>
logToConsole?: boolean

Whether to log to the console. Defaults to false.

replicaTime?: Date

Provide an expected replica time. This can be used to set the baseline for the time to use when making requests against the replica.

retryTimes?: number

Number of times to retry requests before throwing an error

default

3

rootKey?: ArrayBuffer

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

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

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

Generated using TypeDoc