OZSmartAccountConfig

data class OZSmartAccountConfig(val rpcUrl: String, val networkPassphrase: String, val accountWasmHash: String, val webauthnVerifierAddress: String, val deployerKeypair: KeyPair? = null, val rpId: String? = null, val rpName: String = "Smart Account", val sessionExpiryMs: Long = OZConstants.DEFAULT_SESSION_EXPIRY_MS, val signatureExpirationLedgers: Int = Util.LEDGERS_PER_HOUR, val timeoutInSeconds: Int = OZConstants.DEFAULT_TIMEOUT_SECONDS, val relayerUrl: String? = null, val indexerUrl: String? = null, val webauthnProvider: WebAuthnProvider? = null, val storage: StorageAdapter = InMemoryStorageAdapter(), val externalWallet: ExternalWalletAdapter? = null, val maxContextRuleScanId: UInt)

Configuration for OpenZeppelin Smart Account operations.

This configuration data class defines all parameters required to interact with OpenZeppelin smart accounts on Stellar/Soroban. It includes network connectivity settings, contract addresses, and operational parameters.

Example usage:

val config = OZSmartAccountConfig(
rpcUrl = "https://soroban-testnet.stellar.org",
networkPassphrase = "Test SDF Network ; September 2015",
accountWasmHash = "abc123...",
webauthnVerifierAddress = "CBCD1234..."
)

// With custom settings using builder
val customConfig = OZSmartAccountConfig.builder(
rpcUrl = "https://soroban-testnet.stellar.org",
networkPassphrase = "Test SDF Network ; September 2015",
accountWasmHash = "abc123...",
webauthnVerifierAddress = "CBCD1234..."
)
.rpName("My Custom Wallet")
.sessionExpiryMs(86400000L) // 1 day
.relayerUrl("https://relayer.example.com")
.storage(myPersistentStorage)
.externalWallet(freighterAdapter)
.build()
FieldRequiredDefault
rpcUrlYes-
networkPassphraseYes-
accountWasmHashYes-
webauthnVerifierAddressYes-
deployerKeypairNoDeterministic deployer
rpIdNoBrowser default
rpNameNo"Smart Account"
sessionExpiryMsNo604800000 (7 days)
signatureExpirationLedgersNo720 (~1 hour)
timeoutInSecondsNo30
relayerUrlNonull
indexerUrlNonull
webauthnProviderNonull
storageNoInMemoryStorageAdapter
externalWalletNonull
maxContextRuleScanIdNo50

Throws

if required parameters are blank or invalid (e.g., accountWasmHash is not a 64-character hex string, or webauthnVerifierAddress is not a valid C-address).

Constructors

Link copied to clipboard
constructor(rpcUrl: String, networkPassphrase: String, accountWasmHash: String, webauthnVerifierAddress: String, deployerKeypair: KeyPair? = null, rpId: String? = null, rpName: String = "Smart Account", sessionExpiryMs: Long = OZConstants.DEFAULT_SESSION_EXPIRY_MS, signatureExpirationLedgers: Int = Util.LEDGERS_PER_HOUR, timeoutInSeconds: Int = OZConstants.DEFAULT_TIMEOUT_SECONDS, relayerUrl: String? = null, indexerUrl: String? = null, webauthnProvider: WebAuthnProvider? = null, storage: StorageAdapter = InMemoryStorageAdapter(), externalWallet: ExternalWalletAdapter? = null, maxContextRuleScanId: UInt)

Types

Link copied to clipboard
class Builder(rpcUrl: String, networkPassphrase: String, accountWasmHash: String, webauthnVerifierAddress: String)

Builder for creating OZSmartAccountConfig with a fluent API.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The WASM hash of the smart account contract (64-character hex string).

Link copied to clipboard

The keypair used for deploying smart account contracts.

Link copied to clipboard

External wallet adapter for signing transactions with an external signer.

Link copied to clipboard

Optional indexer endpoint URL for credential-to-contract mapping.

Link copied to clipboard

Maximum rule ID to scan when iterating context rules.

Link copied to clipboard

The Stellar network passphrase.

Link copied to clipboard

Optional relayer endpoint URL for fee sponsoring.

Link copied to clipboard

The Soroban RPC endpoint URL.

Link copied to clipboard
val rpId: String?

The WebAuthn Relying Party ID (rpId).

Link copied to clipboard

The WebAuthn Relying Party name displayed to users during authentication.

Link copied to clipboard

Session expiry time in milliseconds.

Link copied to clipboard

Signature expiration in ledgers for auth entries.

Link copied to clipboard

Storage adapter for persisting credentials and session data.

Link copied to clipboard

Default timeout for operations in seconds.

Link copied to clipboard

Optional WebAuthn provider for passkey authentication.

Link copied to clipboard

The contract address of the WebAuthn signature verifier (C-address).

Functions

Link copied to clipboard
suspend fun effectiveDeployer(): KeyPair

Returns the deployer keypair, creating the default if needed.

Link copied to clipboard

Returns the indexer URL that will be used after applying fallback logic.