From 42f59f27be9c6080b78fdab47d1456c44e5ca4d3 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Mon, 31 Aug 2020 13:51:17 -0700 Subject: [PATCH 1/3] Add public_keys to preprocess and payloads --- api.yaml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/api.yaml b/api.yaml index 89728b1..40c2871 100644 --- a/api.yaml +++ b/api.yaml @@ -14,7 +14,7 @@ openapi: 3.0.2 info: - version: 1.4.2 + version: 1.4.3 title: Rosetta description: | Build Once. Integrate Your Blockchain Everywhere. @@ -1003,11 +1003,16 @@ components: minimum: 0.0 ConstructionPreprocessResponse: description: | - ConstructionPreprocessResponse contains the request that will - be sent directly to `/construction/metadata`. + ConstructionPreprocessResponse contains `options` that will + be sent unmodified to `/construction/metadata`. If it is + not necessary to make a request to `/construction/metadata`, + `options` should be omitted. - If it is not necessary to make a request to `/construction/metadata`, - options should be null. + Some blockchains require the PublicKey of particular AccountIdentifiers + to construct a valid transaction. To fetch these PublicKeys, populate + `public_keys` with the AccountIdentifiers associated with the desired + PublicKeys. If it is not necessary to retrieve any PublicKeys + for construction, `public_keys` should be omitted. type: object properties: options: @@ -1015,12 +1020,20 @@ components: description: | The options that will be sent directly to `/construction/metadata` by the caller. + public_keys: + type: array + items: + $ref: '#/components/schemas/AccountIdentifier' ConstructionPayloadsRequest: description: | ConstructionPayloadsRequest is the request to `/construction/payloads`. It contains the network, a slice of operations, and arbitrary metadata that was returned by the call to `/construction/metadata`. + + Optionally, the request can also include an array + of PublicKeys associated with the AccountIdentifiers + returned in ConstructionPreprocessResponse. type: object required: - network_identifier @@ -1034,6 +1047,10 @@ components: $ref: '#/components/schemas/Operation' metadata: type: object + public_keys: + type: array + items: + $ref: '#/components/schemas/PublicKey' ConstructionPayloadsResponse: description: | ConstructionTransactionResponse is returned by `/construction/payloads`. It From 2b2b4861cbc31ef956df7760d08ffc8b6e382a49 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Mon, 31 Aug 2020 13:51:42 -0700 Subject: [PATCH 2/3] Make gen --- api.json | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/api.json b/api.json index 0d0506f..0087668 100644 --- a/api.json +++ b/api.json @@ -1,7 +1,7 @@ { "openapi":"3.0.2", "info": { - "version":"1.4.2", + "version":"1.4.3", "title":"Rosetta", "description":"Build Once. Integrate Your Blockchain Everywhere.", "license": { @@ -1638,17 +1638,23 @@ } }, "ConstructionPreprocessResponse": { - "description":"ConstructionPreprocessResponse contains the request that will be sent directly to `/construction/metadata`. If it is not necessary to make a request to `/construction/metadata`, options should be null.", + "description":"ConstructionPreprocessResponse contains `options` that will be sent unmodified to `/construction/metadata`. If it is not necessary to make a request to `/construction/metadata`, `options` should be omitted. Some blockchains require the PublicKey of particular AccountIdentifiers to construct a valid transaction. To fetch these PublicKeys, populate `public_keys` with the AccountIdentifiers associated with the desired PublicKeys. If it is not necessary to retrieve any PublicKeys for construction, `public_keys` should be omitted.", "type":"object", "properties": { "options": { "type":"object", "description":"The options that will be sent directly to `/construction/metadata` by the caller." + }, + "public_keys": { + "type":"array", + "items": { + "$ref":"#/components/schemas/AccountIdentifier" + } } } }, "ConstructionPayloadsRequest": { - "description":"ConstructionPayloadsRequest is the request to `/construction/payloads`. It contains the network, a slice of operations, and arbitrary metadata that was returned by the call to `/construction/metadata`.", + "description":"ConstructionPayloadsRequest is the request to `/construction/payloads`. It contains the network, a slice of operations, and arbitrary metadata that was returned by the call to `/construction/metadata`. Optionally, the request can also include an array of PublicKeys associated with the AccountIdentifiers returned in ConstructionPreprocessResponse.", "type":"object", "required": [ "network_identifier", @@ -1666,6 +1672,12 @@ }, "metadata": { "type":"object" + }, + "public_keys": { + "type":"array", + "items": { + "$ref":"#/components/schemas/PublicKey" + } } } }, From 1bd2e4ddb79513aa9ac36443d956493e15414757 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Tue, 1 Sep 2020 08:14:34 -0700 Subject: [PATCH 3/3] nits --- api.json | 4 ++-- api.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api.json b/api.json index 0087668..1ea9c12 100644 --- a/api.json +++ b/api.json @@ -1638,14 +1638,14 @@ } }, "ConstructionPreprocessResponse": { - "description":"ConstructionPreprocessResponse contains `options` that will be sent unmodified to `/construction/metadata`. If it is not necessary to make a request to `/construction/metadata`, `options` should be omitted. Some blockchains require the PublicKey of particular AccountIdentifiers to construct a valid transaction. To fetch these PublicKeys, populate `public_keys` with the AccountIdentifiers associated with the desired PublicKeys. If it is not necessary to retrieve any PublicKeys for construction, `public_keys` should be omitted.", + "description":"ConstructionPreprocessResponse contains `options` that will be sent unmodified to `/construction/metadata`. If it is not necessary to make a request to `/construction/metadata`, `options` should be omitted. Some blockchains require the PublicKey of particular AccountIdentifiers to construct a valid transaction. To fetch these PublicKeys, populate `required_public_keys` with the AccountIdentifiers associated with the desired PublicKeys. If it is not necessary to retrieve any PublicKeys for construction, `required_public_keys` should be omitted.", "type":"object", "properties": { "options": { "type":"object", "description":"The options that will be sent directly to `/construction/metadata` by the caller." }, - "public_keys": { + "required_public_keys": { "type":"array", "items": { "$ref":"#/components/schemas/AccountIdentifier" diff --git a/api.yaml b/api.yaml index 40c2871..b6537fb 100644 --- a/api.yaml +++ b/api.yaml @@ -1010,9 +1010,9 @@ components: Some blockchains require the PublicKey of particular AccountIdentifiers to construct a valid transaction. To fetch these PublicKeys, populate - `public_keys` with the AccountIdentifiers associated with the desired + `required_public_keys` with the AccountIdentifiers associated with the desired PublicKeys. If it is not necessary to retrieve any PublicKeys - for construction, `public_keys` should be omitted. + for construction, `required_public_keys` should be omitted. type: object properties: options: @@ -1020,7 +1020,7 @@ components: description: | The options that will be sent directly to `/construction/metadata` by the caller. - public_keys: + required_public_keys: type: array items: $ref: '#/components/schemas/AccountIdentifier'