Skip to content

Overview

Defined in: packages/core/src/agent/agent/http/types.ts:8

Internal

Call: "call"

Defined in: packages/core/src/agent/agent/http/types.ts:11

Query: "read"

Defined in: packages/core/src/agent/agent/http/types.ts:9

ReadState: "read_state"

Defined in: packages/core/src/agent/agent/http/types.ts:10


Defined in: packages/core/src/agent/errors.ts:15

External: "External"

Defined in: packages/core/src/agent/errors.ts:20

Input: "Input"

Defined in: packages/core/src/agent/errors.ts:22

Limit: "Limit"

Defined in: packages/core/src/agent/errors.ts:21

Protocol: "Protocol"

Defined in: packages/core/src/agent/errors.ts:17

Reject: "Reject"

Defined in: packages/core/src/agent/errors.ts:18

Transport: "Transport"

Defined in: packages/core/src/agent/errors.ts:19

Trust: "Trust"

Defined in: packages/core/src/agent/errors.ts:16

Unknown: "Unknown"

Defined in: packages/core/src/agent/errors.ts:23


Defined in: packages/core/src/agent/errors.ts:55

Controls the level of detail included in error messages.

  • Normal (default): includes error message, call context, and HTTP details, but omits large binary fields (arg, certificate, nonce).
  • Verbose: same as Normal, but includes hex-encoded binary fields.

To enable verbose mode: ErrorCode.verbosity = ErrorVerbosity.Verbose

Normal: "normal"

Defined in: packages/core/src/agent/errors.ts:56

Verbose: "verbose"

Defined in: packages/core/src/agent/errors.ts:57


Defined in: packages/core/src/agent/certificate.ts:571

Absent: "Absent"

Defined in: packages/core/src/agent/certificate.ts:572

Found: "Found"

Defined in: packages/core/src/agent/certificate.ts:574

Greater: "Greater"

Defined in: packages/core/src/agent/certificate.ts:576

Less: "Less"

Defined in: packages/core/src/agent/certificate.ts:575

Unknown: "Unknown"

Defined in: packages/core/src/agent/certificate.ts:573


Defined in: packages/core/src/agent/certificate.ts:517

Absent: "Absent"

Defined in: packages/core/src/agent/certificate.ts:519

Error: "Error"

Defined in: packages/core/src/agent/certificate.ts:521

Found: "Found"

Defined in: packages/core/src/agent/certificate.ts:520

Unknown: "Unknown"

Defined in: packages/core/src/agent/certificate.ts:518


Defined in: packages/core/src/agent/certificate.ts:547

Absent: "Absent"

Defined in: packages/core/src/agent/certificate.ts:548

Found: "Found"

Defined in: packages/core/src/agent/certificate.ts:550

Unknown: "Unknown"

Defined in: packages/core/src/agent/certificate.ts:549


Defined in: packages/core/src/agent/certificate.ts:47

Empty: 0

Defined in: packages/core/src/agent/certificate.ts:48

Fork: 1

Defined in: packages/core/src/agent/certificate.ts:49

Labeled: 2

Defined in: packages/core/src/agent/certificate.ts:50

Leaf: 3

Defined in: packages/core/src/agent/certificate.ts:51

Pruned: 4

Defined in: packages/core/src/agent/certificate.ts:52


Defined in: packages/core/src/agent/agent/api.ts:35

Rejected: "rejected"

Defined in: packages/core/src/agent/agent/api.ts:37

Replied: "replied"

Defined in: packages/core/src/agent/agent/api.ts:36


Defined in: packages/core/src/agent/agent/http/types.ts:78

Query: "query"

Defined in: packages/core/src/agent/agent/http/types.ts:79

ReadState: "read_state"

Defined in: packages/core/src/agent/agent/http/types.ts:80


Defined in: packages/core/src/agent/agent/api.ts:12

Codes used by the replica for rejecting a message. See the interface spec.

CanisterError: 5

Defined in: packages/core/src/agent/agent/api.ts:17

CanisterReject: 4

Defined in: packages/core/src/agent/agent/api.ts:16

DestinationInvalid: 3

Defined in: packages/core/src/agent/agent/api.ts:15

SysFatal: 1

Defined in: packages/core/src/agent/agent/api.ts:13

SysTransient: 2

Defined in: packages/core/src/agent/agent/api.ts:14


Defined in: packages/core/src/agent/agent/http/types.ts:109

Possible values for the request status in the IC state tree.

https://internetcomputer.org/docs/references/ic-interface-spec#state-tree-request-status

Done: "done"

Defined in: packages/core/src/agent/agent/http/types.ts:121

The IC has pruned the response data but remembers the request to prevent replay attacks.

Processing: "processing"

Defined in: packages/core/src/agent/agent/http/types.ts:113

The initial effect of the call has happened or will happen.

Received: "received"

Defined in: packages/core/src/agent/agent/http/types.ts:111

The call has made it past the endpoint into the IC’s state.

Rejected: "rejected"

Defined in: packages/core/src/agent/agent/http/types.ts:117

The call failed; reject code and message are available at /request_status/<id>/reject_code and /request_status/<id>/reject_message.

Replied: "replied"

Defined in: packages/core/src/agent/agent/http/types.ts:115

The call completed successfully; the reply is available at /request_status/<id>/reply.

Unknown: "unknown"

Defined in: packages/core/src/agent/agent/http/types.ts:119

The request status path is absent from the state tree, the request is unknown to the IC (never received or pruned after expiry).


Defined in: packages/core/src/agent/agent/http/types.ts:73

Call: "call"

Defined in: packages/core/src/agent/agent/http/types.ts:74

Defined in: packages/core/src/agent/actor.ts:183

An actor base class. An actor is an object containing only functions that will return a promise. These functions are derived from the IDL definition.

protected new Actor(metadata): Actor

Defined in: packages/core/src/agent/actor.ts:350

ActorMetadata

Actor

static agentOf(actor): Agent | undefined

Defined in: packages/core/src/agent/actor.ts:189

Get the Agent class this Actor would call, or undefined if the Actor would use the default agent (global.ic.agent).

Actor

The actor to get the agent of.

Agent | undefined

static canisterIdOf(actor): Principal

Defined in: packages/core/src/agent/actor.ts:201

Actor

Principal

static createActor<T>(interfaceFactory, configuration): ActorSubclass<T>

Defined in: packages/core/src/agent/actor.ts:302

Creates an actor with the given interface factory and configuration.

The @icp-sdk/bindgen package can be used to generate the interface factory for your canister.

T = Record<string, ActorMethod<unknown[], unknown>>

InterfaceFactory

the interface factory for the actor, typically generated by the @icp-sdk/bindgen package

ActorConfig

the configuration for the actor

ActorSubclass<T>

an actor with the given interface factory and configuration

The Canister Environment Guide for more details on how to configure an actor using the canister environment.

Using the interface factory generated by the @icp-sdk/bindgen package:

import { Actor, HttpAgent } from '@icp-sdk/core/agent';
import { Principal } from '@icp-sdk/core/principal';
import { idlFactory } from './api/declarations/hello-world.did';
// For a convenient way to get the canister ID,
// see the https://js.icp.build/core/latest/canister-environment/ guide.
const canisterId = Principal.fromText('rrkah-fqaaa-aaaaa-aaaaq-cai');
const agent = await HttpAgent.create({
host: 'https://icp-api.io',
});
const actor = Actor.createActor(idlFactory, {
agent,
canisterId,
});
const response = await actor.greet('world');
console.log(response);

Using the createActor wrapper function generated by the @icp-sdk/bindgen package:

import { HttpAgent } from '@icp-sdk/core/agent';
import { Principal } from '@icp-sdk/core/principal';
import { createActor } from './api/hello-world';
// For a convenient way to get the canister ID,
// see the https://js.icp.build/core/latest/canister-environment/ guide.
const canisterId = Principal.fromText('rrkah-fqaaa-aaaaa-aaaaq-cai');
const agent = await HttpAgent.create({
host: 'https://icp-api.io',
});
const actor = createActor(canisterId, {
agent,
});
const response = await actor.greet('world');
console.log(response);

static createActorClass(interfaceFactory, options?): ActorConstructor

Defined in: packages/core/src/agent/actor.ts:205

InterfaceFactory

CreateActorClassOpts

ActorConstructor

static createActorWithExtendedDetails<T>(interfaceFactory, configuration, actorClassOptions?): ActorSubclass<ActorMethodMappedExtended<T>>

Defined in: packages/core/src/agent/actor.ts:335

Returns an actor with methods that return the http response details along with the result

T = Record<string, ActorMethod<unknown[], unknown>>

InterfaceFactory

the interface factory for the actor

ActorConfig

the configuration for the actor

CreateActorClassOpts = ...

options for the actor class extended details to return with the result

ActorSubclass<ActorMethodMappedExtended<T>>

static createActorWithHttpDetails<T>(interfaceFactory, configuration): ActorSubclass<ActorMethodMappedWithHttpDetails<T>>

Defined in: packages/core/src/agent/actor.ts:320

Returns an actor with methods that return the http response details along with the result

T = Record<string, ActorMethod<unknown[], unknown>>

InterfaceFactory

the interface factory for the actor

ActorConfig

the configuration for the actor

ActorSubclass<ActorMethodMappedWithHttpDetails<T>>

  • use createActor with actorClassOptions instead

static interfaceOf(actor): ServiceClass

Defined in: packages/core/src/agent/actor.ts:197

Get the interface of an actor, in the form of an instance of a Service.

Actor

The actor to get the interface of.

ServiceClass


Defined in: packages/core/src/agent/errors.ts:113

An error that happens in the Agent. This is the root of all errors and should be used everywhere in the Agent code (this package).

To know if the error is certified, use the isCertified getter.

  • Error

new AgentError(code, kind): AgentError

Defined in: packages/core/src/agent/errors.ts:140

ErrorCode

ErrorKindEnum

AgentError

Error.constructor

readonly cause: object

Defined in: packages/core/src/agent/errors.ts:116

code: ErrorCode

kind: ErrorKindEnum

Error.cause

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

Error.message

name: string = 'AgentError'

Defined in: packages/core/src/agent/errors.ts:114

Error.name

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

Error.stack

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Error.stackTraceLimit

get code(): ErrorCode

Defined in: packages/core/src/agent/errors.ts:118

ErrorCode

set code(code): void

Defined in: packages/core/src/agent/errors.ts:121

ErrorCode

void

get isCertified(): boolean

Defined in: packages/core/src/agent/errors.ts:136

Reads the isCertified property of the underlying error code.

boolean

true if the error is certified, false otherwise.

get kind(): ErrorKindEnum

Defined in: packages/core/src/agent/errors.ts:125

ErrorKindEnum

set kind(kind): void

Defined in: packages/core/src/agent/errors.ts:128

ErrorKindEnum

void

hasCode<C>(code): boolean

Defined in: packages/core/src/agent/errors.ts:146

C extends ErrorCode

(…args) => C

boolean

toString(): string

Defined in: packages/core/src/agent/errors.ts:150

Returns a string representation of an object.

string

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

Error.captureStackTrace

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Error.prepareStackTrace


Defined in: packages/core/src/agent/auth.ts:101

A General Identity object. This does not have to be a private key (for example, the Anonymous identity), but it must be able to transform request.

new AnonymousIdentity(): AnonymousIdentity

AnonymousIdentity

getPrincipal(): Principal

Defined in: packages/core/src/agent/auth.ts:102

Get the principal represented by this identity. Normally should be a Principal.selfAuthenticating().

Principal

Identity.getPrincipal

transformRequest(request): Promise<unknown>

Defined in: packages/core/src/agent/auth.ts:106

Transform a request into a signed version of the request. This is done last after the transforms on the body of a request. The returned object can be anything, but must be serializable to CBOR.

HttpAgentRequest

Promise<unknown>

Identity.transformRequest


Defined in: packages/core/src/agent/errors.ts:433

new CborDecodeErrorCode(error, input): CborDecodeErrorCode

Defined in: packages/core/src/agent/errors.ts:436

unknown

Uint8Array

CborDecodeErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly error: unknown

Defined in: packages/core/src/agent/errors.ts:437

readonly input: Uint8Array

Defined in: packages/core/src/agent/errors.ts:438

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'CborDecodeErrorCode'

Defined in: packages/core/src/agent/errors.ts:434

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:444

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:449

new CborEncodeErrorCode(error, value): CborEncodeErrorCode

Defined in: packages/core/src/agent/errors.ts:452

unknown

unknown

CborEncodeErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly error: unknown

Defined in: packages/core/src/agent/errors.ts:453

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'CborEncodeErrorCode'

Defined in: packages/core/src/agent/errors.ts:450

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly value: unknown

Defined in: packages/core/src/agent/errors.ts:454

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:460

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/certificate.ts:212

cert: Cert

Defined in: packages/core/src/agent/certificate.ts:213

lookup_path(path): LookupResult

Defined in: packages/core/src/agent/certificate.ts:274

Lookup a path in the certificate tree, using lookup_path.

NodePath

The path to lookup.

LookupResult

The result of the lookup.

lookup_subtree(path): SubtreeLookupResult

Defined in: packages/core/src/agent/certificate.ts:283

Lookup a subtree in the certificate tree, using lookup_subtree.

NodePath

The path to lookup.

SubtreeLookupResult

The result of the lookup.

static create(options): Promise<Certificate>

Defined in: packages/core/src/agent/certificate.ts:224

Create a new instance of a certificate, automatically verifying it.

CreateCertificateOptions

CreateCertificateOptions

Promise<Certificate>

if the verification of the certificate fails


Defined in: packages/core/src/agent/errors.ts:275

new CertificateHasTooManyDelegationsErrorCode(): CertificateHasTooManyDelegationsErrorCode

Defined in: packages/core/src/agent/errors.ts:278

CertificateHasTooManyDelegationsErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'CertificateHasTooManyDelegationsErrorCode'

Defined in: packages/core/src/agent/errors.ts:276

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:283

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:288

new CertificateNotAuthorizedErrorCode(canisterId, subnetId): CertificateNotAuthorizedErrorCode

Defined in: packages/core/src/agent/errors.ts:291

Principal

Principal

CertificateNotAuthorizedErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly canisterId: Principal

Defined in: packages/core/src/agent/errors.ts:292

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'CertificateNotAuthorizedErrorCode'

Defined in: packages/core/src/agent/errors.ts:289

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly subnetId: Principal

Defined in: packages/core/src/agent/errors.ts:293

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:299

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


CertificateNotAuthorizedForSubnetErrorCode

Section titled “CertificateNotAuthorizedForSubnetErrorCode”

Defined in: packages/core/src/agent/errors.ts:304

