On this page

latest contributor to this doc

Last Edit:

@gcharang

Taker Swap Events

Click on an Event below to view its structure:

Click on an Event below to view its structure:

  • StartFailed

  • NegotiateFailed

  • TakerFeeSendFailed

  • MakerPaymentValidateFailed

  • MakerPaymentWaitConfirmFailed

  • TakerPaymentTransactionFailed

  • TakerPaymentWaitConfirmFailed

  • TakerPaymentDataSendFailed

  • TakerPaymentWaitForSpendFailed

  • MakerPaymentSpendFailed

  • TakerPaymentWaitRefundStarted

  • TakerPaymentRefundStarted

  • TakerPaymentRefunded

  • TakerPaymentRefundFailed

  • TakerPaymentRefundFinished

    The Started event indicates that mandatory pre-checks, such as "available balance," passed and the swap started successfully.

    The swap goes to negotiation stage after this event occurs.

    StructureTypeDescription
    taker_coinstringthe ticker of taker coin
    maker_coinstringthe ticker of maker coin
    makerstring (hexadecimal)the p2p ID of maker node
    my_persistent_pubstring (hexadecimal)a persistent secp256k1 public key of taker node
    lock_durationnumber (integer)the lock duration of swap payments in seconds. The sender can refund the transaction when the lock duration is passed. The taker payment is locked for the lock duration. The maker payment is locked for lock duration * 2
    maker_amountstring (numeric)the amount of coins to be swapped by maker
    taker_amountstring (numeric)the amount of coins to be swapped by taker
    maker_payment_confirmationsnumber (integer)the required number of blockchain confirmations for maker payment
    maker_payment_requires_notaboolwhether dPoW notarization is required for maker payment; can be null; available since beta-2.0.1738
    taker_payment_confirmationsnumber (integer)the required number of blockchain confirmations for taker payment
    taker_payment_requires_notaboolwhether dPoW notarization is required for taker payment; can be null; available since beta-2.0.1738
    taker_payment_locknumber (UTC timestamp in seconds)the taker payment is locked until this timestamp
    uuidstringthe swap uuid
    started_atnumber (UTC timestamp in seconds)the timestamp at the start of the swap
    maker_payment_waitnumber (UTC timestamp in seconds)taker will wait for maker payment confirmation until this timestamp
    maker_coin_start_blocknumber (integer)the maker coin block number at the start of the swap
    taker_coin_start_blocknumber (integer)the taker coin block number at the start of the swap

The StartFailed event indicates that some of the pre-checks did not pass, and therefore the swap did not start.

The swap finishes immediately when this event occurs.

StructureTypeDescription
errorstringerror description with stack trace

The Negotiated event indicates that taker has received and validated swap negotiation data from maker.

Taker sends dex fee after this event occurs.

StructureTypeDescription
maker_payment_locktimenumber (UTC timestamp in seconds)the maker payment is locked until this timestamp
maker_pubkeystring (hexadecimal)a persistent secp256k1 public key of maker node
secret_hashstring (hexadecimal)the swap payments are expected to be locked with this secret hash

The NegotiateFailed event indicates that maker negotiation data was not received or did not pass validation.

The swap finishes immediately when this event occurs.

StructureTypeDescription
errorstringerror description with stack trace

The TakerFeeSent event indicates that taker broadcast the dex fee transaction.

Taker starts waiting for maker payment after this event occurs.

StructureTypeDescription
tx_hashstringthe hash of the transaction
tx_hexstringtransaction bytes in hexadecimal format

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.

The swap finishes immediately when this event occurs.

StructureTypeDescription
errorstringerror description with stack trace

The TakerPaymentInstructionsReceived event indicates that the taker has received payment instructions.

This event does not have additional data.

The MakerPaymentValidateFailed event indicates that taker was not able to receive or validate the maker payment transaction.

The swap finishes immediately when this event occurs.

