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:Clientdata:CrossChainSwapData
Properties
status
status: CrossChainSwapStatusproviderStatus
NEAR Intents' own status word.
providerStatus: stringnetwork
network: stringoriginChain
originChain: SwapChainoriginAsset
originAsset: stringoriginContract
originContract: string | nulldestinationChain
destinationChain: SwapChaindestinationAsset
destinationAsset: stringdestinationContract
destinationContract: string | nullamountIn
amountIn: stringfeeBps
feeBps: numberfeeAmount
feeAmount: stringamountOutEstimated
amountOutEstimated: stringamountOutMin
amountOutMin: stringslippageBps
slippageBps: numberrecipient
recipient: stringrefundTo
refundTo: stringdepositAddress
depositAddress: stringdepositMemo
depositMemo: string | nulldepositUri
depositUri: stringqr
QR of {@link depositUri}; list rows do not carry it.
qr: string | nulldepositTxHash
depositTxHash: string | nullamountOut
amountOut: string | nullrefundedAmount
refundedAmount: string | nulloriginTxHashes
originTxHashes: CrossChainTransactionData[] | nulldestinationTxHashes
destinationTxHashes: CrossChainTransactionData[] | nulltimeEstimateSeconds
timeEstimateSeconds: numbercorrelationId
correlationId: stringquoteSignature
Keep it: NEAR Intents' signature over the quote settles a dispute.
quoteSignature: stringidempotencyKey
idempotencyKey: string | nullexpiresAt
expiresAt: DatecreatedAt
createdAt: DateupdatedAt
updatedAt: Dateprotected
protected _patch(data: CrossChainSwapData): thisget
Whether the swap has reached an outcome that will not change.
get isFinal(): booleanget
get isSucceeded(): booleanMethods
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(): CrossChainSwapDataReturns CrossChainSwapData