new CertificateNotAuthorizedForSubnetErrorCode(subnetId): CertificateNotAuthorizedForSubnetErrorCode

Defined in: packages/core/src/agent/errors.ts:307

Principal

CertificateNotAuthorizedForSubnetErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'CertificateNotAuthorizedForSubnetErrorCode'

Defined in: packages/core/src/agent/errors.ts:305

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly subnetId: Principal

Defined in: packages/core/src/agent/errors.ts:307

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:312

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:502

new CertificateOutdatedErrorCode(maxIngressExpiryInMinutes, requestId, retryTimes?): CertificateOutdatedErrorCode

Defined in: packages/core/src/agent/errors.ts:505

number

RequestId

number

CertificateOutdatedErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

readonly maxIngressExpiryInMinutes: number

Defined in: packages/core/src/agent/errors.ts:506

name: string = 'CertificateOutdatedErrorCode'

Defined in: packages/core/src/agent/errors.ts:503

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly requestId: RequestId

Defined in: packages/core/src/agent/errors.ts:507

readonly optional retryTimes?: number

Defined in: packages/core/src/agent/errors.ts:508

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:514

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:256

new CertificateTimeErrorCode(maxAgeInMinutes, certificateTime, currentTime, timeDiffMsecs, ageType): CertificateTimeErrorCode

Defined in: packages/core/src/agent/errors.ts:259

number

Date

Date

number

"past" | "future"

CertificateTimeErrorCode

ErrorCode.constructor

readonly ageType: "past" | "future"

Defined in: packages/core/src/agent/errors.ts:264

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly certificateTime: Date

Defined in: packages/core/src/agent/errors.ts:261

readonly currentTime: Date

Defined in: packages/core/src/agent/errors.ts:262

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

readonly maxAgeInMinutes: number

Defined in: packages/core/src/agent/errors.ts:260

name: string = 'CertificateTimeErrorCode'

Defined in: packages/core/src/agent/errors.ts:257

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly timeDiffMsecs: number

Defined in: packages/core/src/agent/errors.ts:263

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:270

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:236

new CertificateVerificationErrorCode(reason, error?): CertificateVerificationErrorCode

Defined in: packages/core/src/agent/errors.ts:239

string

unknown

CertificateVerificationErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly optional error?: unknown

Defined in: packages/core/src/agent/errors.ts:241

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'CertificateVerificationErrorCode'

Defined in: packages/core/src/agent/errors.ts:237

readonly reason: string

Defined in: packages/core/src/agent/errors.ts:240

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:247

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:523

new CertifiedRejectErrorCode(requestId, rejectCode, rejectMessage, rejectErrorCode): CertifiedRejectErrorCode

Defined in: packages/core/src/agent/errors.ts:526

RequestId

ReplicaRejectCode

string

string | undefined

CertifiedRejectErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'CertifiedRejectErrorCode'

Defined in: packages/core/src/agent/errors.ts:524

readonly rejectCode: ReplicaRejectCode

Defined in: packages/core/src/agent/errors.ts:528

readonly rejectErrorCode: string | undefined

Defined in: packages/core/src/agent/errors.ts:530

readonly rejectMessage: string

Defined in: packages/core/src/agent/errors.ts:529

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly requestId: RequestId

Defined in: packages/core/src/agent/errors.ts:527

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:536

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:683

new CreateHttpAgentErrorCode(): CreateHttpAgentErrorCode

Defined in: packages/core/src/agent/errors.ts:686

CreateHttpAgentErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'CreateHttpAgentErrorCode'

Defined in: packages/core/src/agent/errors.ts:684

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:691

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:407

new DerDecodeErrorCode(error): DerDecodeErrorCode

Defined in: packages/core/src/agent/errors.ts:410

string

DerDecodeErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly error: string

Defined in: packages/core/src/agent/errors.ts:410

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'DerDecodeErrorCode'

Defined in: packages/core/src/agent/errors.ts:408

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:415

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:391

new DerDecodeLengthMismatchErrorCode(expectedLength, actualLength): DerDecodeLengthMismatchErrorCode

Defined in: packages/core/src/agent/errors.ts:394

number

number

DerDecodeLengthMismatchErrorCode

ErrorCode.constructor

readonly actualLength: number

Defined in: packages/core/src/agent/errors.ts:396

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly expectedLength: number

Defined in: packages/core/src/agent/errors.ts:395

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'DerDecodeLengthMismatchErrorCode'

Defined in: packages/core/src/agent/errors.ts:392

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:402

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:420

new DerEncodeErrorCode(error): DerEncodeErrorCode

Defined in: packages/core/src/agent/errors.ts:423

string

DerEncodeErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly error: string

Defined in: packages/core/src/agent/errors.ts:423

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'DerEncodeErrorCode'

Defined in: packages/core/src/agent/errors.ts:421

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:428

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:359

new DerKeyLengthMismatchErrorCode(expectedLength, actualLength): DerKeyLengthMismatchErrorCode

Defined in: packages/core/src/agent/errors.ts:362

number

number

DerKeyLengthMismatchErrorCode

ErrorCode.constructor

readonly actualLength: number

Defined in: packages/core/src/agent/errors.ts:364

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly expectedLength: number

Defined in: packages/core/src/agent/errors.ts:363

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'DerKeyLengthMismatchErrorCode'

Defined in: packages/core/src/agent/errors.ts:360

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:370

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:375

new DerPrefixMismatchErrorCode(expectedPrefix, actualPrefix): DerPrefixMismatchErrorCode

Defined in: packages/core/src/agent/errors.ts:378

Uint8Array

Uint8Array

DerPrefixMismatchErrorCode

ErrorCode.constructor

readonly actualPrefix: Uint8Array

Defined in: packages/core/src/agent/errors.ts:380

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly expectedPrefix: Uint8Array

Defined in: packages/core/src/agent/errors.ts:379

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'DerPrefixMismatchErrorCode'

Defined in: packages/core/src/agent/errors.ts:376

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:386

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/public_key.ts:5

A Public Key implementation.

get derKey(): DerEncodedPublicKey

Defined in: packages/core/src/agent/public_key.ts:43

DerEncodedPublicKey

PublicKey.derKey

get rawKey(): Uint8Array

Defined in: packages/core/src/agent/public_key.ts:37

Uint8Array

PublicKey.rawKey

toDer(): DerEncodedPublicKey

Defined in: packages/core/src/agent/public_key.ts:58

DerEncodedPublicKey

PublicKey.toDer

toRaw(): Uint8Array

Defined in: packages/core/src/agent/public_key.ts:62

Uint8Array

PublicKey.toRaw

static from(key): Ed25519PublicKey

Defined in: packages/core/src/agent/public_key.ts:6

PublicKey

Ed25519PublicKey

static fromDer(derKey): Ed25519PublicKey

Defined in: packages/core/src/agent/public_key.ts:14

DerEncodedPublicKey

Ed25519PublicKey

static fromRaw(rawKey): Ed25519PublicKey

Defined in: packages/core/src/agent/public_key.ts:10

Uint8Array

Ed25519PublicKey


Defined in: packages/core/src/agent/errors.ts:933

new EmptyCookieErrorCode(expectedCookieName): EmptyCookieErrorCode

Defined in: packages/core/src/agent/errors.ts:936

string

EmptyCookieErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly expectedCookieName: string

Defined in: packages/core/src/agent/errors.ts:936

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'EmptyCookieErrorCode'

Defined in: packages/core/src/agent/errors.ts:934

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:941

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:74

new ErrorCode(isCertified?): ErrorCode

Defined in: packages/core/src/agent/errors.ts:80

boolean = false

ErrorCode

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

abstract toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:82

string

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string


Defined in: packages/core/src/agent/errors.ts:696

new ExcessiveSignaturesErrorCode(signatureCount, maxExpected): ExcessiveSignaturesErrorCode

Defined in: packages/core/src/agent/errors.ts:699

number

number

ExcessiveSignaturesErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

readonly maxExpected: number

Defined in: packages/core/src/agent/errors.ts:701

name: string = 'ExcessiveSignaturesErrorCode'

Defined in: packages/core/src/agent/errors.ts:697

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly signatureCount: number

Defined in: packages/core/src/agent/errors.ts:700

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:707

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/agent/http/expiry.ts:24

readonly _isExpiry: true = true

Defined in: packages/core/src/agent/agent/http/expiry.ts:25

toBigInt(): bigint

Defined in: packages/core/src/agent/agent/http/expiry.ts:56

bigint

toHash(): Uint8Array

Defined in: packages/core/src/agent/agent/http/expiry.ts:60

Uint8Array

toJSON(): JsonnableExpiry

Defined in: packages/core/src/agent/agent/http/expiry.ts:72

Serializes to JSON

JsonnableExpiry

a JSON object with a single key, JSON_KEY_EXPIRY, whose value is the expiry as a string

toString(): string

Defined in: packages/core/src/agent/agent/http/expiry.ts:64

string

static fromDeltaInMilliseconds(deltaInMs, clockDriftInMs?): Expiry

Defined in: packages/core/src/agent/agent/http/expiry.ts:39

Creates an Expiry object from a delta in milliseconds. The expiry is calculated as: current_time + delta + clock_drift The resulting expiry is then rounded:

  • If rounding down to the nearest minute still provides at least 60 seconds in the future, use minute precision
  • Otherwise, use second precision

number

The milliseconds to add to the current time.

number = 0

The milliseconds to add to the current time, typically the clock drift between IC network clock and the client’s clock. Defaults to 0 if not provided.

Expiry

The constructed Expiry object.

static fromJSON(input): Expiry

Defined in: packages/core/src/agent/agent/http/expiry.ts:81

Deserializes a JsonnableExpiry object from a JSON string.

string

The JSON string to deserialize.

Expiry

The deserialized Expiry object.

static isExpiry(other): other is Expiry

Defined in: packages/core/src/agent/agent/http/expiry.ts:96

unknown

other is Expiry


Defined in: packages/core/src/agent/errors.ts:891

new ExpiryJsonDeserializeErrorCode(error): ExpiryJsonDeserializeErrorCode

Defined in: packages/core/src/agent/errors.ts:894

string

ExpiryJsonDeserializeErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly error: string

Defined in: packages/core/src/agent/errors.ts:894

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'ExpiryJsonDeserializeErrorCode'

Defined in: packages/core/src/agent/errors.ts:892

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:899

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:200

  • ErrorKind

new ExternalError(code): ExternalError

Defined in: packages/core/src/agent/errors.ts:203

ErrorCode

ExternalError

ErrorKind.constructor

readonly cause: object

Defined in: packages/core/src/agent/errors.ts:116

code: ErrorCode

kind: ErrorKindEnum

ErrorKind.cause

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

ErrorKind.message

name: string = 'ExternalError'

Defined in: packages/core/src/agent/errors.ts:201

ErrorKind.name

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

ErrorKind.stack

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

ErrorKind.stackTraceLimit

get code(): ErrorCode

Defined in: packages/core/src/agent/errors.ts:118

ErrorCode

set code(code): void

Defined in: packages/core/src/agent/errors.ts:121

ErrorCode

void

ErrorKind.code

get isCertified(): boolean

Defined in: packages/core/src/agent/errors.ts:136

Reads the isCertified property of the underlying error code.

boolean

true if the error is certified, false otherwise.

ErrorKind.isCertified

get kind(): ErrorKindEnum

Defined in: packages/core/src/agent/errors.ts:125

ErrorKindEnum

set kind(kind): void

Defined in: packages/core/src/agent/errors.ts:128

ErrorKindEnum

void

ErrorKind.kind

hasCode<C>(code): boolean

Defined in: packages/core/src/agent/errors.ts:146

C extends ErrorCode

(…args) => C

boolean

ErrorKind.hasCode

toString(): string

Defined in: packages/core/src/agent/errors.ts:150

Returns a string representation of an object.

string

ErrorKind.toString

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

ErrorKind.captureStackTrace

static fromCode<C, E>(this, code): E

Defined in: packages/core/src/agent/errors.ts:156

C extends ErrorCode

E extends ErrorKind

(code) => E

C

E

ErrorKind.fromCode

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

ErrorKind.prepareStackTrace


Defined in: packages/core/src/agent/errors.ts:801

new HashTreeDecodeErrorCode(error): HashTreeDecodeErrorCode

Defined in: packages/core/src/agent/errors.ts:804

string

HashTreeDecodeErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly error: string

Defined in: packages/core/src/agent/errors.ts:804

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'HashTreeDecodeErrorCode'

Defined in: packages/core/src/agent/errors.ts:802

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:809

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:628

new HashValueErrorCode(value): HashValueErrorCode

Defined in: packages/core/src/agent/errors.ts:631

unknown

HashValueErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'HashValueErrorCode'

Defined in: packages/core/src/agent/errors.ts:629

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly value: unknown

Defined in: packages/core/src/agent/errors.ts:631

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:636

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:465

new HexDecodeErrorCode(error): HexDecodeErrorCode

Defined in: packages/core/src/agent/errors.ts:468

string

HexDecodeErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly error: string

Defined in: packages/core/src/agent/errors.ts:468

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'HexDecodeErrorCode'

Defined in: packages/core/src/agent/errors.ts:466

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:473

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/agent/http/index.ts:269

A HTTP agent allows users to interact with a client of the internet computer using the available methods. It exposes an API that closely follows the public view of the internet computer, and is not intended to be exposed directly to the majority of users due to its low-level interface. There is a pipeline to apply transformations to the request before sending it to the client. This is to decouple signature, nonce generation and other computations so that this class can stay as simple as possible while allowing extensions.

new HttpAgent(options?): HttpAgent

Defined in: packages/core/src/agent/agent/http/index.ts:311

HttpAgentOptions = {}

Options for the HttpAgent

HttpAgent

Use HttpAgent.create or HttpAgent.createSync instead

readonly _isAgent: true = true

Defined in: packages/core/src/agent/agent/http/index.ts:294

config: HttpAgentOptions = {}

Defined in: packages/core/src/agent/agent/http/index.ts:295

readonly host: URL

Defined in: packages/core/src/agent/agent/http/index.ts:283

log: ObservableLog

Defined in: packages/core/src/agent/agent/http/index.ts:297

rootKey: Uint8Array<ArrayBufferLike> | null

Defined in: packages/core/src/agent/agent/http/index.ts:270

Agent.rootKey

protected _transform(request): Promise<HttpAgentRequest>

Defined in: packages/core/src/agent/agent/http/index.ts:1668

HttpAgentRequest

Promise<HttpAgentRequest>

addTransform(type, fn, priority?): void

Defined in: packages/core/src/agent/agent/http/index.ts:444

"query" | "update"

HttpAgentRequestTransformFn

number = ...

