Skip to content

Commit 2bdb2d0

Browse files
authored
Merge pull request #374 from KomodoPlatform/add/kdf/active_swaps-v2
2 parents aa4e6e7 + 6d8e9cb commit 2bdb2d0

File tree

8 files changed

+394
-130
lines changed

8 files changed

+394
-130
lines changed

.github/workflows/get_data_lint_files_deploy.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ jobs:
4242
key: npm-${{ hashFiles('package-lock.json') }}
4343
restore-keys: npm-
4444

45-
- name: Generate configs
45+
- name: Generate API methods table
46+
if: github.base_ref == 'main' || github.ref == 'refs/heads/main'
4647
shell: bash
4748
run: ${GITHUB_WORKSPACE}/utils/gen_api_methods_table.py
4849

filepathSlugs.json

+10
Original file line numberDiff line numberDiff line change
@@ -2721,6 +2721,16 @@
27212721
"response-success-6",
27222722
"withdraw-qrc-20-with-gas-limit"
27232723
],
2724+
"src/pages/komodo-defi-framework/api/v20/active_swaps/index.mdx": [
2725+
"active-swaps",
2726+
"arguments",
2727+
"response",
2728+
"examples",
2729+
"command-without-include-status",
2730+
"response-uuids-only",
2731+
"command-include-status-true",
2732+
"response-statuses-included"
2733+
],
27242734
"src/pages/komodo-defi-framework/api/v20/add_delegation/index.mdx": [
27252735
"add-delegation",
27262736
"arguments",

src/data/sidebar.json

+4
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,10 @@
500500
{
501501
"title": "Swaps",
502502
"links": [
503+
{
504+
"title": "active_swaps",
505+
"href": "/komodo-defi-framework/api/v20/active_swaps/"
506+
},
503507
{
504508
"title": "recreate_swap_data",
505509
"href": "/komodo-defi-framework/api/v20/recreate_swap_data/"

src/pages/komodo-defi-framework/api/common_structures/wallet/index.mdx

+7-6
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ The `RawTxInfo` object includes the following items:
5050

5151
The `InputTxns` object includes the following items:
5252

53-
| Parameter | Type | Description |
54-
| ---------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
55-
| tx\_hash | string | The transaction id of an unspent transaction from the same wallet output. |
56-
| index | integer | The \[output index([https://bitcoin.stackexchange.com/questions/100765/what-does-the-index-of-an-utxo-stand-for](https://bitcoin.stackexchange.com/questions/100765/what-does-the-index-of-an-utxo-stand-for))] of this unspent transaction output. |
57-
| script\_pub\_key | string | The [scriptpubkey](https://learnmeabitcoin.com/technical/scriptPubKey) of this unspent transaction output. |
58-
| amount | decimal | The value of this unspent transaction output. |
53+
| Parameter | Type | Description |
54+
| ---------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
55+
| tx\_hash | string | The transaction id of an unspent transaction from the same wallet output. |
56+
| index | integer | The [output index](https://bitcoin.stackexchange.com/questions/100765/what-does-the-index-of-an-utxo-stand-for) of this unspent transaction output. |
57+
| script\_pub\_key | string | The [scriptpubkey](https://learnmeabitcoin.com/technical/scriptPubKey) of this unspent transaction output. |
58+
| amount | float | The value of this unspent transaction output. |
59+
| amount | | |
5960

6061
<CollapsibleSection expandedText="Hide Example" collapsedText="Show Example">
6162
```json

src/pages/komodo-defi-framework/api/index.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Below is a table of the currently available legacy, v2.0 and v2.0 (Dev) methods:
1212

1313
| Legacy | v2.0 (release) | v2.0 (dev) |
1414
| ------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
15-
| [active\_swaps](/komodo-defi-framework/api/legacy/active_swaps/#active-swaps) | | |
15+
| [active\_swaps](/komodo-defi-framework/api/legacy/active_swaps/#active-swaps) | [active\_swaps](/komodo-defi-framework/api/v20/active_swaps/#active-swaps) | |
1616
| | [add\_delegation](/komodo-defi-framework/api/v20/add_delegation/#add-delegation) | |
1717
| | [add\_node\_to\_version\_stat](/komodo-defi-framework/api/v20/add_node_to_version_stat/#add-node-to-version-stat) | |
1818
| [all\_swaps\_uuids\_by\_filter](/komodo-defi-framework/api/legacy/all_swaps_uuids_by_filter/#all-swaps-uuids-by-filter) | | |

src/pages/komodo-defi-framework/api/legacy/active_swaps/index.mdx

+102-117
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ export const description =
44

55
# active\_swaps
66

7-
**active\_swaps (include\_status)**
8-
97
The `active_swaps` method returns all the swaps that are currently running on the Komodo DeFi Framework API node.
108

9+
<Note>
10+
This method has been deprecated in favor of [active\_swaps v2](/komodo-defi-framework/api/v20/active_swaps/). The legacy version does not include v2 (Trading Protocol Upgrade) swap statuses in responses (it only returns uuids for these).
11+
</Note>
12+
1113
## Arguments
1214

1315
| Structure | Type | Description |
@@ -45,7 +47,8 @@ The `active_swaps` method returns all the swaps that are currently running on th
4547
"7592a07a-2805-4050-8ab8-984480e812f0",
4648
"82cbad96-ea9f-40fb-9225-07496323e35d",
4749
"177f7fa5-c9f3-4673-a2fa-28451a123e61"
48-
]
50+
],
51+
"statuses": null
4952
}
5053
}
5154
```
@@ -68,122 +71,104 @@ The `active_swaps` method returns all the swaps that are currently running on th
6871

6972
```json
7073
{
71-
"uuids": ["5d02843e-d1b4-488d-aad0-114d82020453"],
72-
"statuses": {
73-
"5d02843e-d1b4-488d-aad0-114d82020453": {
74-
"type": "Taker",
75-
"uuid": "5d02843e-d1b4-488d-aad0-114d82020453",
76-
"events": [
77-
{
78-
"timestamp": 1612780908698,
79-
"event": {
80-
"type": "Started",
81-
"data": {
82-
"taker_coin": "MARTY",
83-
"maker_coin": "DOC",
84-
"maker": "7310a8fb9fd8f198a1a21db830252ad681fccda580ed4101f3f6bfb98b34fab5",
85-
"my_persistent_pub": "03ad6f89abc2e5beaa8a3ac28e22170659b3209fe2ddf439681b4b8f31508c36fa",
86-
"lock_duration": 7800,
87-
"maker_amount": "1",
88-
"taker_amount": "1",
89-
"maker_payment_confirmations": 1,
90-
"maker_payment_requires_nota": false,
91-
"taker_payment_confirmations": 1,
92-
"taker_payment_requires_nota": false,
93-
"taker_payment_lock": 1612788708,
94-
"uuid": "5d02843e-d1b4-488d-aad0-114d82020453",
95-
"started_at": 1612780908,
96-
"maker_payment_wait": 1612784028,
97-
"maker_coin_start_block": 793472,
98-
"taker_coin_start_block": 797356,
99-
"fee_to_send_taker_fee": {
100-
"coin": "MARTY",
101-
"amount": "0.00001"
102-
},
103-
"taker_payment_trade_fee": {
104-
"coin": "MARTY",
105-
"amount": "0.00001"
106-
},
107-
"maker_payment_spend_trade_fee": {
108-
"coin": "DOC",
109-
"amount": "0"
110-
}
111-
}
112-
}
113-
},
114-
{
115-
"timestamp": 1612780924704,
116-
"event": {
117-
"type": "Negotiated",
118-
"data": {
119-
"maker_payment_locktime": 1612796508,
120-
"maker_pubkey": "037310a8fb9fd8f198a1a21db830252ad681fccda580ed4101f3f6bfb98b34fab5",
121-
"secret_hash": "026bebc2e19c243d0940dd583c9573bf10377afd"
122-
}
123-
}
124-
},
125-
{
126-
"timestamp": 1612780924962,
127-
"event": {
128-
"type": "TakerFeeSent",
129-
"data": {
130-
"tx_hex": "0400008085202f8901f425fbefe21f33ccb7b487df251191b27dfa7b639b04f60e5493c7ea41dbf149000000006b483045022100d5ec3e542175479bd4bd011e19b76a75e99f19cc49867e5bca9541950322c33a02207a4d1ffd674fb9760de79bb4929af44d66344b5e182de3c377186deebf6bf376012103ad6f89abc2e5beaa8a3ac28e22170659b3209fe2ddf439681b4b8f31508c36faffffffff02bcf60100000000001976a914ca1e04745e8ca0c60d8c5881531d51bec470743f88ac5ce6f305000000001976a914d55f0df6cb82630ad21a4e6049522a6f2b6c9d4588ac7c152160000000000000000000000000000000",
131-
"tx_hash": "75323ab7acd64bd35242611fabaec560d9acf2e1f9ca28d3a4aba47a79fb49c4"
132-
}
133-
}
134-
},
135-
{
136-
"timestamp": 1612780935966,
137-
"event": {
138-
"type": "MakerPaymentReceived",
139-
"data": {
140-
"tx_hex": "0400008085202f89028bef955e42107c562e4e02421f25c455723a701573f86c17b4d82e35a7d8f9f7020000006b483045022100b12fc9d95acca76bf5fd8d5c6acc288b454032ba4561b1c2b1f5f33b2cf2926d022017e561bc2cd93308848674b47b2e8ebd8f074ea78e32454d5fea6f08c0b1f1e40121037310a8fb9fd8f198a1a21db830252ad681fccda580ed4101f3f6bfb98b34fab5ffffffff5dfd0b24c0f7c3cf235868cf9a26ec49574764d135796fc4e7d20e95d55a8653000000006a47304402207c752d14601d1c99892f9d6c88c8ff2f93211640a65b2ee69172a16b908b21e402206f0b66684158445888271a849ab46258ad722496ee64fde055a6f44e36ed2ccc0121037310a8fb9fd8f198a1a21db830252ad681fccda580ed4101f3f6bfb98b34fab5ffffffff0300e1f5050000000017a9141b85c1a277f44f7d77d52b78e2ba70a0becc2ff9870000000000000000166a14026bebc2e19c243d0940dd583c9573bf10377afda7d26301000000001976a91486f747b28c60ad1130bdd3f84f48eeaf1801ca9888ac87152160000000000000000000000000000000",
141-
"tx_hash": "27dafe553246553d54f909fbbded80e6d490fdb95ca7b6807d73eca45f0d7a22"
142-
}
143-
}
144-
},
145-
{
146-
"timestamp": 1612780935967,
147-
"event": {
148-
"type": "MakerPaymentWaitConfirmStarted"
149-
}
74+
"uuids": [
75+
"44798382-8c63-4047-b5d8-70a60fa2546b"
76+
],
77+
"statuses": {
78+
"44798382-8c63-4047-b5d8-70a60fa2546b": {
79+
"type": "Taker",
80+
"uuid": "44798382-8c63-4047-b5d8-70a60fa2546b",
81+
"my_order_uuid": "44798382-8c63-4047-b5d8-70a60fa2546b",
82+
"events": [
83+
{
84+
"timestamp": 1730634185287,
85+
"event": {
86+
"type": "Started",
87+
"data": {
88+
"taker_coin": "MARTY",
89+
"maker_coin": "DOC",
90+
"maker": "15d9c51c657ab1be4ae9d3ab6e76a619d3bccfe830d5363fa168424c0d044732",
91+
"my_persistent_pub": "034cbf74541c1d3436bc7638a2738f64df4fee22d4443cdf11d54cea7d7f55f256",
92+
"lock_duration": 7800,
93+
"maker_amount": "2.4",
94+
"taker_amount": "2.4",
95+
"maker_payment_confirmations": 1,
96+
"maker_payment_requires_nota": false,
97+
"taker_payment_confirmations": 1,
98+
"taker_payment_requires_nota": false,
99+
"taker_payment_lock": 1730641984,
100+
"uuid": "44798382-8c63-4047-b5d8-70a60fa2546b",
101+
"started_at": 1730634184,
102+
"maker_payment_wait": 1730637304,
103+
"maker_coin_start_block": 803893,
104+
"taker_coin_start_block": 818506,
105+
"fee_to_send_taker_fee": {
106+
"coin": "MARTY",
107+
"amount": "0.00001",
108+
"paid_from_trading_vol": false
109+
},
110+
"taker_payment_trade_fee": {
111+
"coin": "MARTY",
112+
"amount": "0.00001",
113+
"paid_from_trading_vol": false
114+
},
115+
"maker_payment_spend_trade_fee": {
116+
"coin": "DOC",
117+
"amount": "0.00001",
118+
"paid_from_trading_vol": true
119+
},
120+
"maker_coin_htlc_pubkey": "034cbf74541c1d3436bc7638a2738f64df4fee22d4443cdf11d54cea7d7f55f256",
121+
"taker_coin_htlc_pubkey": "034cbf74541c1d3436bc7638a2738f64df4fee22d4443cdf11d54cea7d7f55f256",
122+
"p2p_privkey": null
123+
}
124+
}
125+
}
126+
],
127+
"maker_amount": "2.4",
128+
"maker_coin": "DOC",
129+
"maker_coin_usd_price": null,
130+
"taker_amount": "2.4",
131+
"taker_coin": "MARTY",
132+
"taker_coin_usd_price": null,
133+
"gui": "mm2_777",
134+
"mm_version": "2.2.0-beta_caf803b",
135+
"success_events": [
136+
"Started",
137+
"Negotiated",
138+
"TakerFeeSent",
139+
"TakerPaymentInstructionsReceived",
140+
"MakerPaymentReceived",
141+
"MakerPaymentWaitConfirmStarted",
142+
"MakerPaymentValidatedAndConfirmed",
143+
"TakerPaymentSent",
144+
"WatcherMessageSent",
145+
"TakerPaymentSpent",
146+
"MakerPaymentSpent",
147+
"MakerPaymentSpentByWatcher",
148+
"MakerPaymentSpendConfirmed",
149+
"Finished"
150+
],
151+
"error_events": [
152+
"StartFailed",
153+
"NegotiateFailed",
154+
"TakerFeeSendFailed",
155+
"MakerPaymentValidateFailed",
156+
"MakerPaymentWaitConfirmFailed",
157+
"TakerPaymentTransactionFailed",
158+
"TakerPaymentWaitConfirmFailed",
159+
"TakerPaymentDataSendFailed",
160+
"TakerPaymentWaitForSpendFailed",
161+
"MakerPaymentSpendFailed",
162+
"MakerPaymentSpendConfirmFailed",
163+
"TakerPaymentWaitRefundStarted",
164+
"TakerPaymentRefundStarted",
165+
"TakerPaymentRefunded",
166+
"TakerPaymentRefundedByWatcher",
167+
"TakerPaymentRefundFailed",
168+
"TakerPaymentRefundFinished"
169+
]
150170
}
151-
],
152-
"maker_amount": "1",
153-
"maker_coin": "DOC",
154-
"taker_amount": "1",
155-
"taker_coin": "MARTY",
156-
"gui": null,
157-
"mm_version": "23c89ced5",
158-
"success_events": [
159-
"Started",
160-
"Negotiated",
161-
"TakerFeeSent",
162-
"MakerPaymentReceived",
163-
"MakerPaymentWaitConfirmStarted",
164-
"MakerPaymentValidatedAndConfirmed",
165-
"TakerPaymentSent",
166-
"TakerPaymentSpent",
167-
"MakerPaymentSpent",
168-
"Finished"
169-
],
170-
"error_events": [
171-
"StartFailed",
172-
"NegotiateFailed",
173-
"TakerFeeSendFailed",
174-
"MakerPaymentValidateFailed",
175-
"MakerPaymentWaitConfirmFailed",
176-
"TakerPaymentTransactionFailed",
177-
"TakerPaymentWaitConfirmFailed",
178-
"TakerPaymentDataSendFailed",
179-
"TakerPaymentWaitForSpendFailed",
180-
"MakerPaymentSpendFailed",
181-
"TakerPaymentWaitRefundStarted",
182-
"TakerPaymentRefunded",
183-
"TakerPaymentRefundFailed"
184-
]
185171
}
186-
}
187172
}
188173
```
189174
</CollapsibleSection>

0 commit comments

Comments
 (0)