Swap Common Structures
structuresswaps_common_structures
There are a variety if swap events which may occur during a trade. See Maker Events and Taker Events for more info.
Parameter* = required | Type | Description |
---|---|---|
data* | varies | The data field may contain contextual information (e.g. txids) releated to a swap event. In some cases, it will be null . |
type* | string | See Maker Events and Taker Events for more info. |
{
"type": "TakerFeeSent",
"data": {
"tx_hex": "0400008085202f89014b9e44ba75ed80361776ac385feee7bba13b6c2d3147a3d9b5d71362a4624219000000006b483045022100a45de07b5d211c62e8ecf90cd5bee5076f6b6f20715f5618d7d0d93a6209ad870220596ca01682d2dbd4efeba3a0e90a373fd61b619471747df26afc2e2bb167de4c012103d8064eece4fa5c0f8dc0267f68cee9bdd527f9e88f3594a323428718c391ecc2ffffffff02bcf60100000000001976a914ca1e04745e8ca0c60d8c5881531d51bec470743f88acf4979600000000001976a914d346067e3c3c3964c395fee208594790e29ede5d88acaf73d363000000000000000000000000000000",
"tx_hash": "b2ee0e692523c5ca081f62e36325d09a629004850be8b86df149fc979e9e3e87"
}
}
For each step of a trade, a SwapEvent
will be created, alongside the timestamp of the event. See Maker Events and Taker Events for more info.
Parameter* = required | Type | Description |
---|---|---|
event* | object | A standard SwapEvent object. |
timestamp* | integer | Timestamp for the SwapEvent in UNIX format. |
{
"event": {
"type": "MakerPaymentWaitConfirmStarted"
},
"timestamp": 1564050588178
}
Each swap status will be nested under its associated UUID.
Parameter* = required | Type | Description |
---|---|---|
error_events* | list | A list of possible swap event types which may appear in a failed swap, for makers and takers. |
events* | list | A list of swap events. The structure of each event varies depending on its type, as detailed in the SwapEvents section. |
maker_amount* | numeric string | The amount of maker_coin being traded. |
maker_coin* | string | The coin being sent by the maker and received by the taker. |
mm_version* | string | The release version and/or commit hash of the Komodo DeFi SDK used to initiate the swap. |
success_events* | list | A list of possible swap event types for a successful swap, for makers and takers. |
taker_amount* | numeric string | The amount of taker_coin being traded. |
taker_coin* | string | The coin being sent by the taker and received by the maker. |
type* | string | Maker or Taker . Indicates if the user created the order (maker), or matched with an existing order (taker). |
uuid* | string | A unique identifier for the swap. |
gui | string default: null | Optional. An identifier for the GUI used to initiate the swap, as defined in your MM2.json file. |
{
"type": "Taker",
"uuid": "5d02843e-d1b4-488d-aad0-114d82020453",
"events": [
...
],
"maker_amount": "1",
"maker_coin": "DOC",
"taker_amount": "1",
"taker_coin": "MARTY",
"gui": null,
"mm_version": "23c89ced5",
"success_events": [
...
],
"error_events": [
...
]
}
{
"FromId": 4
}