void

call(canisterId, options, identity?): Promise<SubmitResponse>

Defined in: packages/core/src/agent/agent/http/index.ts:482

Makes a call to a canister method.

string | Principal

The ID of the canister to call. Can be a Principal or a string.

CallOptions

Options for the call.

Identity | Promise<Identity>

(Optional) The identity to use for the call. If not provided, the agent’s current identity will be used.

Promise<SubmitResponse>

A promise that resolves to the response of the call, including the request ID and response details.

Agent.call

createReadStateRequest(fields, identity?): Promise<any>

Defined in: packages/core/src/agent/agent/http/index.ts:1203

Create the request for the read state call. readState uses this internally. Useful to avoid signing the same request multiple times.

ReadStateOptions

Identity | Promise<Identity>

Promise<any>

Agent.createReadStateRequest

fetchRootKey(): Promise<Uint8Array<ArrayBufferLike>>

Defined in: packages/core/src/agent/agent/http/index.ts:1537

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.

Promise<Uint8Array<ArrayBufferLike>>

Agent.fetchRootKey

fetchSubnetKeys(canisterId): Promise<SubnetNodeKeys>

Defined in: packages/core/src/agent/agent/http/index.ts:1587

string | Principal

Promise<SubnetNodeKeys>

getPrincipal(): Promise<Principal>

Defined in: packages/core/src/agent/agent/http/index.ts:468

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.

Promise<Principal>

Agent.getPrincipal

getSubnetIdFromCanister(canisterId): Promise<Principal>

Defined in: packages/core/src/agent/agent/http/index.ts:1651

Returns the subnet ID for a given canister ID, by looking at the certificate delegation returned by the canister’s state obtained by requesting the /time path with readState.

string | Principal

The canister ID to get the subnet ID for.

Promise<Principal>

The subnet ID for the given canister ID.

getTimeDiffMsecs(): number

Defined in: packages/core/src/agent/agent/http/index.ts:1689

Returns the time difference in milliseconds between the IC network clock and the client’s clock, after the clock has been synced.

If the time has not been synced, returns 0.

number

hasSyncedTime(): boolean

Defined in: packages/core/src/agent/agent/http/index.ts:1696

Returns true if the time has been synced at least once with the IC network, false otherwise.

boolean

invalidateIdentity(): void

Defined in: packages/core/src/agent/agent/http/index.ts:1579

If an application needs to invalidate an identity under certain conditions, an Agent may expose an invalidateIdentity method. Invoking this method will set the inner identity used by the Agent to null.

A use case for this would be - after a certain period of inactivity, a secure application chooses to invalidate the identity of any HttpAgent instances. An invalid identity can be replaced by Agent.replaceIdentity

void

Agent.invalidateIdentity

isLocal(): boolean

Defined in: packages/core/src/agent/agent/http/index.ts:439

boolean

parseTimeFromResponse(response): number

Defined in: packages/core/src/agent/agent/http/index.ts:1358

Uint8Array

number

query(canisterId, fields, identity?): Promise<ApiQueryResponse>

Defined in: packages/core/src/agent/agent/http/index.ts:1016

Send a query call to a canister. See the interface spec.

string | Principal

The Principal of the Canister to send the query to. Sending a query to the management canister is not supported (as it has no meaning from an agent).

QueryFields

Identity | Promise<Identity>

Sender principal to use when sending the query.

Promise<ApiQueryResponse>

The response from the replica. The Promise will only reject when the communication failed. If the query itself failed but no protocol errors happened, the response will be of type QueryResponseRejected.

Agent.query

readState(canisterId, fields, _identity?, request?): Promise<ReadStateResponse>

Defined in: packages/core/src/agent/agent/http/index.ts:1239

Send a read state query to the replica. This includes a list of paths to return, and will return a Certificate. This will only reject on communication errors, but the certificate might contain less information than requested.

string | Principal

ReadStateOptions

Identity | Promise<Identity>

any

The request to send in case it has already been created.

Promise<ReadStateResponse>

Agent.readState

readSubnetState(subnetId, options): Promise<ReadStateResponse>

Defined in: packages/core/src/agent/agent/http/index.ts:1289

Reads the state of a subnet from the /api/v3/subnet/{subnetId}/read_state endpoint.

string | Principal

The ID of the subnet to read the state of. If you have a canister ID, you can use getSubnetIdFromCanister to get the subnet ID.

ReadStateOptions

The options for the read state request.

Promise<ReadStateResponse>

The response from the read state request.

replaceIdentity(identity): void

Defined in: packages/core/src/agent/agent/http/index.ts:1583

If an application needs to replace an identity under certain conditions, an Agent may expose a replaceIdentity method. Invoking this method will set the inner identity used by the Agent to a newly provided identity.

A use case for this would be - after authenticating using @icp-sdk/auth/client, you can replace the AnonymousIdentity of your Actor with a DelegationIdentity.

Actor.agentOf(defaultActor).replaceIdentity(await authClient.getIdentity());

Identity

void

Agent.replaceIdentity

status(): Promise<JsonObject>

Defined in: packages/core/src/agent/agent/http/index.ts:1518

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.

Promise<JsonObject>

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

Agent.status

syncTime(canisterIdOverride?): Promise<void>

Defined in: packages/core/src/agent/agent/http/index.ts:1398

Allows agent to sync its time with the network. Can be called during initialization or mid-lifecycle if the device’s clock has drifted away from the network time. This is necessary to set the Expiry for a request

Principal

Pass a canister ID if you need to sync the time with a particular subnet. Uses the ICP ledger canister by default.

Promise<void>

syncTimeWithSubnet(subnetId): Promise<void>

Defined in: packages/core/src/agent/agent/http/index.ts:1461

Allows agent to sync its time with the network.

Principal

Pass the subnet ID you need to sync the time with.

Promise<void>

update(canisterId, fields, pollingOptions?): Promise<UpdateResult>

Defined in: packages/core/src/agent/agent/http/index.ts:649

Executes an update call to a canister and returns the certified result.

string | Principal

The canister to call.

UpdateOptions

The call options (method name, arg, effective canister ID, optional nonce).

PollingOptions = {}

Optional polling configuration.

Promise<UpdateResult>

The certified result including the certificate, reply bytes, and raw certificate bytes.

Agent.update

static create(options?): Promise<HttpAgent>

Defined in: packages/core/src/agent/agent/http/index.ts:414

HttpAgentOptions = {}

Promise<HttpAgent>

static createSync(options?): HttpAgent

Defined in: packages/core/src/agent/agent/http/index.ts:410

HttpAgentOptions = {}

HttpAgent

static from(agent): Promise<HttpAgent>

Defined in: packages/core/src/agent/agent/http/index.ts:420

V1HttpAgentInterface | Pick<HttpAgent, "config">

Promise<HttpAgent>


Defined in: packages/core/src/agent/errors.ts:814

new HttpErrorCode(status, statusText, headers, bodyText?): HttpErrorCode

Defined in: packages/core/src/agent/errors.ts:817

number

string

HttpHeaderField[]

string

HttpErrorCode

ErrorCode.constructor

readonly optional bodyText?: string

Defined in: packages/core/src/agent/errors.ts:821

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly headers: HttpHeaderField[]

Defined in: packages/core/src/agent/errors.ts:820

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'HttpErrorCode'

Defined in: packages/core/src/agent/errors.ts:815

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly status: number

Defined in: packages/core/src/agent/errors.ts:818

readonly statusText: string

Defined in: packages/core/src/agent/errors.ts:819

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:827

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:852

new HttpFetchErrorCode(error): HttpFetchErrorCode

Defined in: packages/core/src/agent/errors.ts:855

unknown

HttpFetchErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly error: unknown

Defined in: packages/core/src/agent/errors.ts:855

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'HttpFetchErrorCode'

Defined in: packages/core/src/agent/errors.ts:853

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:860

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:839

new HttpV4ApiNotSupportedErrorCode(): HttpV4ApiNotSupportedErrorCode

Defined in: packages/core/src/agent/errors.ts:842

HttpV4ApiNotSupportedErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'HttpV4ApiNotSupportedErrorCode'

Defined in: packages/core/src/agent/errors.ts:840

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:847

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:641

new IdentityInvalidErrorCode(): IdentityInvalidErrorCode

Defined in: packages/core/src/agent/errors.ts:644

IdentityInvalidErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'IdentityInvalidErrorCode'

Defined in: packages/core/src/agent/errors.ts:642

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:649

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:654

new IngressExpiryInvalidErrorCode(message, providedIngressExpiryInMinutes): IngressExpiryInvalidErrorCode

Defined in: packages/core/src/agent/errors.ts:657

string

number

IngressExpiryInvalidErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

readonly message: string

Defined in: packages/core/src/agent/errors.ts:658

name: string = 'IngressExpiryInvalidErrorCode'

Defined in: packages/core/src/agent/errors.ts:655

readonly providedIngressExpiryInMinutes: number

Defined in: packages/core/src/agent/errors.ts:659

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:665

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:218

  • ErrorKind

new InputError(code): InputError

Defined in: packages/core/src/agent/errors.ts:221

ErrorCode

InputError

ErrorKind.constructor

readonly cause: object

Defined in: packages/core/src/agent/errors.ts:116

code: ErrorCode

kind: ErrorKindEnum

ErrorKind.cause

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

ErrorKind.message

name: string = 'InputError'

Defined in: packages/core/src/agent/errors.ts:219

ErrorKind.name

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

ErrorKind.stack

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

ErrorKind.stackTraceLimit

get code(): ErrorCode

Defined in: packages/core/src/agent/errors.ts:118

ErrorCode

set code(code): void

Defined in: packages/core/src/agent/errors.ts:121

ErrorCode

void

ErrorKind.code

get isCertified(): boolean

Defined in: packages/core/src/agent/errors.ts:136

Reads the isCertified property of the underlying error code.

boolean

true if the error is certified, false otherwise.

ErrorKind.isCertified

get kind(): ErrorKindEnum

Defined in: packages/core/src/agent/errors.ts:125

ErrorKindEnum

set kind(kind): void

Defined in: packages/core/src/agent/errors.ts:128

ErrorKindEnum

void

ErrorKind.kind

hasCode<C>(code): boolean

Defined in: packages/core/src/agent/errors.ts:146

C extends ErrorCode

(…args) => C

boolean

ErrorKind.hasCode

toString(): string

Defined in: packages/core/src/agent/errors.ts:150

Returns a string representation of an object.

string

ErrorKind.toString

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

ErrorKind.captureStackTrace

static fromCode<C, E>(this, code): E

Defined in: packages/core/src/agent/errors.ts:156

C extends ErrorCode

E extends ErrorKind

(code) => E

C

E

ErrorKind.fromCode

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

ErrorKind.prepareStackTrace


Defined in: packages/core/src/agent/errors.ts:878

new InvalidReadStateRequestErrorCode(request): InvalidReadStateRequestErrorCode

Defined in: packages/core/src/agent/errors.ts:881

unknown

InvalidReadStateRequestErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'InvalidReadStateRequestErrorCode'

Defined in: packages/core/src/agent/errors.ts:879

readonly request: unknown

Defined in: packages/core/src/agent/errors.ts:881

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:886

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:904

new InvalidRootKeyErrorCode(rootKey, expectedLength): InvalidRootKeyErrorCode

Defined in: packages/core/src/agent/errors.ts:907

Uint8Array

number

InvalidRootKeyErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly expectedLength: number

Defined in: packages/core/src/agent/errors.ts:909

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'InvalidRootKeyErrorCode'

Defined in: packages/core/src/agent/errors.ts:905

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly rootKey: Uint8Array

Defined in: packages/core/src/agent/errors.ts:908

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:915

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:209

  • ErrorKind

new LimitError(code): LimitError

Defined in: packages/core/src/agent/errors.ts:212

ErrorCode

LimitError

ErrorKind.constructor

readonly cause: object

Defined in: packages/core/src/agent/errors.ts:116

code: ErrorCode

kind: ErrorKindEnum

ErrorKind.cause

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

ErrorKind.message

name: string = 'LimitError'

Defined in: packages/core/src/agent/errors.ts:210

ErrorKind.name

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

ErrorKind.stack

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

ErrorKind.stackTraceLimit

get code(): ErrorCode

Defined in: packages/core/src/agent/errors.ts:118

ErrorCode

set code(code): void

Defined in: packages/core/src/agent/errors.ts:121

ErrorCode

void

ErrorKind.code

get isCertified(): boolean

Defined in: packages/core/src/agent/errors.ts:136

Reads the isCertified property of the underlying error code.

boolean

true if the error is certified, false otherwise.

ErrorKind.isCertified

get kind(): ErrorKindEnum

Defined in: packages/core/src/agent/errors.ts:125

ErrorKindEnum

set kind(kind): void

Defined in: packages/core/src/agent/errors.ts:128

ErrorKindEnum

void

ErrorKind.kind

hasCode<C>(code): boolean

Defined in: packages/core/src/agent/errors.ts:146

C extends ErrorCode

(…args) => C

boolean

ErrorKind.hasCode

toString(): string

Defined in: packages/core/src/agent/errors.ts:150

Returns a string representation of an object.

string

ErrorKind.toString

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

ErrorKind.captureStackTrace

static fromCode<C, E>(this, code): E

Defined in: packages/core/src/agent/errors.ts:156

C extends ErrorCode

E extends ErrorKind

(code) => E

C

E

ErrorKind.fromCode

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

ErrorKind.prepareStackTrace


Defined in: packages/core/src/agent/errors.ts:317

new LookupErrorCode(message, lookupStatus): LookupErrorCode

Defined in: packages/core/src/agent/errors.ts:320

string

LookupSubtreeStatus | LookupPathStatus

LookupErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

readonly lookupStatus: LookupSubtreeStatus | LookupPathStatus

Defined in: packages/core/src/agent/errors.ts:322

readonly message: string

Defined in: packages/core/src/agent/errors.ts:321

name: string = 'LookupErrorCode'

Defined in: packages/core/src/agent/errors.ts:318

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:328

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:333

new MalformedLookupFoundValueErrorCode(message): MalformedLookupFoundValueErrorCode

Defined in: packages/core/src/agent/errors.ts:336

string

MalformedLookupFoundValueErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

readonly message: string

Defined in: packages/core/src/agent/errors.ts:336

name: string = 'MalformedLookupFoundValueErrorCode'

Defined in: packages/core/src/agent/errors.ts:334

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:341

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:738

new MalformedPublicKeyErrorCode(): MalformedPublicKeyErrorCode

Defined in: packages/core/src/agent/errors.ts:741

MalformedPublicKeyErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'MalformedPublicKeyErrorCode'

Defined in: packages/core/src/agent/errors.ts:739

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:746

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:712

