@cosmosapp/pay_sdkDefiniçõesServidor

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: Client
  • data: LiquidityOperationData

Properties

kind

Deposit or withdrawal.

kind: LiquidityOperationKind

status

status: LiquidityOperationStatus

network

network: string

source

Account whose funds move, and which must sign.

source: string

poolId

The pool this operation acts on (hex id).

poolId: string

assetA

assetA: string

assetAIssuer

assetAIssuer: string | null

assetB

assetB: string

assetBIssuer

assetBIssuer: string | null

amountA

Maximum of asset A put in (deposit), or minimum taken out (withdrawal).

amountA: string

amountB

amountB: string

shares

Pool shares minted or burned; null until the network settles a deposit.

shares: string | null

minPrice

Price band a deposit executes within, as decimal strings.

minPrice: string | null

maxPrice

maxPrice: string | null

slippageBps

slippageBps: number

idempotencyKey

idempotencyKey: string | null

feeBps

feeBps: number

feeAmountA

feeAmountA: string

feeAmountB

feeAmountB: string

feeWallet

feeWallet: string | null

commissionMemo

commissionMemo: string | null

xdr

Unsigned transaction envelope (base64 XDR) — what the wallet signs.

xdr: string

uri

SEP-7 web+stellar:tx deep link for the same envelope.

uri: string

txHash

txHash: string

qr

QR code of the SEP-7 URI (PNG data URL).

qr: string

expiresAt

When the built envelope stops being submittable.

expiresAt: Date | null

createdAt

createdAt: Date

updatedAt

updatedAt: Date

protected

protected _patch(data: LiquidityOperationData): this

get

True while the envelope still needs a signature.

get isPending(): boolean

get

True once the network accepted it.

get isSucceeded(): boolean

get

True for a deposit, false for a withdrawal.

get isDeposit(): boolean

Methods

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(): LiquidityOperationData

Returns LiquidityOperationData

Nesta página