forNetwork

fun forNetwork(networkPassphrase: String, timeoutMs: Long = OZConstants.DEFAULT_INDEXER_TIMEOUT_MS): OZIndexerClient?

Creates an OZIndexerClient for a specific network using the default indexer URL.

Uses the default indexer endpoint for known networks (testnet and mainnet). Returns null if no default URL is configured for the network.

Return

An OZIndexerClient configured for the network, or null if no default URL exists

Example:

val client = OZIndexerClient.forNetwork("Test SDF Network ; September 2015")
if (client != null) {
val contracts = client.lookupByCredentialId(credentialId)
}

Parameters

networkPassphrase

The Stellar network passphrase

timeoutMs

Optional request timeout in milliseconds