new MalformedSignatureErrorCode(error): MalformedSignatureErrorCode

Defined in: packages/core/src/agent/errors.ts:715

string

MalformedSignatureErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly error: string

Defined in: packages/core/src/agent/errors.ts:715

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'MalformedSignatureErrorCode'

Defined in: packages/core/src/agent/errors.ts:713

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:720

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:865

new MissingCanisterIdErrorCode(receivedCanisterId): MissingCanisterIdErrorCode

Defined in: packages/core/src/agent/errors.ts:868

unknown

MissingCanisterIdErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'MissingCanisterIdErrorCode'

Defined in: packages/core/src/agent/errors.ts:866

readonly receivedCanisterId: unknown

Defined in: packages/core/src/agent/errors.ts:868

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:873

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:920

new MissingCookieErrorCode(expectedCookieName): MissingCookieErrorCode

Defined in: packages/core/src/agent/errors.ts:923

string

MissingCookieErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly expectedCookieName: string

Defined in: packages/core/src/agent/errors.ts:923

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'MissingCookieErrorCode'

Defined in: packages/core/src/agent/errors.ts:921

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:928

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:670

new MissingFetchErrorCode(): MissingFetchErrorCode

Defined in: packages/core/src/agent/errors.ts:673

MissingFetchErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'MissingFetchErrorCode'

Defined in: packages/core/src/agent/errors.ts:671

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:678

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:346

new MissingLookupValueErrorCode(message): MissingLookupValueErrorCode

Defined in: packages/core/src/agent/errors.ts:349

string

MissingLookupValueErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

readonly message: string

Defined in: packages/core/src/agent/errors.ts:349

name: string = 'MissingLookupValueErrorCode'

Defined in: packages/core/src/agent/errors.ts:347

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:354

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:612

new MissingRootKeyErrorCode(shouldFetchRootKey?): MissingRootKeyErrorCode

Defined in: packages/core/src/agent/errors.ts:615

boolean

MissingRootKeyErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'MissingRootKeyErrorCode'

Defined in: packages/core/src/agent/errors.ts:613

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly optional shouldFetchRootKey?: boolean

Defined in: packages/core/src/agent/errors.ts:615

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:620

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:725

new MissingSignatureErrorCode(): MissingSignatureErrorCode

Defined in: packages/core/src/agent/errors.ts:728

MissingSignatureErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'MissingSignatureErrorCode'

Defined in: packages/core/src/agent/errors.ts:726

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:733

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/observable.ts:5

T

new Observable<T>(): Observable<T>

Defined in: packages/core/src/agent/observable.ts:8

Observable<T>

observers: ObserveFunction<T>[]

Defined in: packages/core/src/agent/observable.ts:6

notify(data, …rest): void

Defined in: packages/core/src/agent/observable.ts:20

T

unknown[]

void

subscribe(func): void

Defined in: packages/core/src/agent/observable.ts:12

ObserveFunction<T>

void

unsubscribe(func): void

Defined in: packages/core/src/agent/observable.ts:16

ObserveFunction<T>

void


Defined in: packages/core/src/agent/observable.ts:36

new ObservableLog(): ObservableLog

Defined in: packages/core/src/agent/observable.ts:37

ObservableLog

Observable.constructor

observers: ObserveFunction<AgentLog>[]

Defined in: packages/core/src/agent/observable.ts:6

Observable.observers

error(message, error, …rest): void

Defined in: packages/core/src/agent/observable.ts:46

string

AgentError

unknown[]

void

notify(data, …rest): void

Defined in: packages/core/src/agent/observable.ts:20

AgentLog

unknown[]

void

Observable.notify

print(message, …rest): void

Defined in: packages/core/src/agent/observable.ts:40

string

unknown[]

void

subscribe(func): void

Defined in: packages/core/src/agent/observable.ts:12

ObserveFunction<AgentLog>

void

Observable.subscribe

unsubscribe(func): void

Defined in: packages/core/src/agent/observable.ts:16

ObserveFunction<AgentLog>

void

Observable.unsubscribe

warn(message, …rest): void

Defined in: packages/core/src/agent/observable.ts:43

string

unknown[]

void


Defined in: packages/core/src/agent/errors.ts:173

  • ErrorKind

new ProtocolError(code): ProtocolError

Defined in: packages/core/src/agent/errors.ts:176

ErrorCode

ProtocolError

ErrorKind.constructor

readonly cause: object

Defined in: packages/core/src/agent/errors.ts:116

code: ErrorCode

kind: ErrorKindEnum

ErrorKind.cause

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

ErrorKind.message

name: string = 'ProtocolError'

Defined in: packages/core/src/agent/errors.ts:174

ErrorKind.name

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

ErrorKind.stack

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

ErrorKind.stackTraceLimit

get code(): ErrorCode

Defined in: packages/core/src/agent/errors.ts:118

ErrorCode

set code(code): void

Defined in: packages/core/src/agent/errors.ts:121

ErrorCode

void

ErrorKind.code

get isCertified(): boolean

Defined in: packages/core/src/agent/errors.ts:136

Reads the isCertified property of the underlying error code.

boolean

true if the error is certified, false otherwise.

ErrorKind.isCertified

get kind(): ErrorKindEnum

Defined in: packages/core/src/agent/errors.ts:125

ErrorKindEnum

set kind(kind): void

Defined in: packages/core/src/agent/errors.ts:128

ErrorKindEnum

void

ErrorKind.kind

hasCode<C>(code): boolean

Defined in: packages/core/src/agent/errors.ts:146

C extends ErrorCode

(…args) => C

boolean

ErrorKind.hasCode

toString(): string

Defined in: packages/core/src/agent/errors.ts:150

Returns a string representation of an object.

string

ErrorKind.toString

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

ErrorKind.captureStackTrace

static fromCode<C, E>(this, code): E

Defined in: packages/core/src/agent/errors.ts:156

C extends ErrorCode

E extends ErrorKind

(code) => E

C

E

ErrorKind.fromCode

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

ErrorKind.prepareStackTrace


Defined in: packages/core/src/agent/errors.ts:751

new QuerySignatureVerificationFailedErrorCode(nodeId): QuerySignatureVerificationFailedErrorCode

Defined in: packages/core/src/agent/errors.ts:754

string

QuerySignatureVerificationFailedErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'QuerySignatureVerificationFailedErrorCode'

Defined in: packages/core/src/agent/errors.ts:752

readonly nodeId: string

Defined in: packages/core/src/agent/errors.ts:754

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:759

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:182

  • ErrorKind

new RejectError(code): RejectError

Defined in: packages/core/src/agent/errors.ts:185

ErrorCode

RejectError

ErrorKind.constructor

readonly cause: object

Defined in: packages/core/src/agent/errors.ts:116

code: ErrorCode

kind: ErrorKindEnum

ErrorKind.cause

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

ErrorKind.message

name: string = 'RejectError'

Defined in: packages/core/src/agent/errors.ts:183

ErrorKind.name

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

ErrorKind.stack

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

ErrorKind.stackTraceLimit

get code(): ErrorCode

Defined in: packages/core/src/agent/errors.ts:118

ErrorCode

set code(code): void

Defined in: packages/core/src/agent/errors.ts:121

ErrorCode

void

ErrorKind.code

get isCertified(): boolean

Defined in: packages/core/src/agent/errors.ts:136

Reads the isCertified property of the underlying error code.

boolean

true if the error is certified, false otherwise.

ErrorKind.isCertified

get kind(): ErrorKindEnum

Defined in: packages/core/src/agent/errors.ts:125

ErrorKindEnum

set kind(kind): void

Defined in: packages/core/src/agent/errors.ts:128

ErrorKindEnum

void

ErrorKind.kind

hasCode<C>(code): boolean

Defined in: packages/core/src/agent/errors.ts:146

C extends ErrorCode

(…args) => C

boolean

ErrorKind.hasCode

toString(): string

Defined in: packages/core/src/agent/errors.ts:150

Returns a string representation of an object.

string

ErrorKind.toString

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

ErrorKind.captureStackTrace

static fromCode<C, E>(this, code): E

Defined in: packages/core/src/agent/errors.ts:156

C extends ErrorCode

E extends ErrorKind

(code) => E

C

E

ErrorKind.fromCode

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

ErrorKind.prepareStackTrace


Defined in: packages/core/src/agent/errors.ts:596

new RequestStatusDoneNoReplyErrorCode(requestId): RequestStatusDoneNoReplyErrorCode

Defined in: packages/core/src/agent/errors.ts:599

RequestId

RequestStatusDoneNoReplyErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'RequestStatusDoneNoReplyErrorCode'

Defined in: packages/core/src/agent/errors.ts:597

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly requestId: RequestId

Defined in: packages/core/src/agent/errors.ts:599

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:604

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/auth.ts:57

An Identity that can sign blobs.

new SignIdentity(): SignIdentity

SignIdentity

protected _principal: Principal | undefined

Defined in: packages/core/src/agent/auth.ts:58

getPrincipal(): Principal

Defined in: packages/core/src/agent/auth.ts:74

Get the principal represented by this identity. Normally should be a Principal.selfAuthenticating().

Principal

Identity.getPrincipal

abstract getPublicKey(): PublicKey

Defined in: packages/core/src/agent/auth.ts:63

Returns the public key that would match this identity’s signature.

PublicKey

abstract sign(blob): Promise<Signature>

Defined in: packages/core/src/agent/auth.ts:68

Signs a blob of data, with this identity’s private key.

Uint8Array

Promise<Signature>

transformRequest(request): Promise<unknown>

Defined in: packages/core/src/agent/auth.ts:87

Transform a request into a signed version of the request. This is done last after the transforms on the body of a request. The returned object can be anything, but must be serializable to CBOR.

HttpAgentRequest

internet computer request to transform

Promise<unknown>

Identity.transformRequest


Defined in: packages/core/src/agent/errors.ts:478

new TimeoutWaitingForResponseErrorCode(message, requestId?, status?): TimeoutWaitingForResponseErrorCode

Defined in: packages/core/src/agent/errors.ts:481

string

RequestId

RequestStatusResponseStatus

TimeoutWaitingForResponseErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

readonly message: string

Defined in: packages/core/src/agent/errors.ts:482

name: string = 'TimeoutWaitingForResponseErrorCode'

Defined in: packages/core/src/agent/errors.ts:479

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly optional requestId?: RequestId

Defined in: packages/core/src/agent/errors.ts:483

readonly optional status?: RequestStatusResponseStatus

Defined in: packages/core/src/agent/errors.ts:484

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:490

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/cbor.ts:9

Used to extend classes that need to provide a custom value for the CBOR encoding process.

new ToCborValue(): ToCborValue

ToCborValue

abstract toCborValue(): any

Defined in: packages/core/src/agent/cbor.ts:13

Returns a value that can be encoded with CBOR. Typically called in the replacer function of the encode function.

any


Defined in: packages/core/src/agent/errors.ts:191

  • ErrorKind

new TransportError(code): TransportError

Defined in: packages/core/src/agent/errors.ts:194

ErrorCode

TransportError

ErrorKind.constructor

readonly cause: object

Defined in: packages/core/src/agent/errors.ts:116

code: ErrorCode

kind: ErrorKindEnum

ErrorKind.cause

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

ErrorKind.message

name: string = 'TransportError'

Defined in: packages/core/src/agent/errors.ts:192

ErrorKind.name

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

ErrorKind.stack

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

ErrorKind.stackTraceLimit

get code(): ErrorCode

Defined in: packages/core/src/agent/errors.ts:118

ErrorCode

set code(code): void

Defined in: packages/core/src/agent/errors.ts:121

ErrorCode

void

ErrorKind.code

get isCertified(): boolean

Defined in: packages/core/src/agent/errors.ts:136

Reads the isCertified property of the underlying error code.

boolean

true if the error is certified, false otherwise.

ErrorKind.isCertified

get kind(): ErrorKindEnum

Defined in: packages/core/src/agent/errors.ts:125

ErrorKindEnum

set kind(kind): void

Defined in: packages/core/src/agent/errors.ts:128

ErrorKindEnum

void

ErrorKind.kind

hasCode<C>(code): boolean

Defined in: packages/core/src/agent/errors.ts:146

C extends ErrorCode

(…args) => C

boolean

ErrorKind.hasCode

toString(): string

Defined in: packages/core/src/agent/errors.ts:150

Returns a string representation of an object.

string

ErrorKind.toString

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

ErrorKind.captureStackTrace

static fromCode<C, E>(this, code): E

Defined in: packages/core/src/agent/errors.ts:156

C extends ErrorCode

E extends ErrorKind

(code) => E

C

E

ErrorKind.fromCode

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

ErrorKind.prepareStackTrace


Defined in: packages/core/src/agent/errors.ts:164

  • ErrorKind

new TrustError(code): TrustError

Defined in: packages/core/src/agent/errors.ts:167

ErrorCode

TrustError

ErrorKind.constructor

readonly cause: object

Defined in: packages/core/src/agent/errors.ts:116

code: ErrorCode

kind: ErrorKindEnum

ErrorKind.cause

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

ErrorKind.message

name: string = 'TrustError'

Defined in: packages/core/src/agent/errors.ts:165

ErrorKind.name

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

ErrorKind.stack

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

ErrorKind.stackTraceLimit

get code(): ErrorCode

Defined in: packages/core/src/agent/errors.ts:118

ErrorCode

set code(code): void

Defined in: packages/core/src/agent/errors.ts:121

ErrorCode

void

ErrorKind.code

get isCertified(): boolean

Defined in: packages/core/src/agent/errors.ts:136

Reads the isCertified property of the underlying error code.

boolean

true if the error is certified, false otherwise.

ErrorKind.isCertified

get kind(): ErrorKindEnum

Defined in: packages/core/src/agent/errors.ts:125

ErrorKindEnum

set kind(kind): void

Defined in: packages/core/src/agent/errors.ts:128

ErrorKindEnum

void

ErrorKind.kind

hasCode<C>(code): boolean

Defined in: packages/core/src/agent/errors.ts:146

C extends ErrorCode

(…args) => C

boolean

ErrorKind.hasCode

toString(): string

Defined in: packages/core/src/agent/errors.ts:150

Returns a string representation of an object.

string

ErrorKind.toString

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

ErrorKind.captureStackTrace

static fromCode<C, E>(this, code): E

Defined in: packages/core/src/agent/errors.ts:156

C extends ErrorCode

E extends ErrorKind

(code) => E

C

E

ErrorKind.fromCode

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

ErrorKind.prepareStackTrace


Defined in: packages/core/src/agent/errors.ts:547

new UncertifiedRejectErrorCode(requestId, rejectCode, rejectMessage, rejectErrorCode, signatures): UncertifiedRejectErrorCode

