Class AptosConfig
- Namespace
- Aptos
- Assembly
- Aptos.dll
Instantiate a new instance of the AptosConfig class. This class is used to configure the AptosClient, its dependencies, and endpoints. See the Networks class for a predefined list of networks.
public class AptosConfig
- Inheritance
-
AptosConfig
- Inherited Members
Constructors
AptosConfig(NetworkConfig?, Dictionary<string, string>?, RequestClient?, TimeSpan?)
Instantiate a new instance of the AptosConfig class. This class is used to configure the AptosClient, its dependencies, and endpoints. See the Networks class for a predefined list of networks.
public AptosConfig(NetworkConfig? networkConfig = null, Dictionary<string, string>? headers = null, RequestClient? requestClient = null, TimeSpan? httpTimeout = null)
Parameters
networkConfigNetworkConfigThe endpoints and chain ID for the network. If none are provided, Devnet is used.
headersDictionary<string, string>Default headers to be added to all requests.
requestClientRequestClientThe request client used to make HTTP requests. If none is provided, a default client is used. The default client honours
httpTimeout.httpTimeoutTimeSpan?The per-request timeout for the default HTTP client. Defaults to 30 seconds. Pass InfiniteTimeSpan to disable. Ignored if a custom
requestClientis provided.
Fields
DefaultHttpTimeout
The default per-request HTTP timeout used by the AptosRequestClient. 30 seconds is short enough for interactive apps (Unity/Godot games) to fail fast on flaky networks rather than appear hung for the 100-second default HttpClient timeout.
public static readonly TimeSpan DefaultHttpTimeout
Field Value
Headers
public readonly Dictionary<string, string> Headers
Field Value
HttpTimeout
public readonly TimeSpan HttpTimeout
Field Value
NetworkConfig
public readonly NetworkConfig NetworkConfig
Field Value
RequestClient
public readonly RequestClient RequestClient
Field Value
Methods
GetRequestUrl(ApiType)
public string GetRequestUrl(ApiType apiType)
Parameters
apiTypeApiType