Address

class Address(address: String)

Represents a single address in the Stellar network. An address can represent an account, contract, muxed account, claimable balance, or liquidity pool.

Usage

// Parse from string
val accountAddress = Address("GABC...")
val contractAddress = Address("CCJZ5D...")
val muxedAddress = Address("MABC...")

// Create from bytes
val address = Address.fromAccount(publicKeyBytes)
val contract = Address.fromContract(contractIdBytes)

// Convert to XDR
val scAddress = address.toSCAddress()
val scVal = address.toSCVal()

// Get encoded string
val encoded = address.toString() // G..., C..., M..., B..., or L...

Parameters

address

the StrKey encoded format of Stellar address

Throws

if the address is invalid or unsupported

Constructors

Link copied to clipboard
constructor(address: String)

Creates a new Address from a Stellar public key (G...), contract ID (C...), muxed account ID (M...), liquidity pool ID (L...), or claimable balance ID (B...).

Types

Link copied to clipboard

Represents the type of the address.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The type of this address

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Returns the byte array of the Stellar public key or contract ID.

Link copied to clipboard

Gets the encoded string representation of this address.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Converts this object to its SCAddressXdr XDR object representation.

Link copied to clipboard

Converts this object to its SCValXdr XDR object representation.

Link copied to clipboard
open override fun toString(): String