Defined in: packages/core/src/agent/errors.ts:550

RequestId

ReplicaRejectCode

string

string | undefined

NodeSignature[] | undefined

UncertifiedRejectErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'UncertifiedRejectErrorCode'

Defined in: packages/core/src/agent/errors.ts:548

readonly rejectCode: ReplicaRejectCode

Defined in: packages/core/src/agent/errors.ts:552

readonly rejectErrorCode: string | undefined

Defined in: packages/core/src/agent/errors.ts:554

readonly rejectMessage: string

Defined in: packages/core/src/agent/errors.ts:553

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly requestId: RequestId

Defined in: packages/core/src/agent/errors.ts:551

readonly signatures: NodeSignature[] | undefined

Defined in: packages/core/src/agent/errors.ts:555

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:561

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:572

new UncertifiedRejectUpdateErrorCode(requestId, rejectCode, rejectMessage, rejectErrorCode): UncertifiedRejectUpdateErrorCode

Defined in: packages/core/src/agent/errors.ts:575

RequestId

ReplicaRejectCode

string

string | undefined

UncertifiedRejectUpdateErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'UncertifiedRejectUpdateErrorCode'

Defined in: packages/core/src/agent/errors.ts:573

readonly rejectCode: ReplicaRejectCode

Defined in: packages/core/src/agent/errors.ts:577

readonly rejectErrorCode: string | undefined

Defined in: packages/core/src/agent/errors.ts:579

readonly rejectMessage: string

Defined in: packages/core/src/agent/errors.ts:578

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly requestId: RequestId

Defined in: packages/core/src/agent/errors.ts:576

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:585

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:764

new UnexpectedErrorCode(error): UnexpectedErrorCode

Defined in: packages/core/src/agent/errors.ts:767

unknown

UnexpectedErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly error: unknown

Defined in: packages/core/src/agent/errors.ts:767

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'UnexpectedErrorCode'

Defined in: packages/core/src/agent/errors.ts:765

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:772

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:777

new UnexpectedV4StatusErrorCode(status, requestId, response, rawCertificate): UnexpectedV4StatusErrorCode

Defined in: packages/core/src/agent/errors.ts:780

string | undefined

RequestId

v2ResponseBody | v4ResponseBody | null

HttpHeaderField[]

boolean

number

string

Uint8Array

UnexpectedV4StatusErrorCode

ErrorCode.constructor

optional callContext?: CallContext | PollingCallContext

Defined in: packages/core/src/agent/errors.ts:78

ErrorCode.callContext

readonly isCertified: boolean = false

Defined in: packages/core/src/agent/errors.ts:80

ErrorCode.isCertified

name: string = 'UnexpectedV4StatusErrorCode'

Defined in: packages/core/src/agent/errors.ts:778

readonly rawCertificate: Uint8Array

Defined in: packages/core/src/agent/errors.ts:784

optional requestContext?: RequestContext

Defined in: packages/core/src/agent/errors.ts:77

ErrorCode.requestContext

readonly requestId: RequestId

Defined in: packages/core/src/agent/errors.ts:782

readonly response: object

Defined in: packages/core/src/agent/errors.ts:783

body: v2ResponseBody | v4ResponseBody | null

headers: HttpHeaderField[]

ok: boolean

status: number

statusText: string

readonly status: string | undefined

Defined in: packages/core/src/agent/errors.ts:781

static verbosity: ErrorVerbosity = ErrorVerbosity.Normal

Defined in: packages/core/src/agent/errors.ts:75

ErrorCode.verbosity

toErrorMessage(): string

Defined in: packages/core/src/agent/errors.ts:790

string

ErrorCode.toErrorMessage

toString(): string

Defined in: packages/core/src/agent/errors.ts:84

string

ErrorCode.toString


Defined in: packages/core/src/agent/errors.ts:227

  • ErrorKind

new UnknownError(code): UnknownError

Defined in: packages/core/src/agent/errors.ts:230

ErrorCode

UnknownError

ErrorKind.constructor

readonly cause: object

Defined in: packages/core/src/agent/errors.ts:116

code: ErrorCode

kind: ErrorKindEnum

ErrorKind.cause

message: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077

ErrorKind.message

name: string = 'UnknownError'

Defined in: packages/core/src/agent/errors.ts:228

ErrorKind.name

optional stack?: string

Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078

ErrorKind.stack

static stackTraceLimit: number

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

ErrorKind.stackTraceLimit

get code(): ErrorCode

Defined in: packages/core/src/agent/errors.ts:118

ErrorCode

set code(code): void

Defined in: packages/core/src/agent/errors.ts:121

ErrorCode

void

ErrorKind.code

get isCertified(): boolean

Defined in: packages/core/src/agent/errors.ts:136

Reads the isCertified property of the underlying error code.

boolean

true if the error is certified, false otherwise.

ErrorKind.isCertified

get kind(): ErrorKindEnum

Defined in: packages/core/src/agent/errors.ts:125

ErrorKindEnum

set kind(kind): void

Defined in: packages/core/src/agent/errors.ts:128

ErrorKindEnum

void

ErrorKind.kind

hasCode<C>(code): boolean

Defined in: packages/core/src/agent/errors.ts:146

C extends ErrorCode

(…args) => C

boolean

ErrorKind.hasCode

toString(): string

Defined in: packages/core/src/agent/errors.ts:150

Returns a string representation of an object.

string

ErrorKind.toString

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

ErrorKind.captureStackTrace

static fromCode<C, E>(this, code): E

Defined in: packages/core/src/agent/errors.ts:156

C extends ErrorCode

E extends ErrorKind

(code) => E

C

E

ErrorKind.fromCode

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/.pnpm/@types+node@25.5.0/node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

ErrorKind.prepareStackTrace

Defined in: packages/core/src/agent/actor.ts:61

Configuration that can be passed to customize the Actor behavior.

  • Pick<CallConfig, "agent" | "effectiveCanisterId">

optional agent?: Agent

Defined in: packages/core/src/agent/actor.ts:35

An agent to use in this call, otherwise the actor or call will try to discover the agent to use.

CallConfig.agent

optional blsVerify?: VerifyFunc

Defined in: packages/core/src/agent/actor.ts:88

Polyfill for BLS Certificate verification in case wasm is not supported

canisterId: string | Principal

Defined in: packages/core/src/agent/actor.ts:65

The Canister ID of this Actor. This is required for an Actor.

optional effectiveCanisterId?: Principal

Defined in: packages/core/src/agent/actor.ts:50

The effective canister ID.

CallConfig.effectiveCanisterId

optional pollingOptions?: PollingOptions

Defined in: packages/core/src/agent/actor.ts:93

Polling options to use when making update calls. This will override the default DEFAULT_POLLING_OPTIONS.

optional queryStrategy?: QueryStrategy

Defined in: packages/core/src/agent/actor.ts:101

Controls how query and composite_query methods are executed.

  • 'query' (default) — standard non-replicated query call.
  • 'update' — send query methods as update calls that go through consensus.
'query'

optional callTransform(methodName, args, callConfig): void | Partial<CallConfig>

Defined in: packages/core/src/agent/actor.ts:70

An override function for update calls’ CallConfig. This will be called on every calls.

string

unknown[]

CallConfig

void | Partial<CallConfig>

optional queryTransform(methodName, args, callConfig): void | Partial<CallConfig>

Defined in: packages/core/src/agent/actor.ts:79

An override function for query calls’ CallConfig. This will be called on every query.

string

unknown[]

CallConfig

void | Partial<CallConfig>


Defined in: packages/core/src/agent/actor.ts:113

An actor method type, defined for each methods of the actor service.

Args extends unknown[] = unknown[]

Ret = unknown

ActorMethod(…args): Promise<Ret>

Defined in: packages/core/src/agent/actor.ts:114

An actor method type, defined for each methods of the actor service.

Args

Promise<Ret>

withOptions(options): (…args) => Promise<Ret>

Defined in: packages/core/src/agent/actor.ts:116

CallConfig

(…args) => Promise<Ret>


Defined in: packages/core/src/agent/actor.ts:132

An actor method type, defined for each methods of the actor service.

Args extends unknown[] = unknown[]

Ret = unknown

ActorMethodExtended(…args): Promise<{ certificate?: Certificate; httpDetails?: HttpDetailsResponse; result: Ret; }>

Defined in: packages/core/src/agent/actor.ts:136

An actor method type, defined for each methods of the actor service.

Args

Promise<{ certificate?: Certificate; httpDetails?: HttpDetailsResponse; result: Ret; }>

ActorMethodExtended(…args): Promise<unknown>

Defined in: packages/core/src/agent/actor.ts:132

An actor method type, defined for each methods of the actor service.

unknown[]

Promise<unknown>

withOptions(options): (…args) => Promise<unknown>

Defined in: packages/core/src/agent/actor.ts:116

CallConfig

(…args) => Promise<unknown>

ActorMethod.withOptions


Defined in: packages/core/src/agent/actor.ts:122

An actor method type, defined for each methods of the actor service.

Args extends unknown[] = unknown[]

Ret = unknown

ActorMethodWithHttpDetails(…args): Promise<{ httpDetails: HttpDetailsResponse; result: Ret; }>

Defined in: packages/core/src/agent/actor.ts:126

An actor method type, defined for each methods of the actor service.

Args

Promise<{ httpDetails: HttpDetailsResponse; result: Ret; }>

ActorMethodWithHttpDetails(…args): Promise<unknown>

Defined in: packages/core/src/agent/actor.ts:122

An actor method type, defined for each methods of the actor service.

unknown[]

Promise<unknown>

withOptions(options): (…args) => Promise<unknown>

Defined in: packages/core/src/agent/actor.ts:116

CallConfig

(…args) => Promise<unknown>

ActorMethod.withOptions


Defined in: packages/core/src/agent/agent/api.ts:206

An Agent able to make calls and queries to a Replica.

readonly rootKey: Uint8Array<ArrayBufferLike> | null

Defined in: packages/core/src/agent/agent/api.ts:207

call(canisterId, fields): Promise<SubmitResponse>

Defined in: packages/core/src/agent/agent/api.ts:238

string | Principal

CallOptions

Promise<SubmitResponse>

optional createReadStateRequest(options, identity?): Promise<unknown>

Defined in: packages/core/src/agent/agent/api.ts:220

Create the request for the read state call. readState uses this internally. Useful to avoid signing the same request multiple times.

ReadStateOptions

Identity

Promise<unknown>

fetchRootKey(): Promise<Uint8Array<ArrayBufferLike>>

Defined in: packages/core/src/agent/agent/api.ts:291

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.

Promise<Uint8Array<ArrayBufferLike>>

getPrincipal(): Promise<Principal>

Defined in: packages/core/src/agent/agent/api.ts:213

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.

Promise<Principal>

optional invalidateIdentity(): void

Defined in: packages/core/src/agent/agent/api.ts:298

If an application needs to invalidate an identity under certain conditions, an Agent may expose an invalidateIdentity method. Invoking this method will set the inner identity used by the Agent to null.

A use case for this would be - after a certain period of inactivity, a secure application chooses to invalidate the identity of any HttpAgent instances. An invalid identity can be replaced by Agent.replaceIdentity

void

query(canisterId, options, identity?): Promise<ApiQueryResponse>

Defined in: packages/core/src/agent/agent/api.ts:273

Send a query call to a canister. See the interface spec.

string | Principal

The Principal of the Canister to send the query to. Sending a query to the management canister is not supported (as it has no meaning from an agent).

QueryFields

Options to use to create and send the query.

Identity | Promise<Identity>

Sender principal to use when sending the query.

Promise<ApiQueryResponse>

The response from the replica. The Promise will only reject when the communication failed. If the query itself failed but no protocol errors happened, the response will be of type QueryResponseRejected.

readState(effectiveCanisterId, options, identity?, request?): Promise<ReadStateResponse>

Defined in: packages/core/src/agent/agent/api.ts:231

Send a read state query to the replica. This includes a list of paths to return, and will return a Certificate. This will only reject on communication errors, but the certificate might contain less information than requested.

string | Principal

A Canister ID related to this call.

ReadStateOptions

The options for this call.

Identity

Identity for the call. If not specified, uses the instance identity.

unknown

The request to send in case it has already been created.

Promise<ReadStateResponse>

optional replaceIdentity(identity): void

Defined in: packages/core/src/agent/agent/api.ts:309

If an application needs to replace an identity under certain conditions, an Agent may expose a replaceIdentity method. Invoking this method will set the inner identity used by the Agent to a newly provided identity.

A use case for this would be - after authenticating using @icp-sdk/auth/client, you can replace the AnonymousIdentity of your Actor with a DelegationIdentity.

Actor.agentOf(defaultActor).replaceIdentity(await authClient.getIdentity());

Identity

void

status(): Promise<JsonObject>

Defined in: packages/core/src/agent/agent/api.ts:260

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.

Promise<JsonObject>

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

update(canisterId, fields, pollingOptions?): Promise<UpdateResult>

Defined in: packages/core/src/agent/agent/api.ts:247

Executes an update call to a canister and returns the certified result.

string | Principal

The canister to call.

CallOptions

The call options (method name, arg, effective canister ID, optional nonce).

PollingOptions

Optional polling configuration.

Promise<UpdateResult>

The certified result including the certificate, reply bytes, and raw certificate bytes.


Defined in: packages/core/src/agent/auth.ts:126

type: "AnonymousIdentity"

Defined in: packages/core/src/agent/auth.ts:127


Defined in: packages/core/src/agent/actor.ts:30

Configuration to make calls to the Replica.

optional agent?: Agent

Defined in: packages/core/src/agent/actor.ts:35

An agent to use in this call, otherwise the actor or call will try to discover the agent to use.

optional canisterId?: string | Principal

Defined in: packages/core/src/agent/actor.ts:45

The canister ID of this Actor.

optional effectiveCanisterId?: Principal

Defined in: packages/core/src/agent/actor.ts:50

The effective canister ID.

optional nonce?: Uint8Array<ArrayBufferLike>

Defined in: packages/core/src/agent/actor.ts:55

The nonce to use for this call. This is used to prevent replay attacks.

optional pollingOptions?: PollingOptions

Defined in: packages/core/src/agent/actor.ts:40

Options for controlling polling behavior.


Defined in: packages/core/src/agent/errors.ts:44

Call context for errors that arise from a direct HTTP call response.

canisterId: Principal

Defined in: packages/core/src/agent/errors.ts:37

PollingCallContext.canisterId

httpDetails: HttpDetailsResponse

Defined in: packages/core/src/agent/errors.ts:45

methodName: string

Defined in: packages/core/src/agent/errors.ts:38

PollingCallContext.methodName


