Skip to main content

Variable: PENDING\_SWAP\_FATES

gSwap SDK 2.0.0-rc.4


gSwap SDK 2.0.0-rc.4 / PENDING_SWAP_FATES

Variable: PENDING_SWAP_FATES

const PENDING_SWAP_FATES: readonly ["forget", "forget_quietly", "keep"]

Defined in: packages/gswap-sdk/dist/index.d.ts:3560

What to do with a pending swap after confirming it failed (the answer of pendingSwapFateFor).

  • forget: the chain REFUSED the trade, so it did not happen. Drop it AND tell the user.
  • forget_quietly: the confirmation can never succeed (the key is refused: invalid_input). Drop it without claiming anything about the trade.
  • keep: the trade may still have been applied (a timeout, a broken connection, a gateway hiccup, anything not proven). Leave it pending and look again later.

This module holds the decision and nothing of the store, so an app shell that only needs the fate pays for classifyFailure and this table, not for PendingSwapStore.