Skip to main content

SpvFromBTCSwapState

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:47

State enum for SPV vault (UTXO-controlled vault) based swaps

Enumeration Members

CLOSED

CLOSED: -5;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:53

Catastrophic failure has occurred when processing the swap on the smart chain side, this implies a bug in the smart contract code or the user and intermediary deliberately creating a bitcoin transaction with invalid format unparsable by the smart contract.


FAILED

FAILED: -4;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:58

Some of the bitcoin swap transaction inputs were double-spent, this means the swap has failed and no BTC was sent


DECLINED

DECLINED: -3;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:62

The intermediary (LP) declined to co-sign the submitted PSBT, hence the swap failed


QUOTE_EXPIRED

QUOTE_EXPIRED: -2;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:66

Swap has expired for good and there is no way how it can be executed anymore


QUOTE_SOFT_EXPIRED

QUOTE_SOFT_EXPIRED: -1;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:71

A swap is almost expired, and it should be presented to the user as expired, though there is still a chance that it will be processed


CREATED

CREATED: 0;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:77

Swap was created, use the SpvFromBTCSwap.getFundedPsbt or SpvFromBTCSwap.getPsbt functions to get the bitcoin swap PSBT that should be signed by the user's wallet and then submitted via the SpvFromBTCSwap.submitPsbt function.


SIGNED

SIGNED: 1;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:81

Swap bitcoin PSBT was submitted by the client to the SDK


POSTED

POSTED: 2;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:88

Swap bitcoin PSBT sent to the intermediary (LP), waiting for the intermediary co-sign it and broadcast. You can use the SpvFromBTCSwap.waitTillClaimedOrFronted function to wait till the intermediary broadcasts the transaction and the transaction confirms.


BROADCASTED

BROADCASTED: 3;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:94

Intermediary (LP) has co-signed and broadcasted the bitcoin transaction. You can use the SpvFromBTCSwap.waitTillClaimedOrFronted function to wait till the transaction confirms.


FRONTED

FRONTED: 4;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:99

Settlement on the destination smart chain was fronted and funds were already received by the user, even before the final settlement.


BTC_TX_CONFIRMED

BTC_TX_CONFIRMED: 5;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:105

Bitcoin transaction confirmed with necessary amount of confirmations, wait for automatic settlement by the watchtower with the waitTillClaimedOrFronted function, or settle manually using the FromBTCSwap.claim or FromBTCSwap.txsClaim function.


CLAIMED

CLAIMED: 6;

Defined in: atomiq-sdk/src/swaps/spv_swaps/SpvFromBTCSwap.ts:109

Swap settled on the smart chain and funds received