LiquidityOperation
One deposit into, or withdrawal from, a Stellar liquidity pool. The server builds the envelope and the wallet signs it, so an operation is a two-step object…
One deposit into, or withdrawal from, a Stellar liquidity pool. The server builds the envelope and the wallet signs it, so an operation is a two-step object: it arrives PENDING carrying an unsigned xdr, and reaches SUBMITTED/SUCCEEDED only once the signed envelope comes back through submit(). Both steps are available on the instance — await operation.submit({ signedXdr }) — so a caller never has to keep the id and the manager in scope alongside it.
Constructor
LiquidityOperation
constructor(client: Client, data: LiquidityOperationData)Parameters
client:Clientdata:LiquidityOperationData
Properties
kind
Deposit or withdrawal.
kind: LiquidityOperationKindstatus
status: LiquidityOperationStatusnetwork
network: stringsource
Account whose funds move, and which must sign.
source: stringpoolId
The pool this operation acts on (hex id).
poolId: stringassetA
assetA: stringassetAIssuer
assetAIssuer: string | nullassetB
assetB: stringassetBIssuer
assetBIssuer: string | nullamountA
Maximum of asset A put in (deposit), or minimum taken out (withdrawal).
amountA: stringamountB
amountB: stringshares
Pool shares minted or burned; null until the network settles a deposit.
shares: string | nullminPrice
Price band a deposit executes within, as decimal strings.
minPrice: string | nullmaxPrice
maxPrice: string | nullslippageBps
slippageBps: numberidempotencyKey
idempotencyKey: string | nullfeeBps
feeBps: numberfeeAmountA
feeAmountA: stringfeeAmountB
feeAmountB: stringfeeWallet
feeWallet: string | nullcommissionMemo
commissionMemo: string | nullxdr
Unsigned transaction envelope (base64 XDR) — what the wallet signs.
xdr: stringuri
SEP-7 web+stellar:tx deep link for the same envelope.
uri: stringtxHash
txHash: stringqr
QR code of the SEP-7 URI (PNG data URL).
qr: stringexpiresAt
When the built envelope stops being submittable.
expiresAt: Date | nullcreatedAt
createdAt: DateupdatedAt
updatedAt: Dateprotected
protected _patch(data: LiquidityOperationData): thisget
True while the envelope still needs a signature.
get isPending(): booleanget
True once the network accepted it.
get isSucceeded(): booleanget
True for a deposit, false for a withdrawal.
get isDeposit(): booleanMethods
fetch()
Re-fetch this operation and patch it in place.
fetch(): Promise<this>Returns Promise<this>
submit()
Relay the signed envelope to the network and patch this instance with the result.
submit(options: SubmitLiquidityOptions): Promise<LiquiditySubmitOutcome>Parameters
options:SubmitLiquidityOptions
Returns Promise<LiquiditySubmitOutcome>
toJSON()
toJSON(): LiquidityOperationDataReturns LiquidityOperationData