Package org.stellar.sdk
Class LiquidityPool
java.lang.Object
org.stellar.sdk.LiquidityPool
Represents a LiquidityPoolParameters object on the Stellar network.
See: Liquidity Pool
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLiquidityPool(Asset assetA, Asset assetB) Constructs a new LiquidityPool with specified assets and default fee. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic LiquidityPoolCreates a LiquidityPool from its XDR representation.@NonNull AssetThe first asset in the pool, it must respect the rule assetA < assetB.@NonNull AssetThe second asset in the pool, it must respect the rule assetA < assetB.intgetFee()The liquidity pool fee.Generates the LiquidityPoolID for this LiquidityPool.inthashCode()toString()toXdr()Converts this LiquidityPool to its XDR representation.
-
Field Details
-
FEE
public static int FEE
-
-
Constructor Details
-
LiquidityPool
Constructs a new LiquidityPool with specified assets and default fee.- Parameters:
assetA- The first asset in the pool, it must respect the rule assetA < assetB.assetB- The second asset in the pool, it must respect the rule assetA < assetB.- Throws:
IllegalArgumentException- if assets are not in lexicographic order.
-
-
Method Details
-
toXdr
Converts this LiquidityPool to its XDR representation.- Returns:
- The XDR object representing this LiquidityPool.
-
fromXdr
Creates a LiquidityPool from its XDR representation.- Parameters:
xdr- The XDR object to convert from.- Returns:
- A new LiquidityPool object.
- Throws:
IllegalArgumentException- if the XDR object is not of type LIQUIDITY_POOL_CONSTANT_PRODUCT.
-
getLiquidityPoolId
Generates the LiquidityPoolID for this LiquidityPool.- Returns:
- The LiquidityPoolID object.
-
getAssetA
The first asset in the pool, it must respect the rule assetA < assetB. CheckAsset.compareTo(Asset)for details. -
getAssetB
The second asset in the pool, it must respect the rule assetA < assetB. CheckAsset.compareTo(Asset)for details. -
getFee
public int getFee()The liquidity pool fee. For now the only fee supported isFEE. -
equals
-
hashCode
public int hashCode() -
toString
-