StructureTypeDescription
errorstringerror description with stack trace

The MakerPaymentReceived event indicates that taker received the maker payment transaction data.

Taker starts waiting for transaction confirmation after this event occurs.

StructureTypeDescription
tx_hashstringthe hash of the transaction
tx_hexstringtransaction bytes in hexadecimal format

The MakerPaymentWaitConfirmStarted event indicates that taker started waiting for maker payment confirmation.

This event does not have additional data.

The MakerPaymentWaitConfirmFailed event indicates that the maker payment transaction did not reach the required number of confirmations before the internal timeout expiration.

Taker swap finishes immediately when this event occurs.

StructureTypeDescription
errorstringerror description with stack trace

The MakerPaymentValidatedAndConfirmed event indicates that taker validated maker payment and the payment was confirmed the required number of times.

Taker sends his payment after this event occurs.

This event does not have additional data.

The TakerPaymentSent event indicates that taker broadcast taker payment transaction to taker coin blockchain.

Taker starts waiting for maker to spend this transaction.

StructureTypeDescription
tx_hashstringthe hash of the transaction
tx_hexstringtransaction bytes in hexadecimal format

The TakerPaymentTransactionFailed event indicates that taker failed to broadcast transaction to taker coin blockchain.

The swap finishes immediately when this event occurs.

StructureTypeDescription
errorstringerror description with stack trace

The TakerPaymentWaitConfirmFailed event indicates that the taker payment transaction did not reach the required number of confirmations before the internal timeout expiration.

When this event occurs taker starts waiting for taker payment lock time expiration to issue a refund.

StructureTypeDescription
errorstringerror description with stack trace

The TakerPaymentDataSendFailed event indicates that taker was not able to send his payment data to maker due to a network error.

When this event occurs taker starts waiting for taker payment lock time expiration to issue a refund.

StructureTypeDescription
errorstringerror description with stack trace

The TakerPaymentSpent event indicates that maker spent taker payment and taker discovered the transaction.

When this event occurs taker extracts the secret from the transaction and attempts to spend maker payment.

StructureTypeDescription
secretstringthe atomic swap secret extracted from spending transaction
transactionobjecttransaction object
transaction.tx_hashstringthe hash of the transaction
transaction.tx_hexstringtransaction bytes in hexadecimal format

The TakerPaymentWaitForSpendFailed event indicates that maker did not spend taker payment before lock time expiration.

When this event occurs taker attempts to refund the payment.

StructureTypeDescription
errorstringerror description with stack trace

The MakerPaymentSpendFailed event indicates that taker failed to broadcast maker payment spend transaction to the maker coin blockchain.

The swap finishes immediately when this event occurs.

StructureTypeDescription
errorstringerror description with stack trace

The MakerPaymentSpent event indicates that taker spent maker payment.

The swap finishes immediately when this event occurs.

StructureTypeDescription
tx_hashstringthe hash of the transaction
tx_hexstringtransaction bytes in hexadecimal format

TakerPaymentWaitRefundStarted event indicates that taker started waiting for lock time expiration to refund the payment.

StructureTypeDescription
wait_untilnumber (UTC timestamp)the timestamp at which a refund will occur

TakerPaymentRefundStarted event indicates that taker was has initiated the refund process.

TakerPaymentRefundFailed event indicates that taker was not able to broadcast a refund transaction to taker coin blockchain. The swap finishes immediately when this event occurs.

StructureTypeDescription
errorstringerror description with stack trace

The TakerPaymentRefunded event indicates that taker broadcast the taker payment refund transaction.

The swap finishes immediately when this event occurs.

StructureTypeDescription
tx_hashstringthe hash of the transaction
tx_hexstringtransaction bytes in hexadecimal format

The TakerPaymentRefundFinished event indicates that taker refund process is complete.

The swap finishes immediately when this event occurs. This event does not have additional data.

The Finished event indicates that the swap finished.

This event does not have additional data.