Agent class abstract
An Agent able to make calls and queries to a Replica.
- Implementers
Constructors
- Agent()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- rootKey ↔ BinaryBlob?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
callRequest(
Principal canisterId, CallOptions fields, Identity? identity) → Future< SubmitResponse> -
fetchRootKey(
) → Future< BinaryBlob> - By default, the agent is configured to talk to the main Internet Computer, and verifies responses using a hard-coded public key.
-
getPrincipal(
) → Future< Principal> - Returns the principal ID associated with this agent (by default). It only shows the principal of the default identity in the agent, which is the principal used when calls don't specify it.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query(
Principal canisterId, QueryFields options, Identity? identity) → Future< QueryResponse> - Send a query call to a canister. See the interface spec. @param canisterId 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). @param options Options to use to create and send the query. @returns 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(
Principal effectiveCanisterId, ReadStateOptions options, Identity? identity) → Future< ReadStateResponse> - 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. @param effectiveCanisterId A Canister ID related to this call. @param options The options for this call.
-
status(
) → Future< Map> - Query the status endpoint of the replica. This normally has a few fields that corresponds to the version of the replica, its root public key, and any other information made public. @returns A JsonObject that is essentially a record of fields from the status endpoint.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited