Skip to content

Commit

Permalink
Merge pull request #45 from coinbase/patrick/preprocess-pubkeys
Browse files Browse the repository at this point in the history
Access PublicKeys During Construction
  • Loading branch information
patrick-ogrady authored Sep 1, 2020
2 parents 311d2b6 + 1bd2e4d commit c5736bf
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
18 changes: 15 additions & 3 deletions api.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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 `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."
},
"required_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",
Expand All @@ -1666,6 +1672,12 @@
},
"metadata": {
"type":"object"
},
"public_keys": {
"type":"array",
"items": {
"$ref":"#/components/schemas/PublicKey"
}
}
}
},
Expand Down
27 changes: 22 additions & 5 deletions api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -1003,24 +1003,37 @@ 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
`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.
required_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
Expand All @@ -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
Expand Down

0 comments on commit c5736bf

Please sign in to comment.