agent/agent/index library
Classes
- Agent
- An Agent able to make calls and queries to a Replica.
- AgentFactory
- BaseRequest
- CallOptions
-
Options when doing a
Agent.call
call. - CallRequest
- CallResponseBody
- Credentials
- DefaultHttpAgentOption
- Endpoint
- Expiry
- FetchResponse
- HttpAgent
-
HttpAgentBaseRequest<
T extends WithToJson> - HttpAgentCallRequest
- HttpAgentOptions
- HttpAgentQueryRequest
- HttpAgentReadStateRequest
- HttpAgentRequestTransformFn
- HttpAgentSubmitRequest
- HttpResponseBody
- ProxyAgent
-
ProxyMessage<
T> - ProxyMessageBase
- ProxyMessageCall
- ProxyMessageCallResponse
-
ProxyMessageError<
T> - ProxyMessageGetPrincipal
- ProxyMessageGetPrincipalResponse
- ProxyMessageKind
- ProxyMessageQuery
- ProxyMessageQueryResponse
- ProxyMessageReadState
- ProxyMessageReadStateResponse
- ProxyMessageStatus
- ProxyMessageStatusResponse
- ProxyStubAgent
- QueryFields
- Options when doing a Agent.query call.
- QueryRequest
- QueryResponse
- QueryResponseBase
- QueryResponseRejected
- QueryResponseReplied
- QueryResponseStatus
- type QueryResponse = QueryResponseReplied | QueryResponseRejected;
- QueryResponseWithStatus
- ReadRequestType
- ReadStateOptions
- Options when doing a Agent.readState call.
- ReadStateRequest
- ReadStateResponse
- ReadStateResponseResult
- ReplicaRejectCode
- Codes used by the replica for rejecting a message. See https://sdk.dfinity.org/docs/interface-spec/#reject-codes for the interface spec.
- Reply
- ResponseBody
-
Signed<
T> - SubmitRequestType
- SubmitResponse
-
UnSigned<
T>
Mixins
Constants
- btoa → const String Function(dynamic value)
- defaultExpireInDuration → const Duration
- defaultExpireInMinutes → const int
- Most of the timeouts will happen in 5 minutes.
- defaultHttpAgentOption → const DefaultHttpAgentOption
- defaultTimeout → const Duration
Functions
-
defaultFetch(
{required String endpoint, String? host, String? defaultHost, FetchMethod method = FetchMethod.post, Map< String, String> ? baseHeaders, Map<String, String> ? headers, Duration? timeout = defaultTimeout, bool cbor = true, dynamic body}) → Future<Map< String, dynamic> > -
defaultFetch is a wrapper of
http.get
, which can be replaced by any other http packages (e.g.dio
).http
has embedded by default, so the library use it directly. Users can set host should be full path of http/https. Usually the usage could bedefaultHost+endpoint
and set the defaultHost to somewhere final, then change the endpoint programmatically. defaultTimeout is the default timeout limit, and throw error directly to end the request section. -
makeNonceTransform(
[NonceFunc nonceFn = makeNonce]) → HttpAgentRequestTransformFnCall -
withRetry<
T> (FutureOr< T> action(), {int retryTimes = 3, int retryIntervalMills = 500}) → Future<T>
Typedefs
-
Envelope<
T> = UnSigned< T> -
FetchFunction<
T> = Future< T> Function({dynamic body, required String endpoint, Map<String, String> ? headers, String? host, FetchMethod method}) -
HttpAgentRequest
= HttpAgentBaseRequest<
WithToJson> -
HttpAgentRequestTransformFnCall
= Future<
HttpAgentRequest?> Function(HttpAgentRequest args) - NonceFunc = Nonce Function()
- ReadRequest = ReadStateRequest