LiquidityPoolDepositOperation
extends AbstractOperation
in package
Represents <a href="https://developers.stellar.org" target="_blank">Stellar developer docs</a> operation.
Deposits assets into a liquidity pool, contributing to the pool's reserves.
Tags
Table of Contents
Methods
- __construct() : mixed
- Creates a new LiquidityPoolDepositOperation.
- fromXdr() : AbstractOperation
- Creates an operation from its XDR representation.
- fromXdrAmount() : string
- Converts an XDR amount (stroops) to a decimal string.
- fromXdrOperation() : LiquidityPoolDepositOperation
- Creates a LiquidityPoolDepositOperation from its XDR representation.
- getLiqudityPoolId() : string
- Gets the liquidity pool ID.
- getMaxAmountA() : string
- Gets the maximum amount of asset A.
- getMaxAmountB() : string
- Gets the maximum amount of asset B.
- getMaxPrice() : Price
- Gets the maximum price.
- getMinPrice() : Price
- Gets the minimum price.
- getSourceAccount() : MuxedAccount|null
- Gets the source account for this operation.
- setSourceAccount() : void
- Sets the source account for this operation.
- toOperationBody() : XdrOperationBody
- Converts this operation to its XDR operation body representation.
- toXdr() : XdrOperation
- Converts this operation to its XDR representation.
- toXdrAmount() : BigInteger
- Converts a decimal amount string to XDR amount format (stroops).
Methods
__construct()
Creates a new LiquidityPoolDepositOperation.
public
__construct(string $liqudityPoolId, string $maxAmountA, string $maxAmountB, Price $minPrice, Price $maxPrice) : mixed
Parameters
- $liqudityPoolId : string
-
The liquidity pool ID
- $maxAmountA : string
-
Maximum amount of asset A to deposit (as a decimal string)
- $maxAmountB : string
-
Maximum amount of asset B to deposit (as a decimal string)
- $minPrice : Price
-
Minimum exchange rate for asset A to asset B
- $maxPrice : Price
-
Maximum exchange rate for asset A to asset B
fromXdr()
Creates an operation from its XDR representation.
public
static fromXdr(XdrOperation $xdrOp) : AbstractOperation
Parameters
- $xdrOp : XdrOperation
-
The XDR operation to convert
Return values
AbstractOperation —The resulting operation instance
fromXdrAmount()
Converts an XDR amount (stroops) to a decimal string.
public
static fromXdrAmount(BigInteger $stroops) : string
Parameters
- $stroops : BigInteger
-
The amount in stroops (1 stroop = 0.0000001)
Return values
string —The amount as a decimal string
fromXdrOperation()
Creates a LiquidityPoolDepositOperation from its XDR representation.
public
static fromXdrOperation(XdrLiquidityPoolDepositOperation $xdrOp) : LiquidityPoolDepositOperation
Parameters
- $xdrOp : XdrLiquidityPoolDepositOperation
-
The XDR liquidity pool deposit operation to convert
Return values
LiquidityPoolDepositOperation —The resulting LiquidityPoolDepositOperation instance
getLiqudityPoolId()
Gets the liquidity pool ID.
public
getLiqudityPoolId() : string
Return values
string —The liquidity pool ID
getMaxAmountA()
Gets the maximum amount of asset A.
public
getMaxAmountA() : string
Return values
string —The maximum amount as a decimal string
getMaxAmountB()
Gets the maximum amount of asset B.
public
getMaxAmountB() : string
Return values
string —The maximum amount as a decimal string
getMaxPrice()
Gets the maximum price.
public
getMaxPrice() : Price
Return values
Price —The maximum price
getMinPrice()
Gets the minimum price.
public
getMinPrice() : Price
Return values
Price —The minimum price
getSourceAccount()
Gets the source account for this operation.
public
getSourceAccount() : MuxedAccount|null
Return values
MuxedAccount|null —The source account, or null if using the transaction's source account
setSourceAccount()
Sets the source account for this operation.
public
setSourceAccount(MuxedAccount|null $sourceAccount) : void
Parameters
- $sourceAccount : MuxedAccount|null
-
The source account, or null to use the transaction's source account
toOperationBody()
Converts this operation to its XDR operation body representation.
public
toOperationBody() : XdrOperationBody
Return values
XdrOperationBody —The XDR operation body
toXdr()
Converts this operation to its XDR representation.
public
toXdr() : XdrOperation
Return values
XdrOperation —The XDR operation
toXdrAmount()
Converts a decimal amount string to XDR amount format (stroops).
public
static toXdrAmount(string $strAmount) : BigInteger
Parameters
- $strAmount : string
-
The amount as a decimal string
Return values
BigInteger —The amount in stroops (1 stroop = 0.0000001)