diff --git a/api.json b/api.json index 22b55a5..cc18a50 100644 --- a/api.json +++ b/api.json @@ -1,7 +1,7 @@ { "openapi":"3.0.2", "info": { - "version":"1.4.9", + "version":"1.4.10", "title":"Rosetta", "description":"Build Once. Integrate Your Blockchain Everywhere.", "license": { @@ -1056,6 +1056,12 @@ "$ref":"#/components/schemas/Operation" } }, + "related_transactions": { + "type":"array", + "items": { + "$ref":"#/components/schemas/RelatedTransaction" + } + }, "metadata": { "description":"Transactions that are related to other transactions (like a cross-shard transaction) should include the tranaction_identifier of these transactions in the metadata.", "type":"object", @@ -1557,6 +1563,33 @@ } } }, + "RelatedTransaction": { + "description":"The related_transaction allows implementations to link together multiple transactions. An unpopulated network identifier indicates that the related transaction is on the same network.", + "type":"object", + "required": [ + "transaction_identifier", + "direction" + ], + "properties": { + "network_identifier": { + "$ref":"#/components/schemas/NetworkIdentifier" + }, + "transaction_identifier": { + "$ref":"#/components/schemas/TransactionIdentifier" + }, + "direction": { + "$ref":"#/components/schemas/Direction" + } + } + }, + "Direction": { + "description":"Used by RelatedTransaction to indicate the direction of the relation (i.e. cross-shard/cross-network sends may reference `backward` to an earlier transaction and async execution may reference `forward`). Can be used to indicate if a transaction relation is from child to parent or the reverse.", + "type":"string", + "enum": [ + "forward", + "backward" + ] + }, "AccountBalanceRequest": { "description":"An AccountBalanceRequest is utilized to make a balance request on the /account/balance endpoint. If the block_identifier is populated, a historical balance query should be performed.", "type":"object", diff --git a/api.yaml b/api.yaml index 46e3bab..8605f98 100644 --- a/api.yaml +++ b/api.yaml @@ -14,7 +14,7 @@ openapi: 3.0.2 info: - version: 1.4.9 + version: 1.4.10 title: Rosetta description: | Build Once. Integrate Your Blockchain Everywhere. @@ -801,6 +801,10 @@ components: $ref: 'models/Operator.yaml' BlockTransaction: $ref: 'models/BlockTransaction.yaml' + RelatedTransaction: + $ref: 'models/RelatedTransaction.yaml' + Direction: + $ref: 'models/Direction.yaml' # Request/Responses AccountBalanceRequest: diff --git a/models/Direction.yaml b/models/Direction.yaml new file mode 100644 index 0000000..086de44 --- /dev/null +++ b/models/Direction.yaml @@ -0,0 +1,21 @@ +# Copyright 2020 Coinbase, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +description: | + Used by RelatedTransaction to indicate the direction of the relation (i.e. cross-shard/cross-network sends may + reference `backward` to an earlier transaction and async execution may reference `forward`). Can be used to indicate if + a transaction relation is from child to parent or the reverse. +type: string +enum: + - forward + - backward \ No newline at end of file diff --git a/models/RelatedTransaction.yaml b/models/RelatedTransaction.yaml new file mode 100644 index 0000000..5d68d1a --- /dev/null +++ b/models/RelatedTransaction.yaml @@ -0,0 +1,28 @@ +# Copyright 2020 Coinbase, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +description: | + The related_transaction allows implementations to link together multiple transactions. + An unpopulated network identifier indicates that the related transaction is on the same network. +type: object +required: + - transaction_identifier + - direction +properties: + network_identifier: + $ref: 'NetworkIdentifier.yaml' + transaction_identifier: + $ref: 'TransactionIdentifier.yaml' + direction: + $ref: 'Direction.yaml' diff --git a/models/Transaction.yaml b/models/Transaction.yaml index b808d34..5e9d81c 100644 --- a/models/Transaction.yaml +++ b/models/Transaction.yaml @@ -26,6 +26,10 @@ properties: type: array items: $ref: 'Operation.yaml' + related_transactions: + type: array + items: + $ref: 'RelatedTransaction.yaml' metadata: description: | Transactions that are related to other transactions (like a cross-shard transaction) should include