From f12995fb2169df962b16e91733653642c16d6604 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 2 May 2019 09:38:20 +1000 Subject: [PATCH 1/6] Add 0003 for comit-network/comit-rs#917 --- 0003-siren-prototype-accept-decline.adoc | 88 ++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 0003-siren-prototype-accept-decline.adoc diff --git a/0003-siren-prototype-accept-decline.adoc b/0003-siren-prototype-accept-decline.adoc new file mode 100644 index 0000000..c762870 --- /dev/null +++ b/0003-siren-prototype-accept-decline.adoc @@ -0,0 +1,88 @@ +# Siren Prototype for comit-rs HTTP API - Accept/Decline acions + +* Authors: Franck Royer +* Date: 2019-05-02 + +Tracking issue: [comit-rs#917](https://github.com/comit-network/comit-rs/issues/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 [Siren JSON schema](https://github.com/kevinswiber/siren/blob/master/siren.schema.json) + +## Research + +The prototype: + +```json +{ + "class": ["swaps"], + "entities": [ + { + "class": ["swap"], + "rel": [], + "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", + "class": ["comit-action"], + "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", + "class": ["comit-action"], + "fields": [] + } + ] + } + ], + "links": [ + {"rel": ["self"], "href": "/swaps"} + ] +} +``` From 23ad3df00210e7b225045d489ca4fe5acfb29462 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 2 May 2019 09:46:21 +1000 Subject: [PATCH 2/6] Convert to asciidoc --- .gitignore | 63 ++++++++++++++++++++++++ 0003-siren-prototype-accept-decline.adoc | 14 +++--- 2 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 .gitignore 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/0003-siren-prototype-accept-decline.adoc b/0003-siren-prototype-accept-decline.adoc index c762870..18f4762 100644 --- a/0003-siren-prototype-accept-decline.adoc +++ b/0003-siren-prototype-accept-decline.adoc @@ -1,11 +1,11 @@ -# Siren Prototype for comit-rs HTTP API - Accept/Decline acions += Siren Prototype for comit-rs HTTP API - Accept/Decline actions * Authors: Franck Royer * Date: 2019-05-02 Tracking issue: [comit-rs#917](https://github.com/comit-network/comit-rs/issues/917) -## Context +== 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. @@ -13,11 +13,11 @@ Siren repository: https://github.com/kevinswiber/siren/ The prototype must conform to [Siren JSON schema](https://github.com/kevinswiber/siren/blob/master/siren.schema.json) -## Research +== Research -The prototype: - -```json +.The prototype +[source,json] +---- { "class": ["swaps"], "entities": [ @@ -85,4 +85,4 @@ The prototype: {"rel": ["self"], "href": "/swaps"} ] } -``` +---- From bccff1996b0f855985d1665a6c0ed15a24ed9000 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 2 May 2019 09:56:58 +1000 Subject: [PATCH 3/6] Convert links to asciidoc --- 0003-siren-prototype-accept-decline.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/0003-siren-prototype-accept-decline.adoc b/0003-siren-prototype-accept-decline.adoc index 18f4762..267c263 100644 --- a/0003-siren-prototype-accept-decline.adoc +++ b/0003-siren-prototype-accept-decline.adoc @@ -3,7 +3,7 @@ * Authors: Franck Royer * Date: 2019-05-02 -Tracking issue: [comit-rs#917](https://github.com/comit-network/comit-rs/issues/917) +Tracking issue: https://github.com/comit-network/comit-rs/issues/917[comit-rs#917] == Context @@ -11,7 +11,7 @@ In order to move forward easily with Bobtimus prime we should define the siren j Siren repository: https://github.com/kevinswiber/siren/ -The prototype must conform to [Siren JSON schema](https://github.com/kevinswiber/siren/blob/master/siren.schema.json) +The prototype must conform to https://github.com/kevinswiber/siren/blob/master/siren.schema.json[Siren JSON schema] == Research From b4cd2ae6e39e1280f60557d727d797eff8e465af Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 2 May 2019 11:43:49 +1000 Subject: [PATCH 4/6] Add item to rel See https://github.com/kevinswiber/siren/issues/17#issuecomment-26816414 --- 0003-siren-prototype-accept-decline.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/0003-siren-prototype-accept-decline.adoc b/0003-siren-prototype-accept-decline.adoc index 267c263..934f7a7 100644 --- a/0003-siren-prototype-accept-decline.adoc +++ b/0003-siren-prototype-accept-decline.adoc @@ -23,7 +23,7 @@ The prototype must conform to https://github.com/kevinswiber/siren/blob/master/s "entities": [ { "class": ["swap"], - "rel": [], + "rel": ["item"], "properties": { "role": "Alice", "protocol": "rfc003", From cbb7bf0b1d0957fedd9f1023b9b0b70c4aaa7ce2 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 2 May 2019 23:21:37 +1000 Subject: [PATCH 5/6] 0003 is already taken --- ...ccept-decline.adoc => 0004-siren-prototype-accept-decline.adoc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 0003-siren-prototype-accept-decline.adoc => 0004-siren-prototype-accept-decline.adoc (100%) diff --git a/0003-siren-prototype-accept-decline.adoc b/0004-siren-prototype-accept-decline.adoc similarity index 100% rename from 0003-siren-prototype-accept-decline.adoc rename to 0004-siren-prototype-accept-decline.adoc From 500d257334877daa6e501d6abc32f6c53c1a82f7 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 3 May 2019 12:44:50 +1000 Subject: [PATCH 6/6] Remove comit-action, correct as per template --- 0004-siren-prototype-accept-decline.adoc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/0004-siren-prototype-accept-decline.adoc b/0004-siren-prototype-accept-decline.adoc index 934f7a7..eaab2a1 100644 --- a/0004-siren-prototype-accept-decline.adoc +++ b/0004-siren-prototype-accept-decline.adoc @@ -1,7 +1,10 @@ = Siren Prototype for comit-rs HTTP API - Accept/Decline actions +Franck Royer +:toc: +:revdate: 2019-05-02 -* Authors: Franck Royer -* Date: 2019-05-02 +* Author(s): {authors} +* Date: {revdate} Tracking issue: https://github.com/comit-network/comit-rs/issues/917[comit-rs#917] @@ -61,7 +64,6 @@ The prototype must conform to https://github.com/kevinswiber/siren/blob/master/s "method": "POST", "href": "/swaps/rfc003/399e8ff5-9729-479e-aad8-49b03f8fc5d5/accept", "type": "application/json", - "class": ["comit-action"], "fields": [ { "name": "beta_ledger_refund_identity", "title": "Refund address on Ethereum", "type": "text", @@ -75,7 +77,6 @@ The prototype must conform to https://github.com/kevinswiber/siren/blob/master/s "method": "POST", "href": "/swaps/rfc003/399e8ff5-9729-479e-aad8-49b03f8fc5d5/decline", "type": "application/json", - "class": ["comit-action"], "fields": [] } ] @@ -85,4 +86,5 @@ The prototype must conform to https://github.com/kevinswiber/siren/blob/master/s {"rel": ["self"], "href": "/swaps"} ] } + ----