LiquidityPoolAsset

LiquidityPoolAsset

LiquidityPoolAsset class represents a liquidity pool trustline change.

Constructor

new LiquidityPoolAsset(assetA, assetB, fee)

Source:
Parameters:
Name Type Description
assetA Asset

– The first asset in the Pool, it must respect the rule assetA < assetB. See Asset.compare for more details on how assets are sorted.

assetB Asset

– The second asset in the Pool, it must respect the rule assetA < assetB. See Asset.compare for more details on how assets are sorted.

fee number

– The liquidity pool fee. For now the only fee supported is 30.

Classes

LiquidityPoolAsset

Methods

(static) fromOperation(ctAssetXdr) → {LiquidityPoolAsset}

Returns a liquidity pool asset object from its XDR ChangeTrustAsset object representation.

Source:
Parameters:
Name Type Description
ctAssetXdr xdr.ChangeTrustAsset

The asset XDR object.

Returns:
Type:
LiquidityPoolAsset

equals(other) → {boolean}

Source:
Parameters:
Name Type Description
other LiquidityPoolAsset

the LiquidityPoolAsset to compare

Returns:
Type:
boolean

true if this asset equals the given asset.

getAssetType() → {AssetType.liquidityPoolShares}

Source:
See:
Returns:
Type:
AssetType.liquidityPoolShares

asset type. Can only be liquidity_pool_shares.

getLiquidityPoolParameters() → {LiquidityPoolParameters}

Source:
Returns:
Type:
LiquidityPoolParameters

Liquidity pool parameters.

toXDRObject() → {xdr.ChangeTrustAsset}

Returns the xdr.ChangeTrustAsset object for this liquidity pool asset.

Note: To convert from an Asset to xdr.ChangeTrustAsset please refer to the Asset.toChangeTrustXDRObject method.

Source:
Returns:
Type:
xdr.ChangeTrustAsset

XDR ChangeTrustAsset object.