Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
adding cancel. modifying offering. clarifying purpose of close in pro…
Browse files Browse the repository at this point in the history
…tocol spec (#341)

* adding cancel. clarifying close

* adding more about cancel

* adding submit cancel

* aligning changes for incoming submit order/cancel pr

* cleanup

* fixing wording

* adding cancel schema and parse cancel test vector

* adding cancellation top level field to offering schema, adding close to message schema

* removing phoebe, adding angie to codeowners

* new offering with cancel object

* fixing cancel schema id

* adding new test vector for parse quote

* generated new parse-offering
  • Loading branch information
Jiyoon Koo authored Jul 11, 2024
1 parent e9ca0bd commit bb104c0
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 102 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# The format is described: https://github.blog/2017-07-06-introducing-code-owners/

# These owners will be the default owners for everything in the repo.
* @michaelneale @mistermoe @jiyoontbd @phoebe-lew @KendallWeihe @kirahsapong @diehuxx @decentralgabe
* @michaelneale @mistermoe @jiyoontbd @KendallWeihe @kirahsapong @diehuxx @decentralgabe @angiejones


# -----------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions hosted/json-schemas/cancel.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://tbdex.dev/cancel.schema.json",
"type": "object",
"additionalProperties": false,
"properties": {
"reason": {
"type": "string"
}
}
}
2 changes: 1 addition & 1 deletion hosted/json-schemas/message.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"kind": {
"type": "string",
"enum": ["rfq", "quote", "order", "orderstatus", "close"],
"enum": ["rfq", "quote", "order", "orderstatus", "close", "cancel"],
"description": "The message kind (e.g. rfq, quote)"
},
"id": {
Expand Down
21 changes: 20 additions & 1 deletion hosted/json-schemas/offering.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,31 @@
"requiredClaims": {
"type": "object",
"description": "PresentationDefinition that describes the credential(s) the PFI requires in order to provide a quote."
},
"cancellation": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether cancellation is enabled for this offering"
},
"terms_url": {
"type": "string",
"description": "A link to a page that describes the terms of cancellation"
},
"terms": {
"type": "string",
"description": "A human-readable description of the terms of cancellation in plaintext"
}
},
"required": ["enabled"]
}
},
"required": [
"description",
"payin",
"payout",
"payoutUnitsPerPayinUnit"
"payoutUnitsPerPayinUnit",
"cancellation"
]
}
20 changes: 20 additions & 0 deletions hosted/test-vectors/protocol/vectors/parse-cancel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"description": "Cancel parses from string",
"input": "{\"metadata\": { \"from\": \"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6InFSUG1TSnRnUmhocklldHphSG1mUnJyaXVMaXhqS29EeDhNeFduREZRaU0ifQ\", \"to\": \"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6ImxqaDdqbUs2WFY2aVktUnZBRVQ1cEhva21Zem9jZnFhVmc0ODc0MHlwOHcifQ\", \"kind\": \"cancel\", \"id\": \"cancel_01j2fejf5eenyrt6d6xjdkh7ed\", \"exchangeId\": \"rfq_01j2fejf5eeny8gycyf1ft8x3j\", \"createdAt\": \"2024-07-10T23:10:03Z\", \"protocol\": \"1.0\"},\"data\": { \"reason\": \"I don't want to do this anymore\"},\"signature\": \"eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJbkZTVUcxVFNuUm5VbWhvY2tsbGRIcGhTRzFtVW5KeWFYVk1hWGhxUzI5RWVEaE5lRmR1UkVaUmFVMGlmUSMwIn0..sn8IoOx3bmAeaaZPPY3i2BqKS0h9Eydrp_Zkx8czQCmOvhNquXBKxMqH2nd2nsK5XuO_Poqv70aHDCAJblCeCg\"}",
"output": {
"metadata": {
"from": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6InFSUG1TSnRnUmhocklldHphSG1mUnJyaXVMaXhqS29EeDhNeFduREZRaU0ifQ",
"to": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6ImxqaDdqbUs2WFY2aVktUnZBRVQ1cEhva21Zem9jZnFhVmc0ODc0MHlwOHcifQ",
"kind": "cancel",
"id": "cancel_01j2fejf5eenyrt6d6xjdkh7ed",
"exchangeId": "rfq_01j2fejf5eeny8gycyf1ft8x3j",
"createdAt": "2024-07-10T23:10:03Z",
"protocol": "1.0"
},
"data": {
"reason": "I don't want to do this anymore"
},
"signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJbkZTVUcxVFNuUm5VbWhvY2tsbGRIcGhTRzFtVW5KeWFYVk1hWGhxUzI5RWVEaE5lRmR1UkVaUmFVMGlmUSMwIn0..sn8IoOx3bmAeaaZPPY3i2BqKS0h9Eydrp_Zkx8czQCmOvhNquXBKxMqH2nd2nsK5XuO_Poqv70aHDCAJblCeCg"
},
"error": false
}
56 changes: 25 additions & 31 deletions hosted/test-vectors/protocol/vectors/parse-offering.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{
"description": "Offering parses from string",
"input": "{\"metadata\":{\"from\":\"did:dht:c765ni81pupn5zc646xskdsufgokstbsgfwhae8hudsrjushhruy\",\"kind\":\"offering\",\"id\":\"offering_01hwcg100gf8btevp8x3pea75b\",\"createdAt\":\"2024-04-26T06:03:34.289Z\",\"protocol\":\"1.0\"},\"data\":{\"description\":\"Selling BTC for USD\",\"payin\":{\"currencyCode\":\"USD\",\"min\":\"0.0\",\"max\":\"999999.99\",\"methods\":[{\"kind\":\"DEBIT_CARD\",\"requiredPaymentDetails\":{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"cardNumber\":{\"type\":\"string\",\"description\":\"The 16-digit debit card number\",\"minLength\":16,\"maxLength\":16},\"expiryDate\":{\"type\":\"string\",\"description\":\"The expiry date of the card in MM/YY format\",\"pattern\":\"^(0[1-9]|1[0-2])\\\\/([0-9]{2})$\"},\"cardHolderName\":{\"type\":\"string\",\"description\":\"Name of the cardholder as it appears on the card\"},\"cvv\":{\"type\":\"string\",\"description\":\"The 3-digit CVV code\",\"minLength\":3,\"maxLength\":3}},\"required\":[\"cardNumber\",\"expiryDate\",\"cardHolderName\",\"cvv\"],\"additionalProperties\":false}}]},\"payout\":{\"currencyCode\":\"BTC\",\"max\":\"999526.11\",\"methods\":[{\"kind\":\"BTC_ADDRESS\",\"requiredPaymentDetails\":{\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"type\":\"object\",\"properties\":{\"btcAddress\":{\"type\":\"string\",\"description\":\"your Bitcoin wallet address\"}},\"required\":[\"btcAddress\"],\"additionalProperties\":false},\"estimatedSettlementTime\":10}]},\"payoutUnitsPerPayinUnit\":\"0.00003826\",\"requiredClaims\":{\"id\":\"7ce4004c-3c38-4853-968b-e411bafcd945\",\"input_descriptors\":[{\"id\":\"bbdb9b7c-5754-4f46-b63b-590bada959e0\",\"constraints\":{\"fields\":[{\"path\":[\"$.type[*]\"],\"filter\":{\"type\":\"string\",\"pattern\":\"^YoloCredential$\"}}]}}]}},\"signature\":\"eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpkaHQ6Yzc2NW5pODFwdXBuNXpjNjQ2eHNrZHN1Zmdva3N0YnNnZndoYWU4aHVkc3JqdXNoaHJ1eSMwIn0..ciWPR5RGHxfQZJUKw3Z2np6EtVJ0wQMZBsNoFjJ-W11x1NmmZCfSkbRAES0eoGlu0Wlyf4waHKvN0UdunakgCw\"}",
"input": "{\"metadata\": {\"from\": \"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6IjdzRDAzOXdITjVybzVhWUxvNjMxaW9aTzVSdjlRS242aGpHamRwZkhFMFkifQ\",\"kind\": \"offering\",\"id\": \"offering_01j2h97kkre7tanx9d4cj1zv6e\",\"createdAt\": \"2024-07-11T16:15:14Z\",\"updatedAt\": \"2024-07-11T16:15:14Z\",\"protocol\": \"1.0\"},\"data\": {\"description\": \"USDC for USD\",\"payoutUnitsPerPayinUnit\": \"1.0\",\"payin\": {\"currencyCode\": \"USD\",\"min\": \"0.1\",\"max\": \"1000\",\"methods\": [{\"kind\": \"DEBIT_CARD\",\"requiredPaymentDetails\": {\"$schema\": \"http://json-schema.org/draft-07/schema#\",\"type\": \"object\",\"properties\": {\"cardNumber\": {\"type\": \"string\",\"description\": \"The 16-digit debit card number\",\"minLength\": 16,\"maxLength\": 16},\"expiryDate\": {\"type\": \"string\",\"description\": \"The expiry date of the card in MM/YY format\",\"pattern\": \"^(0[1-9]|1[0-2])\\\\/([0-9]{2})$\"},\"cardHolderName\": {\"type\": \"string\",\"description\": \"Name of the cardholder as it appears on the card\"},\"cvv\": {\"type\": \"string\",\"description\": \"The 3-digit CVV code\",\"minLength\": 3,\"maxLength\": 3}},\"required\": [\"cardNumber\",\"expiryDate\",\"cardHolderName\",\"cvv\"],\"additionalProperties\": false}}]},\"payout\": {\"currencyCode\": \"USDC\",\"max\": \"5000\",\"methods\": [{\"kind\": \"STORED_BALANCE\",\"estimatedSettlementTime\": 1200}]},\"requiredClaims\": {\"id\": \"foo\",\"name\": \"kyccredential\",\"purpose\": \"To verify the identity of the user\",\"input_descriptors\": [{\"id\": \"1\",\"name\": \"KYC Information\",\"purpose\": \"To verify the identity of the user\",\"constraints\": {\"fields\": [{\"path\": [\"$.type[0]\"],\"filter\": {\"type\": \"string\",\"pattern\": \"KYC\"}}]}}]},\"cancellation\": {\"enabled\": false}},\"signature\": \"eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJamR6UkRBek9YZElUalZ5YnpWaFdVeHZOak14YVc5YVR6VlNkamxSUzI0MmFHcEhhbVJ3WmtoRk1Ga2lmUSMwIn0..M9yF4FtmfeTvmUyutp-k76WFDjuAfJ9fdKdY93Sg1G3KE8KCoFPCQIborK8H22MG2MYsHKZGExEzDWkwXkTbAg\"}",
"output": {
"metadata": {
"from": "did:dht:c765ni81pupn5zc646xskdsufgokstbsgfwhae8hudsrjushhruy",
"from": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6IjdzRDAzOXdITjVybzVhWUxvNjMxaW9aTzVSdjlRS242aGpHamRwZkhFMFkifQ",
"kind": "offering",
"id": "offering_01hwcg100gf8btevp8x3pea75b",
"createdAt": "2024-04-26T06:03:34.289Z",
"id": "offering_01j2h97kkre7tanx9d4cj1zv6e",
"createdAt": "2024-07-11T16:15:14Z",
"updatedAt": "2024-07-11T16:15:14Z",
"protocol": "1.0"
},
"data": {
"description": "Selling BTC for USD",
"description": "USDC for USD",
"payoutUnitsPerPayinUnit": "1.0",
"payin": {
"currencyCode": "USD",
"min": "0.0",
"max": "999999.99",
"min": "0.1",
"max": "1000",
"methods": [
{
"kind": "DEBIT_CARD",
Expand Down Expand Up @@ -56,53 +58,45 @@
]
},
"payout": {
"currencyCode": "BTC",
"max": "999526.11",
"currencyCode": "USDC",
"max": "5000",
"methods": [
{
"kind": "BTC_ADDRESS",
"requiredPaymentDetails": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"btcAddress": {
"type": "string",
"description": "your Bitcoin wallet address"
}
},
"required": [
"btcAddress"
],
"additionalProperties": false
},
"estimatedSettlementTime": 10
"kind": "STORED_BALANCE",
"estimatedSettlementTime": 1200
}
]
},
"payoutUnitsPerPayinUnit": "0.00003826",
"requiredClaims": {
"id": "7ce4004c-3c38-4853-968b-e411bafcd945",
"id": "foo",
"name": "kyccredential",
"purpose": "To verify the identity of the user",
"input_descriptors": [
{
"id": "bbdb9b7c-5754-4f46-b63b-590bada959e0",
"id": "1",
"name": "KYC Information",
"purpose": "To verify the identity of the user",
"constraints": {
"fields": [
{
"path": [
"$.type[*]"
"$.type[0]"
],
"filter": {
"type": "string",
"pattern": "^YoloCredential$"
"pattern": "KYC"
}
}
]
}
}
]
},
"cancellation": {
"enabled": false
}
},
"signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpkaHQ6Yzc2NW5pODFwdXBuNXpjNjQ2eHNrZHN1Zmdva3N0YnNnZndoYWU4aHVkc3JqdXNoaHJ1eSMwIn0..ciWPR5RGHxfQZJUKw3Z2np6EtVJ0wQMZBsNoFjJ-W11x1NmmZCfSkbRAES0eoGlu0Wlyf4waHKvN0UdunakgCw"
"signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJamR6UkRBek9YZElUalZ5YnpWaFdVeHZOak14YVc5YVR6VlNkamxSUzI0MmFHcEhhbVJ3WmtoRk1Ga2lmUSMwIn0..M9yF4FtmfeTvmUyutp-k76WFDjuAfJ9fdKdY93Sg1G3KE8KCoFPCQIborK8H22MG2MYsHKZGExEzDWkwXkTbAg"
},
"error": false
}
38 changes: 20 additions & 18 deletions hosted/test-vectors/protocol/vectors/parse-quote.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
{
"description": "Quote parses from string",
"input": "{\"metadata\":{\"exchangeId\":\"rfq_01hw25hn2te5rt4c6fnkb877xg\",\"from\":\"did:dht:3whftgpbdjihx9ze9tdn575zqzm4qwccetnf1ybiibuzad7rrmyy\",\"to\":\"did:dht:qyac4pru9ykcxbrutpaaxkmususxh4wtc4ctt19813zrie8uyy5y\",\"protocol\":\"1.0\",\"kind\":\"quote\",\"id\":\"quote_01hw25hn2vfd0944t9xp7jbx0t\",\"createdAt\":\"2024-04-22T05:48:01.499Z\"},\"data\":{\"expiresAt\":\"2024-04-22T05:48:01.499Z\",\"payin\":{\"currencyCode\":\"BTC\",\"amount\":\"0.01\",\"fee\":\"0.0001\",\"paymentInstruction\":{\"link\":\"tbdex.io/example\",\"instruction\":\"Fake instruction\"}},\"payout\":{\"currencyCode\":\"USD\",\"amount\":\"1000.00\",\"paymentInstruction\":{\"link\":\"tbdex.io/example\",\"instruction\":\"Fake instruction\"}}},\"signature\":\"eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpkaHQ6M3doZnRncGJkamloeDl6ZTl0ZG41NzV6cXptNHF3Y2NldG5mMXliaWlidXphZDdycm15eSMwIn0..sHQBr_s8EEx81hf4I8-qaY_ya4wWtE_wN93YY5-y22bG9RyiX4PAnwJUQJewa8STrK-M38yVNQDaBnqs1O9WAQ\"}",
"input": "{\"metadata\": {\"from\": \"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6Im83eG85MkxXOWNiZGUtOWRMZUE1ZFhDVjBneUdWVnVtb0xfZVlmVFhtWGsifQ\",\"to\": \"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6Ii12V195SDFMMWkzUW5vVlNGcXNrMDRGWGd4YVhhRGtHOEV1cF96MmxtWlUifQ\",\"kind\": \"quote\",\"id\": \"quote_01j2f22daeefet5g9ynxg5stm3\",\"exchangeId\": \"rfq_01j2f22daeefeaaqbp61thnxpb\",\"createdAt\": \"2024-07-10T19:31:34Z\",\"protocol\": \"1.0\"},\"data\": {\"expiresAt\": \"2024-07-10T19:31:34Z\",\"payoutUnitsPerPayinUnit\": \"16.665\",\"payin\": {\"currencyCode\": \"USD\",\"subtotal\": \"10\",\"fee\": \"0\",\"total\": \"10\",\"paymentInstruction\": {\"instruction\": \"use link provided\"}},\"payout\": {\"currencyCode\": \"MXN\",\"subtotal\": \"500\",\"fee\": \"0\",\"total\": \"500\",\"paymentInstruction\": {\"instruction\": \"SPEI transfer\"}}},\"signature\": \"eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJbTgzZUc4NU1reFhPV05pWkdVdE9XUk1aVUUxWkZoRFZqQm5lVWRXVm5WdGIweGZaVmxtVkZodFdHc2lmUSMwIn0..SYMZMQwrThsrNHXxHnXoiozCyvtePVOy3kHzQ0Pj3LYYf0h-l6PC2GLblWEtGVJrz27Ct_VdqUnOvm7nF6NLAA\"}",
"output": {
"metadata": {
"exchangeId": "rfq_01hw25hn2te5rt4c6fnkb877xg",
"from": "did:dht:3whftgpbdjihx9ze9tdn575zqzm4qwccetnf1ybiibuzad7rrmyy",
"to": "did:dht:qyac4pru9ykcxbrutpaaxkmususxh4wtc4ctt19813zrie8uyy5y",
"protocol": "1.0",
"from": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6Im83eG85MkxXOWNiZGUtOWRMZUE1ZFhDVjBneUdWVnVtb0xfZVlmVFhtWGsifQ",
"to": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6Ii12V195SDFMMWkzUW5vVlNGcXNrMDRGWGd4YVhhRGtHOEV1cF96MmxtWlUifQ",
"kind": "quote",
"id": "quote_01hw25hn2vfd0944t9xp7jbx0t",
"createdAt": "2024-04-22T05:48:01.499Z"
"id": "quote_01j2f22daeefet5g9ynxg5stm3",
"exchangeId": "rfq_01j2f22daeefeaaqbp61thnxpb",
"createdAt": "2024-07-10T19:31:34Z",
"protocol": "1.0"
},
"data": {
"expiresAt": "2024-04-22T05:48:01.499Z",
"expiresAt": "2024-07-10T19:31:34Z",
"payoutUnitsPerPayinUnit": "16.665",
"payin": {
"currencyCode": "BTC",
"amount": "0.01",
"fee": "0.0001",
"currencyCode": "USD",
"subtotal": "10",
"fee": "0",
"total": "10",
"paymentInstruction": {
"link": "tbdex.io/example",
"instruction": "Fake instruction"
"instruction": "use link provided"
}
},
"payout": {
"currencyCode": "USD",
"amount": "1000.00",
"currencyCode": "MXN",
"subtotal": "500",
"fee": "0",
"total": "500",
"paymentInstruction": {
"link": "tbdex.io/example",
"instruction": "Fake instruction"
"instruction": "SPEI transfer"
}
}
},
"signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpkaHQ6M3doZnRncGJkamloeDl6ZTl0ZG41NzV6cXptNHF3Y2NldG5mMXliaWlidXphZDdycm15eSMwIn0..sHQBr_s8EEx81hf4I8-qaY_ya4wWtE_wN93YY5-y22bG9RyiX4PAnwJUQJewa8STrK-M38yVNQDaBnqs1O9WAQ"
"signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJbTgzZUc4NU1reFhPV05pWkdVdE9XUk1aVUUxWkZoRFZqQm5lVWRXVm5WdGIweGZaVmxtVkZodFdHc2lmUSMwIn0..SYMZMQwrThsrNHXxHnXoiozCyvtePVOy3kHzQ0Pj3LYYf0h-l6PC2GLblWEtGVJrz27Ct_VdqUnOvm7nF6NLAA"
},
"error": false
}
22 changes: 11 additions & 11 deletions specs/http-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Version: Draft
- [`CreateExchangeRequest`](#createexchangerequest)
- [Response](#response-1)
- [Errors](#errors)
- [Submit Order/Close](#submit-orderclose)
- [Submit Order/Cancel](#submit-ordercancel)
- [Description](#description-2)
- [Endpoint](#endpoint-2)
- [Protected](#protected-2)
Expand Down Expand Up @@ -329,12 +329,12 @@ False
| 400 | Failed Signature Check |
| 409 | Exchange already exists |

## Submit Order/Close
## Submit Order/Cancel

### Description
This endpoint can receive either an Order or a Close message.
This endpoint can receive either an Order or a Cancel message.
Alice can submit an Order, which indicates that she wants the PFI to execute on the Quote she received.
Alice can submit a Close, which indicates that Alice is no longer interested in continuing with the exchange.
Alice can submit a Cancel, which indicates that Alice is no longer interested in continuing with the exchange.

### Endpoint
`PUT /exchanges/:exchange_id`
Expand All @@ -345,11 +345,11 @@ False
### Request Body
> [!IMPORTANT]
> See Order structure [here](../protocol/README.md#order)
> See Close structure [here](../protocol/README.md#close)
> See Cancel structure [here](../protocol/README.md#cancel)
```javascript
{
"message": { } // order or close message
"message": { } // order or cancel message
}
```

Expand All @@ -360,11 +360,11 @@ False
| `400: Bad Request` | `{ errors: Error[] }` |

### Errors
| Status | Description |
| ------ | ---------------------- |
| 400 | Failed Signature Check |
| 404 | Exchange not found |
| 409 | Close not allowed |
| Status | Description |
| ------ | --------------------------- |
| 400 | Failed Signature Check |
| 404 | Exchange not found |
| 409 | Order or Cancel not allowed |

---

Expand Down
Loading

0 comments on commit bb104c0

Please sign in to comment.