HttpAgentOptions
Defined in: packages/core/src/agent/agent/http/index.ts:131
Properties
Section titled “Properties”backoffStrategy?
Section titled “backoffStrategy?”
optionalbackoffStrategy?:BackoffStrategyFactory
Defined in: packages/core/src/agent/agent/http/index.ts:178
The strategy to use for backoff when retrying requests
callOptions?
Section titled “callOptions?”
optionalcallOptions?:Record<string,unknown>
Defined in: packages/core/src/agent/agent/http/index.ts:141
credentials?
Section titled “credentials?”
optionalcredentials?:object
Defined in: packages/core/src/agent/agent/http/index.ts:157
name:
string
password?
Section titled “password?”
optionalpassword?:string
fetch?
Section titled “fetch?”
optionalfetch?: {(input,init?):Promise<Response>; (input,init?):Promise<Response>; }
Defined in: packages/core/src/agent/agent/http/index.ts:133
Call Signature
Section titled “Call Signature”(
input,init?):Promise<Response>
Parameters
Section titled “Parameters”URL | RequestInfo
RequestInit
Returns
Section titled “Returns”Promise<Response>
Call Signature
Section titled “Call Signature”(
input,init?):Promise<Response>
Parameters
Section titled “Parameters”string | URL | Request
RequestInit
Returns
Section titled “Returns”Promise<Response>
fetchOptions?
Section titled “fetchOptions?”
optionalfetchOptions?:Record<string,unknown>
Defined in: packages/core/src/agent/agent/http/index.ts:138
optionalhost?:string
Defined in: packages/core/src/agent/agent/http/index.ts:145
identity?
Section titled “identity?”Defined in: packages/core/src/agent/agent/http/index.ts:149
ingressExpiryInMinutes?
Section titled “ingressExpiryInMinutes?”
optionalingressExpiryInMinutes?:number
Defined in: packages/core/src/agent/agent/http/index.ts:155
The maximum time a request can be delayed before being rejected.
Default
Section titled “Default”5 minuteslogToConsole?
Section titled “logToConsole?”
optionallogToConsole?:boolean
Defined in: packages/core/src/agent/agent/http/index.ts:193
Whether to log to the console. Defaults to false.
retryTimes?
Section titled “retryTimes?”
optionalretryTimes?:number
Defined in: packages/core/src/agent/agent/http/index.ts:174
Number of times to retry requests before throwing an error
Default
Section titled “Default”3rootKey?
Section titled “rootKey?”
optionalrootKey?:Uint8Array<ArrayBufferLike>
Defined in: packages/core/src/agent/agent/http/index.ts:198
Alternate root key to use for verifying certificates. If not provided, the default IC root key will be used.
shouldFetchRootKey?
Section titled “shouldFetchRootKey?”
optionalshouldFetchRootKey?:boolean
Defined in: packages/core/src/agent/agent/http/index.ts:203
Whether or not the root key should be automatically fetched during construction. Defaults to false.
shouldSyncTime?
Section titled “shouldSyncTime?”
optionalshouldSyncTime?:boolean
Defined in: packages/core/src/agent/agent/http/index.ts:208
Whether or not to sync the time with the network during construction. Defaults to false.
subnetNodeKeyExpirableStore?
Section titled “subnetNodeKeyExpirableStore?”
optionalsubnetNodeKeyExpirableStore?:ExpirableStore<SubnetNodeKeys>
Defined in: packages/core/src/agent/agent/http/index.ts:189
Custom store for caching subnet node keys. Allows sharing the cache across multiple HttpAgent instances. Defaults to IndexedDB in browser environments, in-memory otherwise.
useQueryNonces?
Section titled “useQueryNonces?”
optionaluseQueryNonces?:boolean
Defined in: packages/core/src/agent/agent/http/index.ts:169
Adds a unique Nonce with each query. Enabling will prevent queries from being answered with a cached response.
Example
Section titled “Example”const agent = new HttpAgent({ useQueryNonces: true });agent.addTransform(makeNonceTransform(makeNonce);Default
Section titled “Default”falseverifyQuerySignatures?
Section titled “verifyQuerySignatures?”
optionalverifyQuerySignatures?:boolean
Defined in: packages/core/src/agent/agent/http/index.ts:183
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
Section titled “Default”true