public final class LiquidityPool
extends java.lang.Object
See: Liquidity Pool
Modifier and Type | Field and Description |
---|---|
static int |
FEE |
Constructor and Description |
---|
LiquidityPool(Asset assetA,
Asset assetB)
Constructs a new LiquidityPool with specified assets and default fee.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
static LiquidityPool |
fromXdr(LiquidityPoolParameters xdr)
Creates a LiquidityPool from its XDR representation.
|
@NonNull Asset |
getAssetA()
The first asset in the pool, it must respect the rule assetA < assetB.
|
@NonNull Asset |
getAssetB()
The second asset in the pool, it must respect the rule assetA < assetB.
|
int |
getFee()
The liquidity pool fee.
|
java.lang.String |
getLiquidityPoolId()
Generates the LiquidityPoolID for this LiquidityPool.
|
int |
hashCode() |
java.lang.String |
toString() |
LiquidityPoolParameters |
toXdr()
Converts this LiquidityPool to its XDR representation.
|
public LiquidityPool(Asset assetA, Asset assetB)
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.java.lang.IllegalArgumentException
- if assets are not in lexicographic order.public LiquidityPoolParameters toXdr()
public static LiquidityPool fromXdr(LiquidityPoolParameters xdr)
xdr
- The XDR object to convert from.java.lang.IllegalArgumentException
- if the XDR object is not of type
LIQUIDITY_POOL_CONSTANT_PRODUCT.public java.lang.String getLiquidityPoolId()
@NonNull public @NonNull Asset getAssetA()
Asset.compareTo(Asset)
for details.@NonNull public @NonNull Asset getAssetB()
Asset.compareTo(Asset)
for details.public int getFee()
FEE
.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object