Table of Contents

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

networkConfig NetworkConfig

The endpoints and chain ID for the network. If none are provided, Devnet is used.

headers Dictionary<string, string>

Default headers to be added to all requests.

requestClient RequestClient

The request client used to make HTTP requests. If none is provided, a default client is used. The default client honours httpTimeout.

httpTimeout TimeSpan?

The per-request timeout for the default HTTP client. Defaults to 30 seconds. Pass InfiniteTimeSpan to disable. Ignored if a custom requestClient is 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

TimeSpan

Headers

public readonly Dictionary<string, string> Headers

Field Value

Dictionary<string, string>

HttpTimeout

public readonly TimeSpan HttpTimeout

Field Value

TimeSpan

NetworkConfig

public readonly NetworkConfig NetworkConfig

Field Value

NetworkConfig

RequestClient

public readonly RequestClient RequestClient

Field Value

RequestClient

Methods

GetRequestUrl(ApiType)

public string GetRequestUrl(ApiType apiType)

Parameters

apiType ApiType

Returns

string