Skip to content

Commit

Permalink
add missing swap watcher events
Browse files Browse the repository at this point in the history
  • Loading branch information
smk762 committed Nov 1, 2024
1 parent 75c7103 commit de028d5
Showing 1 changed file with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Click on an Event below to view its structure:
* [TakerPaymentSent](/komodo-defi-framework/api/common_structures/swaps/taker_events/#taker-payment-sent)
* [TakerPaymentSpent](/komodo-defi-framework/api/common_structures/swaps/taker_events/#taker-payment-spent)
* [MakerPaymentSpent](/komodo-defi-framework/api/common_structures/swaps/taker_events/#maker-payment-spent)
* [MakerPaymentSpentByWatcher](/komodo-defi-framework/api/common_structures/swaps/taker_events/#maker-payment-spent-by-watcher)

* [Finished](/komodo-defi-framework/api/common_structures/swaps/taker_events/#finished)

## Taker Error Events
Expand All @@ -40,6 +42,7 @@ Click on an Event below to view its structure:
* [TakerPaymentWaitRefundStarted](/komodo-defi-framework/api/common_structures/swaps/taker_events/#taker-payment-wait-refund-started)
* [TakerPaymentRefundStarted](/komodo-defi-framework/api/common_structures/swaps/taker_events/#taker-payment-refund-started)
* [TakerPaymentRefunded](/komodo-defi-framework/api/common_structures/swaps/taker_events/#taker-payment-refunded)
* [TakerPaymentRefundedByWatcher](/komodo-defi-framework/api/common_structures/swaps/taker_events/#taker-payment-refunded-by-watcher)
* [TakerPaymentRefundFailed](/komodo-defi-framework/api/common_structures/swaps/taker_events/#taker-payment-refund-failed)
* [TakerPaymentRefundFinished](/komodo-defi-framework/api/common_structures/swaps/taker_events/#taker-payment-refund-finished)

Expand Down Expand Up @@ -114,6 +117,7 @@ Click on an Event below to view its structure:
```
</CollapsibleSection>


#### StartFailed

The `StartFailed` event indicates that some of the pre-checks did not pass, and therefore the swap did not start.
Expand All @@ -130,6 +134,7 @@ The swap finishes immediately when this event occurs.
```
</CollapsibleSection>


#### Negotiated

The `Negotiated` event indicates that taker has received and validated swap negotiation data from maker.
Expand Down Expand Up @@ -157,6 +162,7 @@ Taker sends dex fee after this event occurs.
```
</CollapsibleSection>


#### NegotiateFailed

The `NegotiateFailed` event indicates that maker negotiation data was not received or did not pass validation.
Expand All @@ -178,6 +184,7 @@ The swap finishes immediately when this event occurs.
```
</CollapsibleSection>


#### TakerFeeSent

The `TakerFeeSent` event indicates that taker broadcast the dex fee transaction.
Expand All @@ -201,6 +208,7 @@ Taker starts waiting for maker payment after this event occurs.
```
</CollapsibleSection>


#### TakerFeeSendFailed

The `TakerFeeSendFailed` event indicates that the taker dex fee transaction failed to broadcast to the taker coin blockchain, or that the taker failed to send the transaction data to maker.
Expand All @@ -217,6 +225,7 @@ The swap finishes immediately when this event occurs.
```
</CollapsibleSection>


#### TakerPaymentInstructionsReceived

The `TakerPaymentInstructionsReceived` event indicates that the taker has received payment instructions.
Expand All @@ -232,6 +241,7 @@ This event does not have additional data.
```
</CollapsibleSection>


#### MakerPaymentValidateFailed

The `MakerPaymentValidateFailed` event indicates that taker was not able to receive or validate the maker payment transaction.
Expand All @@ -248,6 +258,7 @@ The swap finishes immediately when this event occurs.
```
</CollapsibleSection>


#### MakerPaymentReceived

The `MakerPaymentReceived` event indicates that taker received the maker payment transaction data.
Expand Down Expand Up @@ -295,6 +306,7 @@ Taker swap finishes immediately when this event occurs.
```
</CollapsibleSection>


#### MakerPaymentValidatedAndConfirmed

The `MakerPaymentValidatedAndConfirmed` event indicates that taker validated maker payment and the payment was confirmed the required number of times.
Expand All @@ -311,6 +323,7 @@ This event does not have additional data.
```
</CollapsibleSection>


#### TakerPaymentSent

The `TakerPaymentSent` event indicates that taker broadcast taker payment transaction to taker coin blockchain.
Expand All @@ -334,6 +347,7 @@ Taker starts waiting for maker to spend this transaction.
```
</CollapsibleSection>


#### TakerPaymentTransactionFailed

The `TakerPaymentTransactionFailed` event indicates that taker failed to broadcast transaction to taker coin blockchain.
Expand All @@ -350,6 +364,7 @@ The swap finishes immediately when this event occurs.
```
</CollapsibleSection>


#### TakerPaymentWaitConfirmFailed

The `TakerPaymentWaitConfirmFailed` event indicates that the taker payment transaction did not reach the required number of confirmations before the internal timeout expiration.
Expand All @@ -366,6 +381,7 @@ When this event occurs taker starts waiting for taker payment lock time expirati
```
</CollapsibleSection>


#### TakerPaymentDataSendFailed

The `TakerPaymentDataSendFailed` event indicates that taker was not able to send his payment data to maker due to a network error.
Expand All @@ -382,6 +398,7 @@ When this event occurs taker starts waiting for taker payment lock time expirati
```
</CollapsibleSection>


#### TakerPaymentSpent

The `TakerPaymentSpent` event indicates that maker spent taker payment and taker discovered the transaction.
Expand Down Expand Up @@ -410,6 +427,7 @@ When this event occurs taker extracts the secret from the transaction and attemp
```
</CollapsibleSection>


#### TakerPaymentWaitForSpendFailed

The `TakerPaymentWaitForSpendFailed` event indicates that maker did not spend taker payment before lock time expiration.
Expand All @@ -426,6 +444,7 @@ When this event occurs taker attempts to refund the payment.
```
</CollapsibleSection>


#### MakerPaymentSpendFailed

The `MakerPaymentSpendFailed` event indicates that taker failed to broadcast **maker payment spend** transaction to the maker coin blockchain.
Expand All @@ -447,6 +466,7 @@ The swap finishes immediately when this event occurs.
```
</CollapsibleSection>


#### MakerPaymentSpent

The `MakerPaymentSpent` event indicates that taker spent maker payment.
Expand All @@ -470,6 +490,31 @@ The swap finishes immediately when this event occurs.
```
</CollapsibleSection>


#### MakerPaymentSpentByWatcher

The `MakerPaymentSpentByWatcher` event indicates that the maker payment has been released to the taker while the taker was offline.

The swap finishes immediately when this event occurs.

| Structure | Type | Description |
| --------- | ------ | --------------------------------------- |
| tx\_hash | string | the hash of the transaction |
| tx\_hex | string | transaction bytes in hexadecimal format |

<CollapsibleSection expandedText="Hide Event" collapsedText="Show Event">
```json
{
"type" : "MakerPaymentSpentByWatcher",
"data" : {
"tx_hash" : "a2513faf3d479b8e14096be9b0ba8977d669a7a9ca722be0e2bbe3833fa51a4e",
"tx_hex" : "0400008085202f8901d331b98aec95c8ed36484398b7bdec98858d5efae3ac0eb8be4cb39ef016e0fd00000000d7473044022049a5831a2ef057c5a119b19a694dc653e37a1a8b0122125132aecd5dd47312ff02206672c43113830247623f508ee49ba2db15732c22d8f2fec3c8acfc1f19b84654012017456a9b1b3817b612737c929a731e241a28147fc0530e876f9f79e34abd86f7004c6b630457f7ec64b17521031bb83b58ec130e28e0a6d5d2acf2eb01b0d3f1670e021d47d31db8a858219da8ac6782012088a914c1eae4df923e04a343030902472e70664a525e6d8821023c5ba1d7ef6fa015eb33defb3aba2a961898a51bbb7ff30344d07ba75ad3f289ac68ffffffff01b2530000000000001976a91484c74592ed8ac05340906784d277ca4d4e0af08e88ac57f7ec64000000000000000000000000000000"
}
}
```
</CollapsibleSection>


#### TakerPaymentWaitRefundStarted

`TakerPaymentWaitRefundStarted` event indicates that taker started waiting for lock time expiration to refund the payment.
Expand All @@ -483,6 +528,7 @@ The swap finishes immediately when this event occurs.
```
</CollapsibleSection>


#### TakerPaymentRefundStarted

`TakerPaymentRefundStarted` event indicates that taker was has initiated the refund process.
Expand All @@ -493,6 +539,23 @@ The swap finishes immediately when this event occurs.
```
</CollapsibleSection>


#### TakerPaymentRefundedByWatcher

The `TakerPaymentRefundedByWatcher` is fired if the watcher refunded the taker payment for the taker while the taker is offline.
It will be shown in the swap status when the taker runs the defi framework again after being offline (if the watcher refunded the swap during the time the taker was offline).

| Structure | Type | Description |
| --------- | ------ | ---------------------------------- |
| error | string | error description with stack trace |

<CollapsibleSection expandedText="Hide Event" collapsedText="Show Event">
```json
TODO: Example TBA
```
</CollapsibleSection>


#### TakerPaymentRefundFailed

`TakerPaymentRefundFailed` event indicates that taker was not able to broadcast a refund transaction to taker coin blockchain.
Expand All @@ -508,6 +571,7 @@ The swap finishes immediately when this event occurs.
```
</CollapsibleSection>


#### TakerPaymentRefunded

The `TakerPaymentRefunded` event indicates that taker broadcast the taker payment refund transaction.
Expand All @@ -519,6 +583,7 @@ The swap finishes immediately when this event occurs.
| tx\_hash | string | the hash of the transaction |
| tx\_hex | string | transaction bytes in hexadecimal format |


#### TakerPaymentRefundFinished

The `TakerPaymentRefundFinished` event indicates that taker refund process is complete.
Expand All @@ -531,6 +596,7 @@ The swap finishes immediately when this event occurs. This event does not have a
```
</CollapsibleSection>


#### Finished

The `Finished` event indicates that the swap finished.
Expand Down

0 comments on commit de028d5

Please sign in to comment.