ChangeTrustOperation

Represents a ChangeTrust operation.

Creates, updates, or removes a trustline for an asset or liquidity pool share.

Usage

For Regular Assets

val asset = AssetTypeCreditAlphaNum4("USD", issuer)
val operation = ChangeTrustOperation(asset, "1000.0")

For Liquidity Pool Shares

val pool = LiquidityPool(assetA, assetB)
val operation = ChangeTrustOperation(pool, ChangeTrustOperation.MAX_LIMIT)

Constructors

Link copied to clipboard
constructor(asset: Asset, limit: String = MAX_LIMIT)
constructor(liquidityPool: LiquidityPool, limit: String = MAX_LIMIT)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Legacy property for backward compatibility. Returns the asset if this is an asset trustline, throws exception if this is a liquidity pool trustline.

Link copied to clipboard

The limit of the trustline (defaults to MAX_LIMIT)

Link copied to clipboard

The asset or liquidity pool for the trustline

Link copied to clipboard

Optional source account for this operation.

Functions

Link copied to clipboard
open override fun toOperationBody(): OperationBodyXdr

Converts this operation to its XDR operation body representation.

Link copied to clipboard

Converts this operation to its full XDR representation, including the source account.