Defined in: packages/core/src/agent/agent/api.ts:103

Options when doing a Agent.call call.

arg: Uint8Array

Defined in: packages/core/src/agent/agent/api.ts:112

A binary encoded argument. This is already encoded and will be sent as is.

optional callSync?: boolean

Defined in: packages/core/src/agent/agent/api.ts:123

Whether to use synchronous call mode. Defaults to true.

effectiveCanisterId: string | Principal

Defined in: packages/core/src/agent/agent/api.ts:118

An effective canister ID, used for routing. Usually the canister ID, except for management canister calls.

https://internetcomputer.org/docs/current/references/ic-interface-spec/#http-effective-canister-id

methodName: string

Defined in: packages/core/src/agent/agent/api.ts:107

The method name to call.

optional nonce?: Uint8Array<ArrayBufferLike>

Defined in: packages/core/src/agent/agent/api.ts:128

An optional nonce to use for the call, used to prevent replay attacks.


Defined in: packages/core/src/agent/agent/http/types.ts:62

  • Record<string, any>

[key: string]: any

arg: Uint8Array

Defined in: packages/core/src/agent/agent/http/types.ts:66

canister_id: Principal

Defined in: packages/core/src/agent/agent/http/types.ts:64

ingress_expiry: Expiry

Defined in: packages/core/src/agent/agent/http/types.ts:68

method_name: string

Defined in: packages/core/src/agent/agent/http/types.ts:65

optional nonce?: Nonce

Defined in: packages/core/src/agent/agent/http/types.ts:69

request_type: Call

Defined in: packages/core/src/agent/agent/http/types.ts:63

sender: Uint8Array<ArrayBufferLike> | Principal

Defined in: packages/core/src/agent/agent/http/types.ts:67


Defined in: packages/core/src/agent/certificate.ts:41

optional delegation?: Delegation

Defined in: packages/core/src/agent/certificate.ts:44

signature: Uint8Array

Defined in: packages/core/src/agent/certificate.ts:43

tree: HashTree

Defined in: packages/core/src/agent/certificate.ts:42


Defined in: packages/core/src/agent/certificate.ts:876

canisterId: Principal

Defined in: packages/core/src/agent/certificate.ts:877

subnetId: Principal

Defined in: packages/core/src/agent/certificate.ts:878

tree: HashTree

Defined in: packages/core/src/agent/certificate.ts:879


Defined in: packages/core/src/agent/actor.ts:174

optional certificate?: boolean

Defined in: packages/core/src/agent/actor.ts:176

optional httpDetails?: boolean

Defined in: packages/core/src/agent/actor.ts:175


Defined in: packages/core/src/agent/certificate.ts:170

optional agent?: Agent

Defined in: packages/core/src/agent/certificate.ts:209

The agent used to sync time with the IC network, if the certificate fails the freshness check. If the agent does not implement the HttpAgent.getTimeDiffMsecs, HttpAgent.hasSyncedTime, HttpAgent.syncTime and HttpAgent.syncTimeWithSubnet methods, time will not be synced in case of a freshness check failure.

undefined

optional blsVerify?: VerifyFunc

Defined in: packages/core/src/agent/certificate.ts:187

BLS Verification strategy. Default strategy uses bls12_381 from @noble/curves

certificate: Uint8Array

Defined in: packages/core/src/agent/certificate.ts:174

The bytes encoding the certificate to be verified

optional disableTimeVerification?: boolean

Defined in: packages/core/src/agent/certificate.ts:201

Overrides the maxAgeInMinutes setting and skips comparing the client’s time against the certificate. Used for scenarios where the machine’s clock is known to be out of sync, or for inspecting expired certificates.

false

optional maxAgeInMinutes?: number

Defined in: packages/core/src/agent/certificate.ts:195

The maximum age of the certificate in minutes. Default is 5 minutes. This is used to verify the time the certificate was signed, particularly for validating Delegation certificates, which can live for longer than the default window of +/- 5 minutes. If the certificate is older than the specified age, it will fail verification.

5

principal: CertificatePrincipal

Defined in: packages/core/src/agent/certificate.ts:183

The principal for which the certificate is being verified.

rootKey: Uint8Array

Defined in: packages/core/src/agent/certificate.ts:179

The root key against which to verify the certificate (normally, the root key of the IC main network)


Defined in: packages/core/src/agent/utils/expirableStore.ts:6

Generic interface for a key-value store with time-based expiration. Keys are strings, values are of type V. Implementations must handle expiration internally.

V

readonly expirationTime: number

Defined in: packages/core/src/agent/utils/expirableStore.ts:10

Time in milliseconds after which entries expire.

delete(key): Promise<void>

Defined in: packages/core/src/agent/utils/expirableStore.ts:27

Delete the entry for a key.

string

Promise<void>

get(key): Promise<V | undefined>

Defined in: packages/core/src/agent/utils/expirableStore.ts:16

Get the value for a key. Returns undefined if the key is not present or has expired.

string

Promise<V | undefined>

set(key, value): Promise<void>

Defined in: packages/core/src/agent/utils/expirableStore.ts:22

Store a value for a key. Prunes expired entries before inserting.

string

V

Promise<void>


Defined in: packages/core/src/agent/agent/http/types.ts:21

readonly endpoint: Endpoint

Defined in: packages/core/src/agent/agent/http/types.ts:22

request: RequestInit

Defined in: packages/core/src/agent/agent/http/types.ts:23


Defined in: packages/core/src/agent/agent/http/index.ts:132

optional backoffStrategy?: BackoffStrategyFactory

Defined in: packages/core/src/agent/agent/http/index.ts:179

The strategy to use for backoff when retrying requests

optional callOptions?: Record<string, unknown>

Defined in: packages/core/src/agent/agent/http/index.ts:142

optional credentials?: object

Defined in: packages/core/src/agent/agent/http/index.ts:158

name: string

optional password?: string

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

Defined in: packages/core/src/agent/agent/http/index.ts:134

(input, init?): Promise<Response>

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

string | URL | Request

RequestInit

Promise<Response>

optional fetchOptions?: Record<string, unknown>

Defined in: packages/core/src/agent/agent/http/index.ts:139

optional host?: string

Defined in: packages/core/src/agent/agent/http/index.ts:146

optional identity?: Identity | Promise<Identity>

Defined in: packages/core/src/agent/agent/http/index.ts:150

optional ingressExpiryInMinutes?: number

Defined in: packages/core/src/agent/agent/http/index.ts:156

The maximum time a request can be delayed before being rejected.

5 minutes

optional logToConsole?: boolean

Defined in: packages/core/src/agent/agent/http/index.ts:194

Whether to log to the console. Defaults to false.

optional retryTimes?: number

Defined in: packages/core/src/agent/agent/http/index.ts:175

Number of times to retry requests before throwing an error

3

optional rootKey?: Uint8Array<ArrayBufferLike>

Defined in: packages/core/src/agent/agent/http/index.ts:199

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

optional shouldFetchRootKey?: boolean

Defined in: packages/core/src/agent/agent/http/index.ts:204

Whether or not the root key should be automatically fetched during construction. Defaults to false.

optional shouldSyncTime?: boolean

Defined in: packages/core/src/agent/agent/http/index.ts:209

Whether or not to sync the time with the network during construction. Defaults to false.

optional subnetNodeKeyExpirableStore?: ExpirableStore<SubnetNodeKeys>

Defined in: packages/core/src/agent/agent/http/index.ts:190

Custom store for caching subnet node keys. Allows sharing the cache across multiple HttpAgent instances. Defaults to IndexedDB in browser environments, in-memory otherwise.

optional useQueryNonces?: boolean

Defined in: packages/core/src/agent/agent/http/index.ts:170

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

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

optional verifyQuerySignatures?: boolean

Defined in: packages/core/src/agent/agent/http/index.ts:184

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.

true

Defined in: packages/core/src/agent/agent/http/types.ts:33

body: ReadRequest

Defined in: packages/core/src/agent/agent/http/types.ts:35

readonly endpoint: Query

Defined in: packages/core/src/agent/agent/http/types.ts:34

HttpAgentBaseRequest.endpoint

request: RequestInit

Defined in: packages/core/src/agent/agent/http/types.ts:23

HttpAgentBaseRequest.request


Defined in: packages/core/src/agent/agent/http/types.ts:38

body: ReadRequest

Defined in: packages/core/src/agent/agent/http/types.ts:40

readonly endpoint: ReadState

Defined in: packages/core/src/agent/agent/http/types.ts:39

HttpAgentBaseRequest.endpoint

request: RequestInit

Defined in: packages/core/src/agent/agent/http/types.ts:23

HttpAgentBaseRequest.request


Defined in: packages/core/src/agent/agent/http/types.ts:55

HttpAgentRequestTransformFn(args): Promise<void | HttpAgentRequest | undefined>

Defined in: packages/core/src/agent/agent/http/types.ts:56

HttpAgentRequest

Promise<void | HttpAgentRequest | undefined>

optional priority?: number

Defined in: packages/core/src/agent/agent/http/types.ts:57


Defined in: packages/core/src/agent/agent/http/types.ts:28

body: CallRequest

Defined in: packages/core/src/agent/agent/http/types.ts:30

readonly endpoint: Call

Defined in: packages/core/src/agent/agent/http/types.ts:29

HttpAgentBaseRequest.endpoint

request: RequestInit

Defined in: packages/core/src/agent/agent/http/types.ts:23

HttpAgentBaseRequest.request


Defined in: packages/core/src/agent/agent/api.ts:40

headers: HttpHeaderField[]

Defined in: packages/core/src/agent/agent/api.ts:44

ok: boolean

Defined in: packages/core/src/agent/agent/api.ts:41

status: number

Defined in: packages/core/src/agent/agent/api.ts:42

statusText: string

Defined in: packages/core/src/agent/agent/api.ts:43


Defined in: packages/core/src/agent/auth.ts:39

A General Identity object. This does not have to be a private key (for example, the Anonymous identity), but it must be able to transform request.

getPrincipal(): Principal

Defined in: packages/core/src/agent/auth.ts:44

Get the principal represented by this identity. Normally should be a Principal.selfAuthenticating().

Principal

transformRequest(request): Promise<unknown>

Defined in: packages/core/src/agent/auth.ts:51

Transform a request into a signed version of the request. This is done last after the transforms on the body of a request. The returned object can be anything, but must be serializable to CBOR.

HttpAgentRequest

Promise<unknown>


Defined in: packages/core/src/agent/agent/http/expiry.ts:20

__expiry__: string

Defined in: packages/core/src/agent/agent/http/expiry.ts:21


Defined in: packages/core/src/agent/auth.ts:9

A Key Pair, containing a secret and public key.

publicKey: PublicKey

Defined in: packages/core/src/agent/auth.ts:11

secretKey: Uint8Array

Defined in: packages/core/src/agent/auth.ts:10


Defined in: packages/core/src/agent/certificate.ts:579

status: Absent

Defined in: packages/core/src/agent/certificate.ts:580


Defined in: packages/core/src/agent/certificate.ts:587

status: Found

Defined in: packages/core/src/agent/certificate.ts:588

value: HashTree

Defined in: packages/core/src/agent/certificate.ts:589


Defined in: packages/core/src/agent/certificate.ts:592

status: Greater

Defined in: packages/core/src/agent/certificate.ts:593


Defined in: packages/core/src/agent/certificate.ts:596

status: Less

Defined in: packages/core/src/agent/certificate.ts:597


Defined in: packages/core/src/agent/certificate.ts:583

status: Unknown

Defined in: packages/core/src/agent/certificate.ts:584


Defined in: packages/core/src/agent/certificate.ts:524

status: Absent

Defined in: packages/core/src/agent/certificate.ts:525


Defined in: packages/core/src/agent/certificate.ts:537

status: Error

Defined in: packages/core/src/agent/certificate.ts:538


Defined in: packages/core/src/agent/certificate.ts:532

status: Found

Defined in: packages/core/src/agent/certificate.ts:533

value: Uint8Array

Defined in: packages/core/src/agent/certificate.ts:534


Defined in: packages/core/src/agent/certificate.ts:528

status: Unknown

Defined in: packages/core/src/agent/certificate.ts:529


Defined in: packages/core/src/agent/certificate.ts:553

status: Absent

Defined in: packages/core/src/agent/certificate.ts:554


Defined in: packages/core/src/agent/certificate.ts:561

status: Found

Defined in: packages/core/src/agent/certificate.ts:562

value: HashTree

Defined in: packages/core/src/agent/certificate.ts:563


Defined in: packages/core/src/agent/certificate.ts:557

status: Unknown

Defined in: packages/core/src/agent/certificate.ts:558


Defined in: packages/core/src/agent/agent/api.ts:57

identity: Uint8Array

Defined in: packages/core/src/agent/agent/api.ts:63

signature: Uint8Array

Defined in: packages/core/src/agent/agent/api.ts:61

timestamp: bigint

Defined in: packages/core/src/agent/agent/api.ts:59


Defined in: packages/core/src/agent/polling/types.ts:21

The result of polling for a response, including the certificate, reply bytes, and raw certificate bytes.

certificate: Certificate

Defined in: packages/core/src/agent/polling/types.ts:23

The certificate for the request, which can be used to verify the reply.

rawCertificate: Uint8Array

Defined in: packages/core/src/agent/polling/types.ts:27

The raw certificate bytes for the request.

reply: Uint8Array

Defined in: packages/core/src/agent/polling/types.ts:25

The reply bytes for the request.


Defined in: packages/core/src/agent/errors.ts:36

Call context for errors that arise during polling.

canisterId: Principal

Defined in: packages/core/src/agent/errors.ts:37

methodName: string

Defined in: packages/core/src/agent/errors.ts:38


Defined in: packages/core/src/agent/polling/index.ts:39

Options for controlling polling behavior

optional blsVerify?: VerifyFunc

Defined in: packages/core/src/agent/polling/index.ts:56

Optional replacement function that verifies the BLS signature of a certificate.

optional preSignReadStateRequest?: boolean

Defined in: packages/core/src/agent/polling/index.ts:51

Whether to reuse the same signed request for polling or create a new unsigned request each time.

false

optional request?: ReadStateRequest

Defined in: packages/core/src/agent/polling/index.ts:62

The request to use for polling. If not provided, a new request will be created. This is only used if preSignReadStateRequest is set to false.

optional strategy?: PollStrategy

Defined in: packages/core/src/agent/polling/index.ts:45

A polling strategy that dictates how much and often we should poll the read_state endpoint to get the result of an update call.

defaultStrategy


Defined in: packages/core/src/agent/auth.ts:27

A Public Key implementation.

optional derKey?: DerEncodedPublicKey

Defined in: packages/core/src/agent/auth.ts:32

