-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Siren
GET /swaps
response prototype (#7)
Siren `GET /swaps` response prototype
- Loading branch information
Showing
2 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"} | ||
] | ||
} | ||
---- |