Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Siren GET /swaps response prototype #7

Merged
merged 6 commits into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
:toc:
thomaseizinger marked this conversation as resolved.
Show resolved Hide resolved
: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"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this point to? What is "item" ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at the previous discussion in this PR:
#7 (comment)

"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"}
]
}

----