diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f31e9a2 --- /dev/null +++ b/.gitignore @@ -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 + diff --git a/0004-siren-prototype-accept-decline.adoc b/0004-siren-prototype-accept-decline.adoc new file mode 100644 index 0000000..eaab2a1 --- /dev/null +++ b/0004-siren-prototype-accept-decline.adoc @@ -0,0 +1,90 @@ += Siren Prototype for comit-rs HTTP API - Accept/Decline actions +Franck Royer +: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"} + ] +} + +----