On this page

latest contributor to this doc

Last Edit:

@smk762

active_swaps

The active_swaps method returns all the swaps that are currently running on the Komodo DeFi Framework API node.

This method has been deprecated in favor of active_swaps v2. The legacy version does not include v2 (Trading Protocol Upgrade) swap statuses in responses (it only returns uuids for these).

StructureTypeDescription
include_statusboolOptional, defaults to false. Whether to include swap statuses in response;

StructureTypeDescription
uuidsarray of stringsA list of currently active swap UUIDs.
statusesobject (map)Only visible if include_status request parameter is true. A map of standard SwapStatus objects, delineated by the related UUID.

POST
active_swaps
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "active_swaps"
}

{
  "result": {
    "uuids": [
      "015c13bc-da79-43e1-a6d4-4ac8b3099b34",
      "7592a07a-2805-4050-8ab8-984480e812f0",
      "82cbad96-ea9f-40fb-9225-07496323e35d",
      "177f7fa5-c9f3-4673-a2fa-28451a123e61"
    ],
    "statuses": null
  }
}

POST
active_swaps
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "active_swaps",
  "include_status": true
}

{
    "uuids": [
        "44798382-8c63-4047-b5d8-70a60fa2546b"
    ],
    "statuses": {
        "44798382-8c63-4047-b5d8-70a60fa2546b": {
            "type": "Taker",
            "uuid": "44798382-8c63-4047-b5d8-70a60fa2546b",
            "my_order_uuid": "44798382-8c63-4047-b5d8-70a60fa2546b",
            "events": [
                {
                    "timestamp": 1730634185287,
                    "event": {
                        "type": "Started",
                        "data": {
                            "taker_coin": "MARTY",
                            "maker_coin": "DOC",
                            "maker": "15d9c51c657ab1be4ae9d3ab6e76a619d3bccfe830d5363fa168424c0d044732",
                            "my_persistent_pub": "034cbf74541c1d3436bc7638a2738f64df4fee22d4443cdf11d54cea7d7f55f256",
                            "lock_duration": 7800,
                            "maker_amount": "2.4",
                            "taker_amount": "2.4",
                            "maker_payment_confirmations": 1,
                            "maker_payment_requires_nota": false,
                            "taker_payment_confirmations": 1,
                            "taker_payment_requires_nota": false,
                            "taker_payment_lock": 1730641984,
                            "uuid": "44798382-8c63-4047-b5d8-70a60fa2546b",
                            "started_at": 1730634184,
                            "maker_payment_wait": 1730637304,
                            "maker_coin_start_block": 803893,
                            "taker_coin_start_block": 818506,
                            "fee_to_send_taker_fee": {
                                "coin": "MARTY",
                                "amount": "0.00001",
                                "paid_from_trading_vol": false
                            },
                            "taker_payment_trade_fee": {
                                "coin": "MARTY",
                                "amount": "0.00001",
                                "paid_from_trading_vol": false
                            },
                            "maker_payment_spend_trade_fee": {
                                "coin": "DOC",
                                "amount": "0.00001",
                                "paid_from_trading_vol": true
                            },
                            "maker_coin_htlc_pubkey": "034cbf74541c1d3436bc7638a2738f64df4fee22d4443cdf11d54cea7d7f55f256",
                            "taker_coin_htlc_pubkey": "034cbf74541c1d3436bc7638a2738f64df4fee22d4443cdf11d54cea7d7f55f256",
                            "p2p_privkey": null
                        }
                    }
                }
            ],
            "maker_amount": "2.4",
            "maker_coin": "DOC",
            "maker_coin_usd_price": null,
            "taker_amount": "2.4",
            "taker_coin": "MARTY",
            "taker_coin_usd_price": null,
            "gui": "mm2_777",
            "mm_version": "2.2.0-beta_caf803b",
            "success_events": [
                "Started",
                "Negotiated",
                "TakerFeeSent",
                "TakerPaymentInstructionsReceived",
                "MakerPaymentReceived",
                "MakerPaymentWaitConfirmStarted",
                "MakerPaymentValidatedAndConfirmed",
                "TakerPaymentSent",
                "WatcherMessageSent",
                "TakerPaymentSpent",
                "MakerPaymentSpent",
                "MakerPaymentSpentByWatcher",
                "MakerPaymentSpendConfirmed",
                "Finished"
            ],
            "error_events": [
                "StartFailed",
                "NegotiateFailed",
                "TakerFeeSendFailed",
                "MakerPaymentValidateFailed",
                "MakerPaymentWaitConfirmFailed",
                "TakerPaymentTransactionFailed",
                "TakerPaymentWaitConfirmFailed",
                "TakerPaymentDataSendFailed",
                "TakerPaymentWaitForSpendFailed",
                "MakerPaymentSpendFailed",
                "MakerPaymentSpendConfirmFailed",
                "TakerPaymentWaitRefundStarted",
                "TakerPaymentRefundStarted",
                "TakerPaymentRefunded",
                "TakerPaymentRefundedByWatcher",
                "TakerPaymentRefundFailed",
                "TakerPaymentRefundFinished"
            ]
        }
    }
}