optional rawKey?: Uint8Array<ArrayBufferLike>

Defined in: packages/core/src/agent/auth.ts:31

toDer(): DerEncodedPublicKey

Defined in: packages/core/src/agent/auth.ts:28

DerEncodedPublicKey

optional toRaw(): Uint8Array

Defined in: packages/core/src/agent/auth.ts:30

Uint8Array


Defined in: packages/core/src/agent/auth.ts:129

publicKey: string

Defined in: packages/core/src/agent/auth.ts:131

type: "PublicKeyIdentity"

Defined in: packages/core/src/agent/auth.ts:130


Defined in: packages/core/src/agent/agent/api.ts:83

Options when doing a Agent.query call.

arg: Uint8Array

Defined in: packages/core/src/agent/agent/api.ts:92

A binary encoded argument. This is already encoded and will be sent as is.

optional effectiveCanisterId?: Principal

Defined in: packages/core/src/agent/agent/api.ts:97

Overrides canister id for path to fetch. This is used for management canister calls.

methodName: string

Defined in: packages/core/src/agent/agent/api.ts:87

The method name to call.


Defined in: packages/core/src/agent/agent/http/types.ts:85

  • Record<string, any>

[key: string]: any

arg: Uint8Array

Defined in: packages/core/src/agent/agent/http/types.ts:89

canister_id: Principal

Defined in: packages/core/src/agent/agent/http/types.ts:87

ingress_expiry: Expiry

Defined in: packages/core/src/agent/agent/http/types.ts:91

method_name: string

Defined in: packages/core/src/agent/agent/http/types.ts:88

optional nonce?: Nonce

Defined in: packages/core/src/agent/agent/http/types.ts:92

request_type: Query

Defined in: packages/core/src/agent/agent/http/types.ts:86

sender: Uint8Array<ArrayBufferLike> | Principal

Defined in: packages/core/src/agent/agent/http/types.ts:90


Defined in: packages/core/src/agent/agent/api.ts:52

optional requestDetails?: QueryRequest

Defined in: packages/core/src/agent/agent/api.ts:54

status: QueryResponseStatus

Defined in: packages/core/src/agent/agent/api.ts:53


Defined in: packages/core/src/agent/agent/api.ts:72

error_code: string

Defined in: packages/core/src/agent/agent/api.ts:76

reject_code: ReplicaRejectCode

Defined in: packages/core/src/agent/agent/api.ts:74

reject_message: string

Defined in: packages/core/src/agent/agent/api.ts:75

optional requestDetails?: QueryRequest

Defined in: packages/core/src/agent/agent/api.ts:54

QueryResponseBase.requestDetails

optional signatures?: NodeSignature[]

Defined in: packages/core/src/agent/agent/api.ts:77

status: Rejected

Defined in: packages/core/src/agent/agent/api.ts:73

QueryResponseBase.status


Defined in: packages/core/src/agent/agent/api.ts:66

reply: object

Defined in: packages/core/src/agent/agent/api.ts:68

arg: Uint8Array

optional requestDetails?: QueryRequest

Defined in: packages/core/src/agent/agent/api.ts:54

QueryResponseBase.requestDetails

optional signatures?: NodeSignature[]

Defined in: packages/core/src/agent/agent/api.ts:69

status: Replied

Defined in: packages/core/src/agent/agent/api.ts:67

QueryResponseBase.status


Defined in: packages/core/src/agent/agent/api.ts:23

Options when doing a Agent.readState call.

paths: Uint8Array<ArrayBufferLike>[][]

Defined in: packages/core/src/agent/agent/api.ts:27

A list of paths to read the state of.


Defined in: packages/core/src/agent/agent/http/types.ts:96

  • Record<string, any>

[key: string]: any

ingress_expiry: Expiry

Defined in: packages/core/src/agent/agent/http/types.ts:99

paths: Uint8Array<ArrayBufferLike>[][]

Defined in: packages/core/src/agent/agent/http/types.ts:98

request_type: ReadState

Defined in: packages/core/src/agent/agent/http/types.ts:97

sender: Uint8Array<ArrayBufferLike> | Principal

Defined in: packages/core/src/agent/agent/http/types.ts:100


Defined in: packages/core/src/agent/agent/api.ts:144

certificate: Uint8Array

Defined in: packages/core/src/agent/agent/api.ts:145


Defined in: packages/core/src/agent/errors.ts:26

ingressExpiry: Expiry

Defined in: packages/core/src/agent/errors.ts:30

optional requestId?: RequestId

Defined in: packages/core/src/agent/errors.ts:27

senderPubKey: Uint8Array

Defined in: packages/core/src/agent/errors.ts:28

senderSignature: Uint8Array

Defined in: packages/core/src/agent/errors.ts:29


Defined in: packages/core/src/agent/agent/http/types.ts:43

T

content: T

Defined in: packages/core/src/agent/agent/http/types.ts:44

sender_pubkey: ArrayBuffer

Defined in: packages/core/src/agent/agent/http/types.ts:45

sender_sig: ArrayBuffer

Defined in: packages/core/src/agent/agent/http/types.ts:46


Defined in: packages/core/src/agent/agent/api.ts:180

optional requestDetails?: CallRequest

Defined in: packages/core/src/agent/agent/api.ts:189

requestId: RequestId

Defined in: packages/core/src/agent/agent/api.ts:181

response: object

Defined in: packages/core/src/agent/agent/api.ts:182

body: v2ResponseBody | v4ResponseBody | null

headers: HttpHeaderField[]

ok: boolean

status: number

statusText: string


Defined in: packages/core/src/agent/agent/http/types.ts:49

T

content: T

Defined in: packages/core/src/agent/agent/http/types.ts:50


Defined in: packages/core/src/agent/agent/api.ts:131

Options when doing a Agent.call call.

arg: Uint8Array

Defined in: packages/core/src/agent/agent/api.ts:112

A binary encoded argument. This is already encoded and will be sent as is.

CallOptions.arg

optional callSync?: boolean

Defined in: packages/core/src/agent/agent/api.ts:123

Whether to use synchronous call mode. Defaults to true.

CallOptions.callSync

effectiveCanisterId: string | Principal

Defined in: packages/core/src/agent/agent/api.ts:118

An effective canister ID, used for routing. Usually the canister ID, except for management canister calls.

https://internetcomputer.org/docs/current/references/ic-interface-spec/#http-effective-canister-id

CallOptions.effectiveCanisterId

methodName: string

Defined in: packages/core/src/agent/agent/api.ts:107

The method name to call.

CallOptions.methodName

optional nonce?: Uint8Array<ArrayBufferLike>

Defined in: packages/core/src/agent/agent/api.ts:128

An optional nonce to use for the call, used to prevent replay attacks.

CallOptions.nonce

optional onPollingStarted?: () => void

Defined in: packages/core/src/agent/agent/api.ts:141

An optional callback that will be invoked once the agent starts polling for the result of the update call.

If callSync is set to false, polling will start, and the callback will be invoked, once the request has been accepted by a single node. If callSync is set to true, the IC will first try to process the request synchronously. But if the synchronous request timeout is exceeded, the agent will start polling for the result, at which point the callback will be invoked.

void


Defined in: packages/core/src/agent/agent/api.ts:196

The result of Agent.update, extending PollForResponseResult with the request details and raw HTTP response from the call.

callResponse: object

Defined in: packages/core/src/agent/agent/api.ts:200

The raw HTTP response from the call endpoint.

body: v2ResponseBody | v4ResponseBody | null

headers: HttpHeaderField[]

ok: boolean

status: number

statusText: string

certificate: Certificate

Defined in: packages/core/src/agent/polling/types.ts:23

The certificate for the request, which can be used to verify the reply.

PollForResponseResult.certificate

rawCertificate: Uint8Array

Defined in: packages/core/src/agent/polling/types.ts:27

The raw certificate bytes for the request.

PollForResponseResult.rawCertificate

reply: Uint8Array

Defined in: packages/core/src/agent/polling/types.ts:25

The reply bytes for the request.

PollForResponseResult.reply

optional requestDetails?: CallRequest

Defined in: packages/core/src/agent/agent/api.ts:198

The request details from the call, if available.


Defined in: packages/core/src/agent/agent/api.ts:148

optional error_code?: string

Defined in: packages/core/src/agent/agent/api.ts:149

reject_code: number

Defined in: packages/core/src/agent/agent/api.ts:150

reject_message: string

Defined in: packages/core/src/agent/agent/api.ts:151


Defined in: packages/core/src/agent/agent/api.ts:165

certificate: Uint8Array

Defined in: packages/core/src/agent/agent/api.ts:166

ActorConstructor = (config) => ActorSubclass

Defined in: packages/core/src/agent/actor.ts:375

ActorConfig

ActorSubclass


ActorMethodMappedExtended<T> = { [K in keyof T]: T[K] extends FunctionWithArgsAndReturn<infer Args, infer Ret> ? ActorMethodExtended<Args, Ret> : never }

Defined in: packages/core/src/agent/actor.ts:155

T


ActorMethodMappedWithHttpDetails<T> = { [K in keyof T]: T[K] extends FunctionWithArgsAndReturn<infer Args, infer Ret> ? ActorMethodWithHttpDetails<Args, Ret> : never }

Defined in: packages/core/src/agent/actor.ts:148

T


ActorSubclass<T> = Actor & T

Defined in: packages/core/src/agent/actor.ts:108

A subclass of an actor. Actor class itself is meant to be a based class.

T = Record<string, ActorMethod>


AgentLog = { level: "warn" | "info"; message: string; } | { error: AgentError; level: "error"; message: string; }

Defined in: packages/core/src/agent/observable.ts:25


ApiQueryResponse = QueryResponse & object

Defined in: packages/core/src/agent/agent/api.ts:47

httpDetails: HttpDetailsResponse

requestId: RequestId


CanisterRanges = [Principal, Principal][]

Defined in: packages/core/src/agent/certificate.ts:886

Canister ranges in the form of an array of [start, end] principal tuples, usually decoded from the certificate.


CertificatePrincipal = { canisterId: Principal; } | { subnetId: Principal; }

Defined in: packages/core/src/agent/certificate.ts:155

{ canisterId: Principal; }

canisterId: Principal

The effective canister ID of the request when verifying a response, or the signing canister ID when verifying a certified variable.


{ subnetId: Principal; }

subnetId: Principal

The subnet ID when verifying a certificate from a subnet.


DerEncodedPublicKey = Uint8Array & object

Defined in: packages/core/src/agent/auth.ts:17

A public key that is DER encoded. This is a branded Uint8Array.

optional __derEncodedPublicKey__?: void


EmptyHashTree = [Empty]

Defined in: packages/core/src/agent/certificate.ts:60


Envelope<T> = Signed<T> | UnSigned<T>

Defined in: packages/core/src/agent/agent/http/types.ts:53

T


ForkHashTree = [Fork, HashTree, HashTree]

Defined in: packages/core/src/agent/certificate.ts:61


FunctionWithArgsAndReturn<Args, Ret> = (…args) => Ret

Defined in: packages/core/src/agent/actor.ts:143

Args extends unknown[] = unknown[]

Ret = unknown

Args

Ret


HashTree = EmptyHashTree | ForkHashTree | LabeledHashTree | LeafHashTree | PrunedHashTree

Defined in: packages/core/src/agent/certificate.ts:66


HttpAgentRequest = HttpAgentQueryRequest | HttpAgentSubmitRequest | HttpAgentReadStateRequest

Defined in: packages/core/src/agent/agent/http/types.ts:16


HttpHeaderField = [string, string]

Defined in: packages/core/src/agent/agent/http/types.ts:26


IdentityDescriptor = AnonymousIdentityDescriptor | PublicKeyIdentityDescriptor

Defined in: packages/core/src/agent/auth.ts:133


LabeledHashTree = [Labeled, NodeLabel, HashTree]

Defined in: packages/core/src/agent/certificate.ts:62


LabelLookupResult = LookupLabelResultAbsent | LookupLabelResultUnknown | LookupLabelResultFound | LookupLabelResultGreater | LookupLabelResultLess

Defined in: packages/core/src/agent/certificate.ts:600


LeafHashTree = [Leaf, NodeValue]

Defined in: packages/core/src/agent/certificate.ts:63


LookupResult = LookupPathResultAbsent | LookupPathResultUnknown | LookupPathResultFound | LookupPathResultError

Defined in: packages/core/src/agent/certificate.ts:541


NodeHash = Uint8Array & object

Defined in: packages/core/src/agent/certificate.ts:58

__nodeHash__: void


NodeLabel = Uint8Array & object

Defined in: packages/core/src/agent/certificate.ts:56

__nodeLabel__: void


NodePath = (Uint8Array | string)[]

Defined in: packages/core/src/agent/certificate.ts:55


NodeValue = Uint8Array & object

Defined in: packages/core/src/agent/certificate.ts:57

__nodeValue__: void


Nonce = Uint8Array & object

Defined in: packages/core/src/agent/agent/http/types.ts:125

__nonce__: void


ObserveFunction<T> = (data, …rest) => void

Defined in: packages/core/src/agent/observable.ts:3

T

T

unknown[]

void


PollStrategy = (canisterId, requestId, status) => Promise<void>

Defined in: packages/core/src/agent/polling/types.ts:6

Principal

RequestId

RequestStatusResponseStatus

Promise<void>


PrunedHashTree = [Pruned, NodeHash]

Defined in: packages/core/src/agent/certificate.ts:64


QueryResponse = QueryResponseReplied | QueryResponseRejected

Defined in: packages/core/src/agent/agent/api.ts:33


QueryStrategy = "query" | "update"

Defined in: packages/core/src/agent/actor.ts:25

Controls how query and composite_query methods are executed.

  • 'query' — standard non-replicated query call (default).
  • 'update' — send query methods as update calls that go through consensus.

ReadRequest = QueryRequest | ReadStateRequest

Defined in: packages/core/src/agent/agent/http/types.ts:103


RequestId = Uint8Array & object

Defined in: packages/core/src/agent/request_id.ts:8

__requestId__: void


Signature = Uint8Array & object

Defined in: packages/core/src/agent/auth.ts:22

A signature array buffer.

__signature__: void


SubtreeLookupResult = LookupSubtreeResultAbsent | LookupSubtreeResultUnknown | LookupSubtreeResultFound

Defined in: packages/core/src/agent/certificate.ts:566

const ACTOR_METHOD_WITH_CERTIFICATE: "certificate" = 'certificate'

Defined in: packages/core/src/agent/actor.ts:378


const ACTOR_METHOD_WITH_HTTP_DETAILS: "http-details" = 'http-details'

Defined in: packages/core/src/agent/actor.ts:377


const BLS12_381_G2_OID: Uint8Array<ArrayBuffer>

