docs: add schema files for rosetta construction/metadata endpoint

This commit is contained in:
Asim Mehmood
2020-09-23 02:57:31 +05:00
committed by Matthew Little
parent ab4947c7bc
commit 7182ec15cb
3 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://example.com/example.json",
"type": "object",
"title": "RosettaConstructionMetadataRequest",
"description": "A ConstructionMetadataRequest is utilized to get information required to construct a transaction. The Options object used to specify which metadata to return is left purposely unstructured to allow flexibility for implementers. Optionally, the request can also include an array of PublicKeys associated with the AccountIdentifiers returned in ConstructionPreprocessResponse.",
"required": ["network_identifier", "options"],
"properties": {
"network_identifier": {
"$ref": "./../../entities/rosetta/rosetta-network-identifier.schema.json"
},
"options": {
"$ref": "./../../entities/rosetta/rosetta-construction-options.schema.json"
},
"public_keys": {
"$ref": "./../../entities/rosetta/rosetta-public-key.schema.json"
}
}
}

View File

@@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "rosetta-construction-metadata-response",
"type": "object",
"title": "RosettaConstructionMetadataResponse",
"description": "The ConstructionMetadataResponse returns network-specific metadata used for transaction construction. Optionally, the implementer can return the suggested fee associated with the transaction being constructed. The caller may use this info to adjust the intent of the transaction or to create a transaction with a different account that can pay the suggested fee. Suggested fee is an array in case fee payment must occur in multiple currencies.",
"required": ["metadata"],
"properties": {
"metadata": {
"type": "object",
"required": [],
"properties": {
"account_sequence": {
"type": "integer"
},
"recent_block_hash": {
"type": "string"
}
}
},
"suggested_fee": {
"$ref": "./../../entities/rosetta/rosetta-amount.schema.json"
}
}
}