Skip to content

Commit

Permalink
Siren GET /swaps response prototype (#7)
Browse files Browse the repository at this point in the history
Siren `GET /swaps` response prototype
  • Loading branch information
Franck Royer authored May 7, 2019
2 parents 6d749ce + 500d257 commit 7b6cc46
Show file tree
Hide file tree
Showing 2 changed files with 153 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

90 changes: 90 additions & 0 deletions 0004-siren-prototype-accept-decline.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
= Siren Prototype for comit-rs HTTP API - Accept/Decline actions
Franck Royer <franck[email protected]>
:toc:
:revdate: 2019-05-02

* Author(s): {authors}
* Date: {revdate}
Tracking issue: https://github.com/comit-network/comit-rs/issues/917[comit-rs#917]

== Context

In order to move forward easily with Bobtimus prime we should define the siren json document of how a IN_PROGRESS response look like in each state of accept and decline, i.e. when you call GET /swaps/ for Bob.

Siren repository: https://github.com/kevinswiber/siren/

The prototype must conform to https://github.com/kevinswiber/siren/blob/master/siren.schema.json[Siren JSON schema]

== Research

.The prototype
[source,json]
----
{
"class": ["swaps"],
"entities": [
{
"class": ["swap"],
"rel": ["item"],
"properties": {
"role": "Alice",
"protocol": "rfc003",
"status": "IN_PROGRESS",
"parameters": {
"alpha_asset": {
"name": "bitcoin",
"quantity": "100000000"
},
"alpha_ledger": {
"name": "bitcoin",
"network": "regtest"
},
"beta_asset": {
"name": "ether",
"quantity": "10000000000000000000"
},
"beta_ledger": {
"name": "ethereum",
"network": "regtest"
}
}
},
"links": [
{"rel": ["self"], "href": "/swaps/rfc003/399e8ff5-9729-479e-aad8-49b03f8fc5d5"},
{
"rel": ["human-protocol-spec"],
"href": "https://github.com/comit-network/RFCs/blob/master/RFC-003-SWAP-Basic.md"
}
],
"actions": [
{
"name": "accept",
"title": "Accept",
"method": "POST",
"href": "/swaps/rfc003/399e8ff5-9729-479e-aad8-49b03f8fc5d5/accept",
"type": "application/json",
"fields": [
{
"name": "beta_ledger_refund_identity", "title": "Refund address on Ethereum", "type": "text",
"class": ["address", "ethereum"]
}
]
},
{
"name": "decline",
"title": "Decline",
"method": "POST",
"href": "/swaps/rfc003/399e8ff5-9729-479e-aad8-49b03f8fc5d5/decline",
"type": "application/json",
"fields": []
}
]
}
],
"links": [
{"rel": ["self"], "href": "/swaps"}
]
}
----

0 comments on commit 7b6cc46

Please sign in to comment.