Skip to content
๐ŸŽ‰ Welcome! Translations are currently experimental. | ็ฟป่จณใฏ็พๅœจๅฎŸ้จ“็š„ใงใ™ใ€‚ | ็ฟป่ฏ‘็›ฎๅ‰ๅค„ไบŽๅฎž้ชŒ้˜ถๆฎตใ€‚
Click here to submit feedback! | ใ“ใ“ใ‚’ใ‚ฏใƒชใƒƒใ‚ฏใ—ใฆใƒ•ใ‚ฃใƒผใƒ‰ใƒใƒƒใ‚ฏใ‚’้€ไฟกใ—ใฆใใ ใ•ใ„๏ผ | ็‚นๅ‡ป่ฟ™้‡Œๆไบคๅ้ฆˆ๏ผ

Client Configuration

Whilst Kaptos offers a consistent interface for interacting with Aptos across all supported platforms, it also features both shared and platform-specific configuration options for its various clients.

These configuration options allow you to customize the behavior of the client to suit your needs. They can be set by creating a ClientConfig object and passing it to the AptosSettings object when creating an Aptos client as shown below:

val clientConfig = ClientConfig(followRedirects = false, retryOnServerErrors = 3)
val client = Aptos(AptosConfig(AptosSettings(clientConfig = clientConfig)))

This page will guide you through the available configuration options for each platform.

Shared Configuration

followRedirects โ€” A boolean value that determines whether the client should follow redirects. The default value is true.

retryOnServerErrors โ€” The number of times to retry the request if a server error occurs. The default value is โ€”1, which means no retries.

requestTimeout โ€” The timeout in milliseconds for the request. The default value is 10_000.

maxRetries โ€” The maximum number of times to retry the request. The default value is -1, which means no retries.

agent โ€” A String that specifies the user agent to use for the connection. Defaults to Kaptos/{PLATFORM}.

likeAgent โ€” A UserAgent enum value that specifies the user agent to use for the connection.

proxy โ€” A String that specifies the proxy server to use for the connection.

cache โ€” A boolean value that determines whether to cache the response. The default value is false.

JVM Configuration

pipelining โ€” A boolean value that determines whether the client should use pipelining. The default value is false.

pipelineMaxSize โ€” The maximum number of requests to pipeline. The default value is 20.

maxConnectionsPerRoute โ€” The maximum number of connections per route. The default value is 100.

maxConnectionsCount โ€” The maximum number of connections. The default value is 100.

connectTimeoutMillis โ€” The timeout in milliseconds for establishing a connection to the server. The default value is 10_000.

keepAliveTime โ€” The time in milliseconds to keep a connection alive. The default value is 5_000.

connectAttempts โ€” The number of times to attempt to connect to the server. The default value is 5.

connectTimeout โ€” The timeout in milliseconds for establishing a connection to the server. The default value is 10_000.

Android Configuration

followSslRedirects โ€” A boolean value that determines whether the client should follow SSL redirects. The default value is true.

connectTimeoutMillis โ€” The timeout in milliseconds for establishing a connection to the server. The default value is 10_000.

readTimeoutMillis โ€” The timeout in milliseconds for reading data from the server. The default value is 10_000.

writeTimeoutMillis โ€” The timeout in milliseconds for writing data to the server. The default value is 10_000.

maxRetries โ€” The maximum number of times to retry the request. The default value is -1, which means no retries.

connectTimeout โ€” The timeout in milliseconds for establishing a connection to the server. The default value is 10_000.

Apple (iOS, macOS) Configuration

Apple platforms currently do not have any platform-specific configuration options.

Web Configuration

Web platforms currently do not have any platform-specific configuration options.

Linux Configuration

connectTimeout โ€” The timeout in milliseconds for establishing a connection to the server. The default value is 10_000.

Windows Configuration

connectTimeout โ€” The timeout in milliseconds for establishing a connection to the server. The default value is 10_000.