@cosmosapp/pay_sdkDefinicionesServidor

CrossChainSwap

A swap between two chains, settled by NEAR Intents — client.crossChainSwaps. Pay exactly amountIn of the origin asset to depositAddress…

A swap between two chains, settled by NEAR Intents — client.crossChainSwaps. Pay exactly {@link amountIn} of the origin asset to {@link depositAddress} (with {@link depositMemo} on Stellar, as a MEMO_TEXT) — {@link depositUri} is that payment as a wallet link. NEAR Intents pays {@link recipient} on the destination chain, or refunds {@link refundTo}. The server follows it; poll with await swap.fetch() or subscribe to the CROSS_CHAIN_SWAP_* webhooks.

Constructor

CrossChainSwap

constructor(client: Client, data: CrossChainSwapData)

Parameters

  • client: Client
  • data: CrossChainSwapData

Properties

status

status: CrossChainSwapStatus

providerStatus

NEAR Intents' own status word.

providerStatus: string

network

network: string

originChain

originChain: SwapChain

originAsset

originAsset: string

originContract

originContract: string | null

destinationChain

destinationChain: SwapChain

destinationAsset

destinationAsset: string

destinationContract

destinationContract: string | null

amountIn

amountIn: string

feeBps

feeBps: number

feeAmount

feeAmount: string

amountOutEstimated

amountOutEstimated: string

amountOutMin

amountOutMin: string

slippageBps

slippageBps: number

recipient

recipient: string

refundTo

refundTo: string

depositAddress

depositAddress: string

depositMemo

depositMemo: string | null

depositUri

depositUri: string

qr

QR of {@link depositUri}; list rows do not carry it.

qr: string | null

depositTxHash

depositTxHash: string | null

amountOut

amountOut: string | null

refundedAmount

refundedAmount: string | null

originTxHashes

originTxHashes: CrossChainTransactionData[] | null

destinationTxHashes

destinationTxHashes: CrossChainTransactionData[] | null

timeEstimateSeconds

timeEstimateSeconds: number

correlationId

correlationId: string

quoteSignature

Keep it: NEAR Intents' signature over the quote settles a dispute.

quoteSignature: string

idempotencyKey

idempotencyKey: string | null

expiresAt

expiresAt: Date

createdAt

createdAt: Date

updatedAt

updatedAt: Date

protected

protected _patch(data: CrossChainSwapData): this

get

Whether the swap has reached an outcome that will not change.

get isFinal(): boolean

get

get isSucceeded(): boolean

Methods

fetch()

Re-fetch from the API, updating this instance in place.

fetch(): Promise<this>

Returns Promise<this>

reportDeposit()

Report the transaction that paid the deposit address so NEAR Intents starts without waiting for its indexer. Updates this instance in place.

reportDeposit(txHash: string): Promise<this>

Parameters

  • txHash: string

Returns Promise<this>

toJSON()

toJSON(): CrossChainSwapData

Returns CrossChainSwapData

En esta página