Defined in: packages/core/src/agent/der.ts:116


const Cbor: object

Defined in: packages/core/src/agent/cbor.ts:60

decode: <T>(input) => T

Decode a CBOR encoded value into a JavaScript value.

T

Uint8Array

The CBOR encoded value

T

encode: (value) => Uint8Array

Encode a JavaScript value into CBOR. If the value is an instance of ToCborValue, the ToCborValue.toCborValue method will be called to get the value to encode.

unknown

The value to encode

Uint8Array


const DEFAULT_POLLING_OPTIONS: PollingOptions

Defined in: packages/core/src/agent/polling/index.ts:65


const DER_COSE_OID: Uint8Array<ArrayBuffer>

Defined in: packages/core/src/agent/der.ts:90

A DER encoded SEQUENCE(OID) for DER-encoded-COSE


const ED25519_OID: Uint8Array<ArrayBuffer>

Defined in: packages/core/src/agent/der.ts:99

A DER encoded SEQUENCE(OID) for the Ed25519 algorithm


IC_REQUEST_AUTH_DELEGATION_DOMAIN_SEPARATOR

Section titled “IC_REQUEST_AUTH_DELEGATION_DOMAIN_SEPARATOR”

const IC_REQUEST_AUTH_DELEGATION_DOMAIN_SEPARATOR: Uint8Array<ArrayBuffer>

Defined in: packages/core/src/agent/constants.ts:22

The \x1Aic-request-auth-delegation domain separator used in the signature of delegations.


const IC_REQUEST_DOMAIN_SEPARATOR: Uint8Array<ArrayBuffer>

Defined in: packages/core/src/agent/constants.ts:12

The \x0Aic-request domain separator used in the signature of IC requests.


const IC_RESPONSE_DOMAIN_SEPARATOR: Uint8Array<ArrayBuffer>

Defined in: packages/core/src/agent/constants.ts:17

The \x0Bic-response domain separator used in the signature of IC responses.


const IC_ROOT_KEY: string

Defined in: packages/core/src/agent/agent/http/index.ts:109


const IC_STATE_ROOT_DOMAIN_SEPARATOR: Uint8Array<ArrayBuffer>

Defined in: packages/core/src/agent/constants.ts:7

The \x0Dic-state-root domain separator used in the root hash of IC certificates.


const JSON_KEY_EXPIRY: "__expiry__" = '__expiry__'

Defined in: packages/core/src/agent/agent/http/expiry.ts:4


const MANAGEMENT_CANISTER_ID: "aaaaa-aa" = 'aaaaa-aa'

Defined in: packages/core/src/agent/agent/http/index.ts:115


const SECP256K1_OID: Uint8Array<ArrayBuffer>

Defined in: packages/core/src/agent/der.ts:108

A DER encoded SEQUENCE(OID) for secp256k1 with the ECDSA algorithm


const UNREACHABLE_ERROR: Error

Defined in: packages/core/src/agent/errors.ts:962

Special error used to indicate that a code path is unreachable.

For internal use only.


verify: (pk, sig, msg) => boolean

Defined in: packages/core/src/agent/utils/bls.ts:4

Uint8Array

Uint8Array

Uint8Array

boolean

blsVerify(pk, sig, msg): boolean

Defined in: packages/core/src/agent/utils/bls.ts:13

Uint8Array

primary key: Uint8Array

Uint8Array

signature: Uint8Array

Uint8Array

message: Uint8Array

boolean

boolean


calculateIngressExpiry(maxIngressExpiryInMinutes, timeDiffMsecs): Expiry

Defined in: packages/core/src/agent/agent/http/index.ts:1708

Calculates the ingress expiry time based on the maximum allowed expiry in minutes and the time difference in milliseconds. The expiry is rounded down according to the Expiry.fromDeltaInMilliseconds method.

number

The maximum ingress expiry time in minutes.

number

The time difference in milliseconds to adjust the expiry.

Expiry

The calculated ingress expiry as an Expiry object.


check_canister_ranges(params): boolean

Defined in: packages/core/src/agent/certificate.ts:896

Check if a canister ID falls within the canister ranges of a given subnet

CheckCanisterRangesParams

the parameters with which to check the canister ranges

boolean

true if the canister is in the range, false otherwise


constructRequest(options): Promise<ReadStateRequest>

Defined in: packages/core/src/agent/polling/index.ts:219

Constructs a read state request for the given paths. If the request is already signed and has an expiry, it will be returned as is. Otherwise, a new request will be created.

The options to use for creating the request.

Agent

The agent to use to create the request.

Uint8Array<ArrayBufferLike>[][]

The paths to read from.

PollingOptions

The options to use for creating the request.

Promise<ReadStateRequest>

The read state request.


createIdentityDescriptor(identity): IdentityDescriptor

Defined in: packages/core/src/agent/auth.ts:139

Create an IdentityDescriptor from an Identity

SignIdentity | AnonymousIdentity

identity describe in returned descriptor

IdentityDescriptor


decodeCanisterRanges(lookupValue): CanisterRanges

Defined in: packages/core/src/agent/certificate.ts:973

Decode canister ranges from CBOR-encoded buffer

Uint8Array

the CBOR-encoded value read from the certificate

CanisterRanges

an array of canister range tuples [start, end]


decodeLen(buf, offset): number

Defined in: packages/core/src/agent/der.ts:70

Uint8Array

number

number


decodeLenBytes(buf, offset): number

Defined in: packages/core/src/agent/der.ts:51

Uint8Array

number

number


domain_sep(s): Uint8Array

Defined in: packages/core/src/agent/certificate.ts:507

Creates a domain separator for hashing by encoding the input string with its length as a prefix.

string

The input string to encode.

Uint8Array

A Uint8Array containing the encoded domain separator.


encodeLen(buf, offset, len): number

Defined in: packages/core/src/agent/der.ts:25

Uint8Array

number

number

number


encodeLenBytes(len): number

Defined in: packages/core/src/agent/der.ts:9

number

number


fetchCandid(canisterId, agent?): Promise<string>

Defined in: packages/core/src/agent/fetch_candid.ts:13

Retrieves the Candid interface for the specified canister.

string

A string corresponding to the canister ID

HttpAgent

The agent to use for the request (usually an HttpAgent)

Promise<string>

Candid source code


find_label(label, tree): LabelLookupResult

Defined in: packages/core/src/agent/certificate.ts:750

Find a label in a tree

NodeLabel

the label to find

HashTree

the tree to search

LabelLookupResult

the result of the label lookup


flatten_forks(t): (LabeledHashTree | LeafHashTree | PrunedHashTree)[]

Defined in: packages/core/src/agent/certificate.ts:733

If the tree is a fork, flatten it into an array of trees

HashTree

the tree to flatten

(LabeledHashTree | LeafHashTree | PrunedHashTree)[]

the flattened tree


getSubnetIdFromCertificate(certificate, rootKey): Principal

Defined in: packages/core/src/agent/certificate.ts:1052

Get the subnet ID from a certificate If the certificate has a delegation, it returns the subnet ID from the delegation. If the certificate has no delegation, it returns the root subnet ID.

Cert

the certificate to get the subnet ID from

Uint8Array

the root key to use to get the subnet ID

Principal

the subnet ID


hashOfMap(map): Uint8Array

Defined in: packages/core/src/agent/request_id.ts:80

Hash a map into a Uint8Array using the representation-independent-hash function. https://sdk.dfinity.org/docs/interface-spec/index.html#hash-of-map

Record<string, unknown>

Any non-nested object

Uint8Array

Uint8Array


hashTreeToString(tree): string

Defined in: packages/core/src/agent/certificate.ts:77

Make a human readable string out of a hash tree.

HashTree

The hash tree to convert to a string

string


hashValue(value): Uint8Array

Defined in: packages/core/src/agent/request_id.ts:19

unknown

unknown value

Uint8Array

Uint8Array


httpHeadersTransform(headers): HttpHeaderField[]

Defined in: packages/core/src/agent/agent/http/transforms.ts:48

Maps the default fetch headers field to the serializable HttpHeaderField.

Headers

Fetch definition of the headers type

HttpHeaderField[]

array of header fields


isV2ResponseBody(body): body is v2ResponseBody

Defined in: packages/core/src/agent/agent/api.ts:159

Utility function to check if a body is a v2ResponseBody for type safety.

v2ResponseBody | v4ResponseBody | null

The body to check

body is v2ResponseBody

boolean indicating if the body is a v2ResponseBody


isV4ResponseBody(body): body is v4ResponseBody

Defined in: packages/core/src/agent/agent/api.ts:174

Utility function to check if a body is a v4ResponseBody for type safety.

v2ResponseBody | v4ResponseBody | null

The body to check

body is v4ResponseBody

boolean indicating if the body is a v4ResponseBody


lookup_path(path, tree): LookupResult

Defined in: packages/core/src/agent/certificate.ts:613

Lookup a path in a tree. If the path is a subtree, use lookup_subtree instead.

NodePath

the path to look up

HashTree

the tree to search

LookupResult

the result of the lookup


lookup_subtree(path, tree): SubtreeLookupResult

Defined in: packages/core/src/agent/certificate.ts:692

Lookup a subtree in a tree.

NodePath

the path to look up

HashTree

the tree to search

SubtreeLookupResult

the result of the lookup


lookupCanisterRanges(params): Uint8Array

Defined in: packages/core/src/agent/certificate.ts:919

Lookup the canister ranges using the /canister_ranges/<subnet_id>/<ranges> path. Certificates returned by /api/v4/canister/<effective_canister_id>/call and /api/v3/canister/<effective_canister_id>/read_state use this path.

If the new lookup is not found, it tries the fallback lookup with lookupCanisterRangesFallback.

CheckCanisterRangesParams

the parameters with which to lookup the canister ranges

Uint8Array

the encoded canister ranges. Use decodeCanisterRanges to decode them.


lookupCanisterRangesFallback(subnetId, tree): Uint8Array

Defined in: packages/core/src/agent/certificate.ts:955

Lookup the canister ranges using the /subnet/<subnet_id>/canister_ranges path. Certificates returned by /api/v3/canister/<effective_canister_id>/call and /api/v2/canister/<effective_canister_id>/read_state use this path.

Principal

the subnet ID to lookup the canister ranges for

HashTree

the tree to search

Uint8Array

the encoded canister ranges. Use decodeCanisterRanges to decode them.

https://internetcomputer.org/docs/references/ic-interface-spec#http-read-state


lookupResultToBuffer(result): Uint8Array<ArrayBufferLike> | undefined

Defined in: packages/core/src/agent/certificate.ts:463

Utility function to constrain the type of a lookup result

LookupResult

the result of a lookup

Uint8Array<ArrayBufferLike> | undefined

the value if the lookup was found, undefined otherwise


makeExpiryTransform(delayInMilliseconds): HttpAgentRequestTransformFn

Defined in: packages/core/src/agent/agent/http/transforms.ts:37

Create a transform that adds a delay (by default 5 minutes) to the expiry.

number

The delay to add to the call time, in milliseconds.

HttpAgentRequestTransformFn


makeNonce(): Nonce

Defined in: packages/core/src/agent/agent/http/types.ts:130

Create a random Nonce, based on random values

Nonce


makeNonceTransform(nonceFn?): HttpAgentRequestTransformFn

Defined in: packages/core/src/agent/agent/http/transforms.ts:18

Create a Nonce transform, which takes a function that returns a Buffer, and adds it as the nonce to every call requests.

() => Nonce

A function that returns a buffer. By default uses a semi-random method.

HttpAgentRequestTransformFn


pollForResponse(agent, canisterId, requestId, options?): Promise<PollForResponseResult>

Defined in: packages/core/src/agent/polling/index.ts:126

Polls the IC to check the status of the given request then returns the response bytes once the request has been processed.

Agent

The agent to use to poll read_state.

Principal

The effective canister ID.

RequestId

The Request ID to poll status for.

PollingOptions = {}

polling options to control behavior

Promise<PollForResponseResult>

The certificate, reply bytes, and raw certificate bytes for the request.

If the agent’s root key is not available.

If the request was rejected by the canister.

If the request reached done status without a reply.


randomNumber(): number

Defined in: packages/core/src/agent/utils/random.ts:5

Generates a random unsigned 32-bit integer between 0 and 0xffffffff

number

a random number


reconstruct(t): Promise<Uint8Array<ArrayBufferLike>>

Defined in: packages/core/src/agent/certificate.ts:478

HashTree

The hash tree to reconstruct

Promise<Uint8Array<ArrayBufferLike>>


requestIdOf(request): RequestId

Defined in: packages/core/src/agent/request_id.ts:70

Get the RequestId of the provided ic-ref request. RequestId is the result of the representation-independent-hash function. https://sdk.dfinity.org/docs/interface-spec/index.html#hash-of-map

Record<string, unknown>

ic-ref request to hash into RequestId

RequestId


uint8Equals(a, b): boolean

Defined in: packages/core/src/agent/utils/buffer.ts:54

Compares two Uint8Arrays for equality.

Uint8Array

The first Uint8Array.

Uint8Array

The second Uint8Array.

boolean

True if the Uint8Arrays are equal, false otherwise.


uint8FromBufLike(bufLike): Uint8Array

Defined in: packages/core/src/agent/utils/buffer.ts:6

Returns a true Uint8Array from an ArrayBufferLike object.

ArrayBufferLike | Uint8Array<ArrayBufferLike> | number[] | DataView<ArrayBufferLike> | ArrayBufferView<ArrayBufferLike> | [number] | { buffer: ArrayBuffer; }

a buffer-like object

Uint8Array

Uint8Array


uint8ToBuf(arr): ArrayBuffer

Defined in: packages/core/src/agent/utils/buffer.ts:41

Returns a true ArrayBuffer from a Uint8Array, as Uint8Array.buffer is unsafe.

Uint8Array

Uint8Array to convert

ArrayBuffer

ArrayBuffer


unwrapDER(derEncoded, oid): Uint8Array

Defined in: packages/core/src/agent/der.ts:165

Extracts a payload from the given derEncoded data, and checks that it was tagged with the given oid.

derEncoded = SEQUENCE(oid, BITSTRING(payload))

Uint8Array

The DER encoded and tagged data

Uint8Array

The DER encoded (and SEQUENCE wrapped!) expected OID

Uint8Array

The unwrapped payload


wrapDER(payload, oid): Uint8Array

Defined in: packages/core/src/agent/der.ts:132

Wraps the given payload in a DER encoding tagged with the given encoded oid like so: SEQUENCE(oid, BITSTRING(payload))

Uint8Array

The payload to encode as the bit string

Uint8Array

The DER encoded (and SEQUENCE wrapped!) OID to tag the payload with

Uint8Array

Re-exports defaultStrategy