Skip to content

Commit 09e373b

Browse files
asimm241zone117x
authored andcommitted
fix: missed several request/response files
1 parent 2e91877 commit 09e373b

13 files changed

+443
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "rosetta-account-request",
4+
"type": "object",
5+
"title": "RosettaAccountBalanceRequest",
6+
"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.",
7+
"required": ["network_identifier", "account_identifier"],
8+
"properties": {
9+
"network_identifier": {
10+
"$ref": "./../../entities/rosetta/rosetta-network-identifier.schema.json"
11+
},
12+
"account_identifier": {
13+
"$ref": "./../../entities/rosetta/rosetta-account.schema.json"
14+
},
15+
"block_identifier": {
16+
"$ref": "./../../entities/rosetta/rosetta-block-identifier.schema.json"
17+
}
18+
},
19+
"additionalProperties": true
20+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"network_identifier": {
3+
"blockchain": "bitcoin",
4+
"network": "mainnet",
5+
"sub_network_identifier": {
6+
"network": "shard 1",
7+
"metadata": {
8+
"producer": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
9+
}
10+
}
11+
},
12+
"account_identifier": {
13+
"address": "0x3a065000ab4183c6bf581dc1e55a605455fc6d61",
14+
"sub_account": {
15+
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
16+
"metadata": {}
17+
},
18+
"metadata": {}
19+
},
20+
"block_identifier": {
21+
"index": 1123941,
22+
"hash": "0x1f2cc6c5027d2f201a5453ad1119574d2aed23a392654742ac3c78783c071f85"
23+
}
24+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "rosetta-account",
4+
"type": "object",
5+
"title": "RosettaAccountBalanceResponse",
6+
"description": "An AccountBalanceResponse is returned on the /account/balance endpoint. If an account has a balance for each AccountIdentifier describing it (ex: an ERC-20 token balance on a few smart contracts), an account balance request must be made with each AccountIdentifier.",
7+
"required": ["block_identifier", "balances"],
8+
"properties": {
9+
"block_identifier": {
10+
"$ref": "./../../entities/rosetta/rosetta-block-identifier.schema.json"
11+
},
12+
"balances": {
13+
"type": "array",
14+
"description": "A single account balance may have multiple currencies",
15+
"items": {
16+
"$ref": "./../../entities/rosetta/rosetta-amount.schema.json"
17+
}
18+
},
19+
"coins": {
20+
"type": "array",
21+
"description": "If a blockchain is UTXO-based, all unspent Coins owned by an account_identifier should be returned alongside the balance. It is highly recommended to populate this field so that users of the Rosetta API implementation don't need to maintain their own indexer to track their UTXOs.",
22+
"items": {
23+
"$ref": "./../../entities/rosetta/rosetta-coin.schema.json"
24+
}
25+
},
26+
"metadata": {
27+
"type": "object",
28+
"description": "Account-based blockchains that utilize a nonce or sequence number should include that number in the metadata. This number could be unique to the identifier or global across the account address.",
29+
"required": ["sequence_number"],
30+
"properties": {
31+
"sequence_number": {
32+
"type": "integer"
33+
}
34+
}
35+
}
36+
}
37+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "rosetta-block-request",
4+
"type": "object",
5+
"title": "RosettaBlockRequest",
6+
"description": "A MempoolTransactionRequest is utilized to retrieve a transaction from the mempool.",
7+
"required": ["network_identifier", "block_identifier"],
8+
"properties": {
9+
"network_identifier": {
10+
"$ref": "./../../entities/rosetta/rosetta-network-identifier.schema.json"
11+
},
12+
"block_identifier": {
13+
"$ref": "./../../entities/rosetta/rosetta-block-identifier.schema.json"
14+
}
15+
}
16+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "rosetta-block-response.schema.json",
4+
"type": "object",
5+
"title": "RosettaBlockResponse",
6+
"description": "A BlockResponse includes a fully-populated block or a partially-populated block with a list of other transactions to fetch (other_transactions). As a result of the consensus algorithm of some blockchains, blocks can be omitted (i.e. certain block indexes can be skipped). If a query for one of these omitted indexes is made, the response should not include a Block object. It is VERY important to note that blocks MUST still form a canonical, connected chain of blocks where each block has a unique index. In other words, the PartialBlockIdentifier of a block after an omitted block should reference the last non-omitted block.",
7+
"required": [],
8+
"properties": {
9+
"block": {
10+
"$ref": "./rosetta-block.schema.json"
11+
},
12+
"other_transactions": {
13+
"type": "array",
14+
"description": "Some blockchains may require additional transactions to be fetched that weren't returned in the block response (ex: block only returns transaction hashes). For blockchains with a lot of transactions in each block, this can be very useful as consumers can concurrently fetch all transactions returned.",
15+
"items": {
16+
"$ref": "./rosetta-other-transaction-identifier.schema.json"
17+
}
18+
}
19+
}
20+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "rosetta-block-transaction-request.schema.json",
4+
"type": "object",
5+
"title": "RosettaBlockTransactionRequest",
6+
"description": "A BlockTransactionRequest is used to fetch a Transaction included in a block that is not returned in a BlockResponse.",
7+
"required": ["network_identifier", "block_identifier", "transaction_identifier"],
8+
"properties": {
9+
"network_identifier": {
10+
"$ref": "./../../entities/rosetta/rosetta-network-identifier.schema.json"
11+
},
12+
"block_identifier": {
13+
"$ref": "./../../entities/rosetta/rosetta-block-identifier.schema.json"
14+
},
15+
"transaction_identifier": {
16+
"$ref": "./rosetta-transaction-identifier.schema.json"
17+
}
18+
}
19+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"type": "object",
4+
"title": "RosettaMempoolTransactionRequest",
5+
"description": "Get a transaction in the mempool by its Transaction Identifier. This is a separate request than fetching a block transaction (/block/transaction) because some blockchain nodes need to know that a transaction query is for something in the mempool instead of a transaction in a block. Transactions may not be fully parsable until they are in a block (ex: may not be possible to determine the fee to pay before a transaction is executed). On this endpoint, it is ok that returned transactions are only estimates of what may actually be included in a block.",
6+
"required": ["network_identifier", "transaction_identifier"],
7+
"properties": {
8+
"network_identifier": {
9+
"$ref": "./rosetta-network-identifier.schema.json"
10+
},
11+
"transaction_identifier": {
12+
"$ref": "./rosetta-transaction-identifier.schema.json"
13+
}
14+
}
15+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"type": "object",
4+
"title": "RosettaMempoolTransactionListResponse",
5+
"description": "The root schema comprises the entire JSON document.",
6+
"required": [
7+
"transaction_identifiers"
8+
],
9+
"properties": {
10+
"transaction_identifiers": {
11+
"type": "array",
12+
"description": "An explanation about the purpose of this instance.",
13+
"items": {
14+
"$ref": "./rosetta-transaction-identifier.schema.json"
15+
}
16+
},
17+
"metadata": {
18+
"type": "object",
19+
"description": "meta data to support pagination",
20+
"properties": {
21+
"limit": {
22+
"type": "integer",
23+
"description": "number of transactions returned"
24+
},
25+
"total": {
26+
"type": "integer",
27+
"description": "Total number of transactions"
28+
},
29+
"offset": {
30+
"type": "integer",
31+
"description": "Response offset"
32+
}
33+
}
34+
}
35+
}
36+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "rosetta-mempool-transaction-request",
4+
"type": "object",
5+
"title": "RosettaMempoolTransactionRequest",
6+
"description": "A MempoolTransactionRequest is utilized to retrieve a transaction from the mempool.",
7+
"required": ["network_identifier", "transaction_identifier"],
8+
"properties": {
9+
"network_identifier": {
10+
"$ref": "./../../entities/rosetta/rosetta-network-identifier.schema.json"
11+
},
12+
"transaction_identifier": {
13+
"$ref": "./rosetta-transaction-identifier.schema.json"
14+
}
15+
}
16+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"type": "object",
4+
"title": "RosettaMempoolTransactionResponse",
5+
"description": "A MempoolTransactionResponse contains an estimate of a mempool transaction. It may not be possible to know the full impact of a transaction in the mempool (ex: fee paid).",
6+
"required": ["transaction"],
7+
"properties": {
8+
"transaction": {
9+
"$ref": "./rosetta-transaction.schema.json"
10+
},
11+
"metadata": {
12+
"type": "object",
13+
"description": "An explanation about the purpose of this instance.",
14+
"required": ["descendant_fees", "ancestor_count"],
15+
"properties": {
16+
"descendant_fees": {
17+
"$id": "#/properties/metadata/properties/descendant_fees",
18+
"type": "integer",
19+
"description": "An explanation about the purpose of this instance."
20+
},
21+
"ancestor_count": {
22+
"$id": "#/properties/metadata/properties/ancestor_count",
23+
"type": "integer",
24+
"description": "An explanation about the purpose of this instance."
25+
}
26+
},
27+
"additionalProperties": true
28+
}
29+
},
30+
"additionalProperties": true
31+
}

0 commit comments

Comments
 (0)