Util

object Util

Utility functions for the Stellar SDK.

Provides public utility functions for SDK version information and internal utilities for common operations used throughout the SDK.

Properties

Link copied to clipboard
const val LEDGERS_PER_DAY: Int

Average number of ledgers closed per day on the Stellar network (~5s per ledger).

Link copied to clipboard
const val LEDGERS_PER_HOUR: Int = 720

Average number of ledgers closed per hour on the Stellar network (~5s per ledger).

Link copied to clipboard

Number of stroops in one XLM (1 XLM = 10,000,000 stroops).

Functions

Link copied to clipboard
fun amountToStroops(amount: String): BigInteger

Converts a decimal XLM amount string to stroops using BigDecimal arithmetic.

Link copied to clipboard

Decodes a Base64URL-encoded string to a byte array.

Link copied to clipboard

Encodes a byte array to Base64URL format (RFC 4648 Section 5, no padding).

Link copied to clipboard

Constant-time byte array comparison to prevent timing side-channel attacks.

Link copied to clipboard

Returns the version of the Stellar SDK.

Link copied to clipboard
fun stroopsToI128ScVal(stroops: BigInteger): SCValXdr

Converts stroops (BigInteger) to I128 ScVal.