AssetTypeCreditAlphaNum12

Represents issued assets with codes 5-12 characters long.

This class is used for assets with longer codes that don't fit in AlphaNum4.

Validation

  • Code length must be 5-12 characters

  • Code must contain only uppercase letters (A-Z) and digits (0-9)

  • Issuer must be a valid ed25519 public key (G... address)

Usage

val asset = AssetTypeCreditAlphaNum12(
"LONGERNAME",
"GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX"
)

Throws

if code length is not 5-12 characters or issuer is invalid

Constructors

Link copied to clipboard
constructor(code: String, issuer: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val code: String

The asset code (5-12 characters)

Link copied to clipboard
open override val issuer: String

The issuer's account ID (G... address)

Link copied to clipboard
open override val type: AssetTypeXdr

Returns the asset type.

Functions

Link copied to clipboard
open operator override fun compareTo(other: Asset): Int
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
suspend fun getContractId(network: Network): String

Returns the contract ID for this asset on the given network.

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

Returns a canonical string representation of this asset.

Link copied to clipboard
open override fun toXdr(): AssetXdr

Converts this asset to its XDR representation.