From dc27c570df3c52ddbfa847b988322a113f06f5fd Mon Sep 17 00:00:00 2001 From: Greg Nazario Date: Fri, 2 Sep 2022 00:24:40 -0700 Subject: [PATCH 1/3] [api] Add documentation for REST API Now all objects have documentation in the OpenAPI spec, along with in the website that gives information accordingly --- api/doc/spec.json | 309 ++++++++- api/doc/spec.yaml | 1168 ++++++++++++++++++++++++++++++++-- api/src/accept_type.rs | 9 +- api/src/accounts.rs | 81 ++- api/src/basic.rs | 7 + api/src/bcs_payload.rs | 1 + api/src/blocks.rs | 14 + api/src/events.rs | 17 + api/src/failpoint.rs | 1 + api/src/index.rs | 1 + api/src/lib.rs | 3 +- api/src/log.rs | 1 + api/src/mod.rs | 52 -- api/src/page.rs | 4 + api/src/response.rs | 31 +- api/src/runtime.rs | 4 + api/src/state.rs | 63 +- api/src/transactions.rs | 125 +++- api/types/src/account.rs | 9 + api/types/src/address.rs | 5 + api/types/src/block.rs | 20 + api/types/src/convert.rs | 4 + api/types/src/derives.rs | 13 +- api/types/src/event_key.rs | 9 + api/types/src/hash.rs | 1 + api/types/src/headers.rs | 7 + api/types/src/index.rs | 8 + api/types/src/ledger_info.rs | 8 + api/types/src/mime_types.rs | 5 + api/types/src/move_types.rs | 85 +++ api/types/src/table.rs | 4 + api/types/src/transaction.rs | 183 +++++- api/types/src/wrappers.rs | 1 + 33 files changed, 2057 insertions(+), 196 deletions(-) delete mode 100644 api/src/mod.rs diff --git a/api/doc/spec.json b/api/doc/spec.json index d6a5e322ffa2d..2e635dd3190d3 100644 --- a/api/doc/spec.json +++ b/api/doc/spec.json @@ -21,7 +21,7 @@ "tags": [ { "name": "Accounts", - "description": "Access to account resources and modules" + "description": "Access to accounts, resources, and modules" }, { "name": "Blocks", @@ -51,7 +51,7 @@ "Accounts" ], "summary": "Get account", - "description": "Return high level information about an account such as its sequence number.", + "description": "Retrieves high level information about an account such as its sequence number and\nauthentication key\n\nReturns a 404 if the account doesn't exist", "parameters": [ { "name": "address", @@ -59,6 +59,7 @@ "$ref": "#/components/schemas/Address" }, "in": "path", + "description": "Address of account", "required": true, "deprecated": false, "explode": true @@ -69,6 +70,7 @@ "$ref": "#/components/schemas/U64" }, "in": "query", + "description": "Ledger version to get account", "required": false, "deprecated": false, "explode": true @@ -95,6 +97,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -103,6 +106,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -111,6 +115,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -119,6 +124,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -127,6 +133,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -135,6 +142,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -143,6 +151,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -528,7 +537,7 @@ "Accounts" ], "summary": "Get account resources", - "description": "This endpoint returns all account resources at a given address at a\nspecific ledger version (AKA transaction version). If the ledger\nversion is not specified in the request, the latest ledger version is used.\n\nThe Aptos nodes prune account state history, via a configurable time window (link).\nIf the requested data has been pruned, the server responds with a 404.", + "description": "Retrieves all account resources for a given account and a specific ledger version. If the\nledger version is not specified in the request, the latest ledger version is used.\n\nThe Aptos nodes prune account state history, via a configurable time window.\nIf the requested ledger version has been pruned, the server responds with a 410.", "parameters": [ { "name": "address", @@ -575,6 +584,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -583,6 +593,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -591,6 +602,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -599,6 +611,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -607,6 +620,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -615,6 +629,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -623,6 +638,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -1008,7 +1024,7 @@ "Accounts" ], "summary": "Get account modules", - "description": "This endpoint returns all account modules at a given address at a\nspecific ledger version (AKA transaction version). If the ledger\nversion is not specified in the request, the latest ledger version is used.\n\nThe Aptos nodes prune account state history, via a configurable time window (link).\nIf the requested data has been pruned, the server responds with a 404.", + "description": "Retrieves all account modules' bytecode for a given account and a specific ledger version.\nIf the ledger version is not specified in the request, the latest ledger version is used.\n\nThe Aptos nodes prune account state history, via a configurable time window.\nIf the requested ledger version has been pruned, the server responds with a 410.", "parameters": [ { "name": "address", @@ -1055,6 +1071,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -1063,6 +1080,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -1071,6 +1089,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -1079,6 +1098,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -1087,6 +1107,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -1095,6 +1116,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -1103,6 +1125,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -1545,6 +1568,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -1553,6 +1577,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -1561,6 +1586,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -1569,6 +1595,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -1577,6 +1604,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -1585,6 +1613,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -1593,6 +1622,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -1734,7 +1764,7 @@ "Blocks" ], "summary": "Get blocks by height", - "description": "This endpoint allows you to get the transactions in a block\nand the corresponding block information.", + "description": "This endpoint allows you to get the transactions in a block\nand the corresponding block information.\n\nIf the block is pruned, it will return a 410", "parameters": [ { "name": "block_height", @@ -1779,6 +1809,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -1787,6 +1818,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -1795,6 +1827,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -1803,6 +1836,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -1811,6 +1845,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -1819,6 +1854,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -1827,6 +1863,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -2212,7 +2249,7 @@ "Blocks" ], "summary": "Get blocks by version", - "description": "This endpoint allows you to get the transactions in a block\nand the corresponding block information given a version in the block.", + "description": "This endpoint allows you to get the transactions in a block\nand the corresponding block information given a version in the block.\n\nIf the block is pruned, it will return a 410", "parameters": [ { "name": "version", @@ -2257,6 +2294,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -2265,6 +2303,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -2273,6 +2312,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -2281,6 +2321,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -2289,6 +2330,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -2297,6 +2339,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -2305,6 +2348,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -2748,6 +2792,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -2756,6 +2801,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -2764,6 +2810,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -2772,6 +2819,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -2780,6 +2828,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -2788,6 +2837,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -2796,6 +2846,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -3259,6 +3310,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -3267,6 +3319,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -3275,6 +3328,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -3283,6 +3337,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -3291,6 +3346,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -3299,6 +3355,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -3307,6 +3364,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -3714,6 +3772,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -3722,6 +3781,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -3730,6 +3790,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -3738,6 +3799,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -3746,6 +3808,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -3754,6 +3817,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -3762,6 +3826,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -4024,8 +4089,8 @@ "tags": [ "Accounts" ], - "summary": "Get specific account resource", - "description": "This endpoint returns the resource of a specific type residing at a given\naccount at a specified ledger version (AKA transaction version). If the\nledger version is not specified in the request, the latest ledger version\nis used.\n\nThe Aptos nodes prune account state history, via a configurable time window (link).\nIf the requested data has been pruned, the server responds with a 404.", + "summary": "Get account resource", + "description": "Retrieves an individual resource from a given account and a specific ledger version. If the\nledger version is not specified in the request, the latest ledger version is used.\n\nThe Aptos nodes prune account state history, via a configurable time window.\nIf the requested ledger version has been pruned, the server responds with a 410.", "parameters": [ { "name": "address", @@ -4079,6 +4144,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -4087,6 +4153,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -4095,6 +4162,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -4103,6 +4171,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -4111,6 +4180,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -4119,6 +4189,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -4127,6 +4198,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -4511,8 +4583,8 @@ "tags": [ "Accounts" ], - "summary": "Get specific account module", - "description": "This endpoint returns the module with a specific name residing at a given\naccount at a specified ledger version (AKA transaction version). If the\nledger version is not specified in the request, the latest ledger version\nis used.\n\nThe Aptos nodes prune account state history, via a configurable time window (link).\nIf the requested data has been pruned, the server responds with a 404.", + "summary": "Get account module", + "description": "Retrieves an individual module from a given account and a specific ledger version. If the\nledger version is not specified in the request, the latest ledger version is used.\n\nThe Aptos nodes prune account state history, via a configurable time window.\nIf the requested ledger version has been pruned, the server responds with a 410.", "parameters": [ { "name": "address", @@ -4566,6 +4638,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -4574,6 +4647,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -4582,6 +4656,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -4590,6 +4665,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -4598,6 +4674,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -4606,6 +4683,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -4614,6 +4692,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -4999,7 +5078,7 @@ "Tables" ], "summary": "Get table item", - "description": "Get a table item from the table identified by {table_handle} in the\npath and the \"key\" (TableItemRequest) provided in the request body.\n\nThis is a POST endpoint because the \"key\" for requesting a specific\ntable item (TableItemRequest) could be quite complex, as each of its\nfields could themselves be composed of other structs. This makes it\nimpractical to express using query params, meaning GET isn't an option.", + "description": "Get a table item at a specific ledger version from the table identified by {table_handle}\nin the path and the \"key\" (TableItemRequest) provided in the request body.\n\nThis is a POST endpoint because the \"key\" for requesting a specific\ntable item (TableItemRequest) could be quite complex, as each of its\nfields could themselves be composed of other structs. This makes it\nimpractical to express using query params, meaning GET isn't an option.\n\nThe Aptos nodes prune account state history, via a configurable time window.\nIf the requested ledger version has been pruned, the server responds with a 410.", "parameters": [ { "name": "table_handle", @@ -5053,6 +5132,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -5061,6 +5141,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -5069,6 +5150,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -5077,6 +5159,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -5085,6 +5168,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -5093,6 +5177,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -5101,6 +5186,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -5486,7 +5572,7 @@ "Transactions" ], "summary": "Get transactions", - "description": "Get on-chain (meaning, committed) transactions. You may specify from\nwhen you want the transactions and how to include in the response.", + "description": "Retrieve on-chain committed transactions. The page size and start can be provided to\nget a specific sequence of transactions.\n\nIf the version has been pruned, then a 410 will be returned", "parameters": [ { "name": "start", @@ -5534,6 +5620,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -5542,6 +5629,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -5550,6 +5638,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -5558,6 +5647,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -5566,6 +5656,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -5574,6 +5665,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -5582,6 +5674,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -6006,6 +6099,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -6014,6 +6108,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -6022,6 +6117,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -6030,6 +6126,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -6038,6 +6135,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -6046,6 +6144,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -6054,6 +6153,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -6473,6 +6573,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -6481,6 +6582,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -6489,6 +6591,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -6497,6 +6600,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -6505,6 +6609,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -6513,6 +6618,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -6521,6 +6627,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -6906,7 +7013,7 @@ "Transactions" ], "summary": "Get transaction by version", - "description": "todo", + "description": "Retrieves a transaction by a given version. If the version has been pruned, a 410 will\nbe returned.", "parameters": [ { "name": "txn_version", @@ -6940,6 +7047,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -6948,6 +7056,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -6956,6 +7065,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -6964,6 +7074,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -6972,6 +7083,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -6980,6 +7092,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -6988,6 +7101,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -7373,7 +7487,7 @@ "Transactions" ], "summary": "Get account transactions", - "description": "todo", + "description": "Retrieves transactions from an account. If the start version is too far in the past\na 410 will be returned.\n\nIf no start version is given, it will start at 0", "parameters": [ { "name": "address", @@ -7431,6 +7545,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -7439,6 +7554,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -7447,6 +7563,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -7455,6 +7572,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -7463,6 +7581,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -7471,6 +7590,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -7479,6 +7599,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -7863,6 +7984,8 @@ "tags": [ "Transactions" ], + "summary": "Submit batch transactions", + "description": "This allows you to submit multiple transactions. The response has three outcomes:\n\n1. All transactions succeed, and it will return a 202\n2. Some transactions succeed, and it will return the failed transactions and a 206\n3. No transactions succeed, and it will also return the failed transactions and a 206\n\nTo submit a transaction as JSON, you must submit a SubmitTransactionRequest.\nTo build this request, do the following:\n\n1. Encode the transaction as BCS. If you are using a language that has\nnative BCS support, make sure of that library. If not, you may take\nadvantage of /transactions/encode_submission. When using this\nendpoint, make sure you trust the node you're talking to, as it is\npossible they could manipulate your request.\n2. Sign the encoded transaction and use it to create a TransactionSignature.\n3. Submit the request. Make sure to use the \"application/json\" Content-Type.\n\nTo submit a transaction as BCS, you must submit a SignedTransaction\nencoded as BCS. See SignedTransaction in types/src/transaction/mod.rs.", "requestBody": { "content": { "application/json": { @@ -7906,6 +8029,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -7914,6 +8038,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -7922,6 +8047,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -7930,6 +8056,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -7938,6 +8065,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -7946,6 +8074,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -7954,6 +8083,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -7983,6 +8113,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -7991,6 +8122,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -7999,6 +8131,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -8007,6 +8140,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -8015,6 +8149,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -8023,6 +8158,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -8031,6 +8167,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -8416,7 +8553,7 @@ "Transactions" ], "summary": "Simulate transaction", - "description": "Simulate submitting a transaction. To use this, you must:\n- Create a SignedTransaction with a zero-padded signature.\n- Submit a SubmitTransactionRequest containing a UserTransactionRequest containing that signature.\n\nTo use this endpoint with BCS, you must submit a SignedTransaction\nencoded as BCS. See SignedTransaction in types/src/transaction/mod.rs.", + "description": "The output of the transaction will have the exact transaction outputs and events that running\nan actual signed transaction would have. However, it will not have the associated state\nhashes, as they are not updated in storage. This can be used to estimate the maximum gas\nunits for a submitted transaction.\n\nTo use this, you must:\n- Create a SignedTransaction with a zero-padded signature.\n- Submit a SubmitTransactionRequest containing a UserTransactionRequest containing that signature.\n\nTo use this endpoint with BCS, you must submit a SignedTransaction\nencoded as BCS. See SignedTransaction in types/src/transaction/mod.rs.", "requestBody": { "content": { "application/json": { @@ -8460,6 +8597,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -8468,6 +8606,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -8476,6 +8615,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -8484,6 +8624,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -8492,6 +8633,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -8500,6 +8642,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -8508,6 +8651,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -8925,6 +9069,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -8933,6 +9078,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -8941,6 +9087,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -8949,6 +9096,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -8957,6 +9105,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -8965,6 +9114,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -8973,6 +9123,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -9236,6 +9387,7 @@ "Transactions" ], "summary": "Estimate gas price", + "description": "Currently, the gas estimation is handled by taking the median of the last 100,000 transactions\nIf a user wants to prioritize their transaction and is willing to pay, they can pay more\nthan the gas price. If they're willing to wait longer, they can pay less. Note that the\ngas price moves with the fee market, and should only increase when demand outweighs supply.\n\nIf there have been no transactions in the last 100,000 transactions, the price will be 1.", "responses": { "200": { "description": "", @@ -9257,6 +9409,7 @@ }, "headers": { "X-APTOS-CHAIN-ID": { + "description": "Chain ID of the current chain", "required": true, "deprecated": false, "schema": { @@ -9265,6 +9418,7 @@ } }, "X-APTOS-LEDGER-VERSION": { + "description": "Current ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -9273,6 +9427,7 @@ } }, "X-APTOS-LEDGER-OLDEST-VERSION": { + "description": "Oldest non-pruned ledger version of the chain", "required": true, "deprecated": false, "schema": { @@ -9281,6 +9436,7 @@ } }, "X-APTOS-LEDGER-TIMESTAMPUSEC": { + "description": "Current timestamp of the chain", "required": true, "deprecated": false, "schema": { @@ -9289,6 +9445,7 @@ } }, "X-APTOS-EPOCH": { + "description": "Current epoch of the chain", "required": true, "deprecated": false, "schema": { @@ -9297,6 +9454,7 @@ } }, "X-APTOS-BLOCK-HEIGHT": { + "description": "Current block height of the chain", "required": true, "deprecated": false, "schema": { @@ -9305,6 +9463,7 @@ } }, "X-APTOS-OLDEST-BLOCK-HEIGHT": { + "description": "Oldest non-pruned block height of the chain", "required": true, "deprecated": false, "schema": { @@ -9567,21 +9726,37 @@ "schemas": { "AccountData": { "type": "object", + "description": "Account data\n\nA simplified version of the onchain Account resource", "required": [ "sequence_number", "authentication_key" ], "properties": { "sequence_number": { - "$ref": "#/components/schemas/U64" + "allOf": [ + { + "$ref": "#/components/schemas/U64" + }, + { + "description": "Next sequence number of the account\n\nThis will be the sequence number of the next transaction committed on this account" + } + ] }, "authentication_key": { - "$ref": "#/components/schemas/HexEncodedBytes" + "allOf": [ + { + "$ref": "#/components/schemas/HexEncodedBytes" + }, + { + "description": "Authentication key\n\nA SHA-256 of public keys and authentication scheme of the account" + } + ] } } }, "AccountSignature": { "type": "object", + "description": "Account signature scheme\n\nThe account signature scheme allows you to have two types of accounts:\n\n1. A single Ed25519 key account, one private key\n2. A k-of-n multi-Ed25519 key account, multiple private keys, such that k-of-n must sign a transaction.", "oneOf": [ { "$ref": "#/components/schemas/AccountSignature_Ed25519Signature" @@ -9699,6 +9874,7 @@ }, "Block": { "type": "object", + "description": "A Block with or without transactions\n\nThis contains the information about a transactions along with\nassociated transactions if requested", "required": [ "block_height", "block_hash", @@ -9708,22 +9884,58 @@ ], "properties": { "block_height": { - "$ref": "#/components/schemas/U64" + "allOf": [ + { + "$ref": "#/components/schemas/U64" + }, + { + "description": "The block height (number of the block from 0)" + } + ] }, "block_hash": { - "$ref": "#/components/schemas/HashValue" + "allOf": [ + { + "$ref": "#/components/schemas/HashValue" + }, + { + "description": "The block hash" + } + ] }, "block_timestamp": { - "$ref": "#/components/schemas/U64" + "allOf": [ + { + "$ref": "#/components/schemas/U64" + }, + { + "description": "The block timestamp in Unix epoch microseconds" + } + ] }, "first_version": { - "$ref": "#/components/schemas/U64" + "allOf": [ + { + "$ref": "#/components/schemas/U64" + }, + { + "description": "The first ledger version of the block inclusive" + } + ] }, "last_version": { - "$ref": "#/components/schemas/U64" + "allOf": [ + { + "$ref": "#/components/schemas/U64" + }, + { + "description": "The last ledger version of the block inclusive" + } + ] }, "transactions": { "type": "array", + "description": "The transactions in the block in sequential order", "items": { "$ref": "#/components/schemas/Transaction" } @@ -9937,16 +10149,31 @@ }, "Ed25519Signature": { "type": "object", + "description": "A single Ed25519 signature", "required": [ "public_key", "signature" ], "properties": { "public_key": { - "$ref": "#/components/schemas/HexEncodedBytes" + "allOf": [ + { + "$ref": "#/components/schemas/HexEncodedBytes" + }, + { + "description": "Ed25519 public key of the account" + } + ] }, "signature": { - "$ref": "#/components/schemas/HexEncodedBytes" + "allOf": [ + { + "$ref": "#/components/schemas/HexEncodedBytes" + }, + { + "description": "Signature of the transaction" + } + ] } } }, @@ -10044,13 +10271,15 @@ }, "GasEstimation": { "type": "object", + "description": "Struct holding the outputs of the estimate gas API", "required": [ "gas_estimate" ], "properties": { "gas_estimate": { "type": "integer", - "format": "uint64" + "format": "uint64", + "description": "The current estimate for the gas unit price" } } }, @@ -10152,6 +10381,7 @@ }, "HealthCheckSuccess": { "type": "object", + "description": "Struct for healthcheck", "required": [ "message" ], @@ -10506,6 +10736,7 @@ }, "MultiAgentSignature": { "type": "object", + "description": "Multi agent signature for multi agent transactions\n\nThis allows you to have transactions across multiple accounts", "required": [ "sender", "secondary_signer_addresses", @@ -10513,16 +10744,25 @@ ], "properties": { "sender": { - "$ref": "#/components/schemas/AccountSignature" + "allOf": [ + { + "$ref": "#/components/schemas/AccountSignature" + }, + { + "description": "Sender of the transaction, which will pay for gas" + } + ] }, "secondary_signer_addresses": { "type": "array", + "description": "The other involved parties' addresses", "items": { "$ref": "#/components/schemas/Address" } }, "secondary_signers": { "type": "array", + "description": "The associated signatures, in the same order as the secondary addresses", "items": { "$ref": "#/components/schemas/AccountSignature" } @@ -10531,6 +10771,7 @@ }, "MultiEd25519Signature": { "type": "object", + "description": "A Ed25519 multi-sig signature\n\nThis allows k-of-n signing for a transaction", "required": [ "public_keys", "signatures", @@ -10540,22 +10781,32 @@ "properties": { "public_keys": { "type": "array", + "description": "The public keys for the Ed25519 signature", "items": { "$ref": "#/components/schemas/HexEncodedBytes" } }, "signatures": { "type": "array", + "description": "Signature associated with the public keys in the same order", "items": { "$ref": "#/components/schemas/HexEncodedBytes" } }, "threshold": { "type": "integer", - "format": "uint8" + "format": "uint8", + "description": "The number of signatures required for a successful transaction" }, "bitmap": { - "$ref": "#/components/schemas/HexEncodedBytes" + "allOf": [ + { + "$ref": "#/components/schemas/HexEncodedBytes" + }, + { + "description": "The bitmap representing which keys are being used" + } + ] } } }, @@ -10858,6 +11109,7 @@ }, "TransactionSignature": { "type": "object", + "description": "An enum representing the different transaction signatures available", "oneOf": [ { "$ref": "#/components/schemas/TransactionSignature_Ed25519Signature" @@ -11439,6 +11691,7 @@ }, "WriteTableItem": { "type": "object", + "description": "Change set to write a table item", "required": [ "state_key_hash", "handle", diff --git a/api/doc/spec.yaml b/api/doc/spec.yaml index 7d771ae103405..bd07bc3b737cf 100644 --- a/api/doc/spec.yaml +++ b/api/doc/spec.yaml @@ -14,7 +14,7 @@ servers: - url: /v1 tags: - name: Accounts - description: Access to account resources and modules + description: Access to accounts, resources, and modules - name: Blocks description: Access to blocks - name: Events @@ -31,13 +31,17 @@ paths: tags: - Accounts summary: Get account - description: Return high level information about an account such as its sequence - number. + description: |- + Retrieves high level information about an account such as its sequence number and + authentication key + + Returns a 404 if the account doesn't exist parameters: - name: address schema: $ref: '#/components/schemas/Address' in: path + description: Address of account required: true deprecated: false explode: true @@ -45,6 +49,7 @@ paths: schema: $ref: '#/components/schemas/U64' in: query + description: Ledger version to get state of account required: false deprecated: false explode: true @@ -63,42 +68,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -112,36 +124,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -154,36 +173,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -196,36 +222,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -238,36 +271,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -280,36 +320,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -322,36 +369,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -363,12 +417,11 @@ paths: - Accounts summary: Get account resources description: |- - This endpoint returns all account resources at a given address at a - specific ledger version (AKA transaction version). If the ledger - version is not specified in the request, the latest ledger version is used. + Retrieves all account resources for a given account and a specific ledger version. If the + ledger version is not specified in the request, the latest ledger version is used. - The Aptos nodes prune account state history, via a configurable time window (link). - If the requested data has been pruned, the server responds with a 404. + The Aptos nodes prune account state history, via a configurable time window. + If the requested ledger version has been pruned, the server responds with a 410. parameters: - name: address schema: @@ -401,42 +454,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -450,36 +510,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -492,36 +559,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -534,36 +608,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -576,36 +657,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -618,36 +706,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -660,36 +755,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -701,12 +803,11 @@ paths: - Accounts summary: Get account modules description: |- - This endpoint returns all account modules at a given address at a - specific ledger version (AKA transaction version). If the ledger - version is not specified in the request, the latest ledger version is used. + Retrieves all account modules' bytecode for a given account and a specific ledger version. + If the ledger version is not specified in the request, the latest ledger version is used. - The Aptos nodes prune account state history, via a configurable time window (link). - If the requested data has been pruned, the server responds with a 404. + The Aptos nodes prune account state history, via a configurable time window. + If the requested ledger version has been pruned, the server responds with a 410. parameters: - name: address schema: @@ -739,42 +840,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -788,36 +896,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -830,36 +945,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -872,36 +994,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -914,36 +1043,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -956,36 +1092,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -998,36 +1141,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1086,42 +1236,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -1135,36 +1292,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1177,36 +1341,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1220,6 +1391,8 @@ paths: description: |- This endpoint allows you to get the transactions in a block and the corresponding block information. + + If the block is pruned, it will return a 410 parameters: - name: block_height schema: @@ -1251,42 +1424,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -1300,36 +1480,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1342,36 +1529,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1384,36 +1578,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1426,36 +1627,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1468,36 +1676,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1510,36 +1725,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1553,6 +1775,8 @@ paths: description: |- This endpoint allows you to get the transactions in a block and the corresponding block information given a version in the block. + + If the block is pruned, it will return a 410 parameters: - name: version schema: @@ -1584,42 +1808,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -1633,36 +1864,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1675,36 +1913,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1717,36 +1962,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1759,36 +2011,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1801,36 +2060,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1843,36 +2109,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -1926,42 +2199,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -1975,36 +2255,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2017,36 +2304,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2059,36 +2353,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2101,36 +2402,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2143,36 +2451,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2185,36 +2500,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2283,42 +2605,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -2332,36 +2661,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2374,36 +2710,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2416,36 +2759,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2458,36 +2808,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2500,36 +2857,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2542,36 +2906,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2600,42 +2971,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -2649,36 +3027,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2691,36 +3076,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2733,36 +3125,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2775,36 +3174,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2814,15 +3220,13 @@ paths: get: tags: - Accounts - summary: Get specific account resource + summary: Get account resource description: |- - This endpoint returns the resource of a specific type residing at a given - account at a specified ledger version (AKA transaction version). If the - ledger version is not specified in the request, the latest ledger version - is used. + Retrieves an individual resource from a given account and a specific ledger version. If the + ledger version is not specified in the request, the latest ledger version is used. - The Aptos nodes prune account state history, via a configurable time window (link). - If the requested data has been pruned, the server responds with a 404. + The Aptos nodes prune account state history, via a configurable time window. + If the requested ledger version has been pruned, the server responds with a 410. parameters: - name: address schema: @@ -2860,42 +3264,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -2909,36 +3320,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2951,36 +3369,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -2993,36 +3418,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3035,36 +3467,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3077,36 +3516,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3119,36 +3565,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3158,15 +3611,13 @@ paths: get: tags: - Accounts - summary: Get specific account module + summary: Get account module description: |- - This endpoint returns the module with a specific name residing at a given - account at a specified ledger version (AKA transaction version). If the - ledger version is not specified in the request, the latest ledger version - is used. + Retrieves an individual module from a given account and a specific ledger version. If the + ledger version is not specified in the request, the latest ledger version is used. - The Aptos nodes prune account state history, via a configurable time window (link). - If the requested data has been pruned, the server responds with a 404. + The Aptos nodes prune account state history, via a configurable time window. + If the requested ledger version has been pruned, the server responds with a 410. parameters: - name: address schema: @@ -3204,42 +3655,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -3253,36 +3711,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3295,36 +3760,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3337,36 +3809,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3379,36 +3858,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3421,36 +3907,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3463,36 +3956,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3504,13 +4004,16 @@ paths: - Tables summary: Get table item description: |- - Get a table item from the table identified by {table_handle} in the - path and the "key" (TableItemRequest) provided in the request body. + Get a table item at a specific ledger version from the table identified by {table_handle} + in the path and the "key" (TableItemRequest) provided in the request body. This is a POST endpoint because the "key" for requesting a specific table item (TableItemRequest) could be quite complex, as each of its fields could themselves be composed of other structs. This makes it impractical to express using query params, meaning GET isn't an option. + + The Aptos nodes prune account state history, via a configurable time window. + If the requested ledger version has been pruned, the server responds with a 410. parameters: - name: table_handle schema: @@ -3547,42 +4050,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -3596,36 +4106,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3638,36 +4155,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3680,36 +4204,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3722,36 +4253,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3764,36 +4302,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3806,36 +4351,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3847,8 +4399,10 @@ paths: - Transactions summary: Get transactions description: |- - Get on-chain (meaning, committed) transactions. You may specify from - when you want the transactions and how to include in the response. + Retrieve on-chain committed transactions. The page size and start can be provided to + get a specific sequence of transactions. + + If the version has been pruned, then a 410 will be returned parameters: - name: start schema: @@ -3882,42 +4436,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -3931,36 +4492,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -3973,36 +4541,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4015,36 +4590,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4057,36 +4639,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4099,36 +4688,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4141,36 +4737,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4223,42 +4826,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -4272,36 +4882,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4314,36 +4931,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4356,36 +4980,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4398,36 +5029,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4440,36 +5078,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4482,36 +5127,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4557,42 +5209,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -4606,36 +5265,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4648,36 +5314,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4690,36 +5363,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4732,36 +5412,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4774,36 +5461,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4816,36 +5510,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4856,7 +5557,9 @@ paths: tags: - Transactions summary: Get transaction by version - description: todo + description: |- + Retrieves a transaction by a given version. If the version has been pruned, a 410 will + be returned. parameters: - name: txn_version schema: @@ -4880,42 +5583,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -4929,36 +5639,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -4971,36 +5688,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5013,36 +5737,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5055,36 +5786,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5097,36 +5835,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5139,36 +5884,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5179,7 +5931,11 @@ paths: tags: - Transactions summary: Get account transactions - description: todo + description: |- + Retrieves transactions from an account. If the start version is too far in the past + a 410 will be returned. + + If no start version is given, it will start at 0 parameters: - name: address schema: @@ -5220,42 +5976,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -5269,36 +6032,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5311,36 +6081,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5353,36 +6130,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5395,36 +6179,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5437,36 +6228,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5479,36 +6277,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5518,6 +6323,27 @@ paths: post: tags: - Transactions + summary: Submit batch transactions + description: |- + This allows you to submit multiple transactions. The response has three outcomes: + + 1. All transactions succeed, and it will return a 202 + 2. Some transactions succeed, and it will return the failed transactions and a 206 + 3. No transactions succeed, and it will also return the failed transactions and a 206 + + To submit a transaction as JSON, you must submit a SubmitTransactionRequest. + To build this request, do the following: + + 1. Encode the transaction as BCS. If you are using a language that has + native BCS support, make sure of that library. If not, you may take + advantage of /transactions/encode_submission. When using this + endpoint, make sure you trust the node you're talking to, as it is + possible they could manipulate your request. + 2. Sign the encoded transaction and use it to create a TransactionSignature. + 3. Submit the request. Make sure to use the "application/json" Content-Type. + + To submit a transaction as BCS, you must submit a SignedTransaction + encoded as BCS. See SignedTransaction in types/src/transaction/mod.rs. requestBody: content: application/json: @@ -5547,42 +6373,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -5602,42 +6435,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -5651,36 +6491,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5693,36 +6540,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5735,36 +6589,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5777,36 +6638,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5819,36 +6687,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5861,36 +6736,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -5902,7 +6784,12 @@ paths: - Transactions summary: Simulate transaction description: |- - Simulate submitting a transaction. To use this, you must: + The output of the transaction will have the exact transaction outputs and events that running + an actual signed transaction would have. However, it will not have the associated state + hashes, as they are not updated in storage. This can be used to estimate the maximum gas + units for a submitted transaction. + + To use this, you must: - Create a SignedTransaction with a zero-padded signature. - Submit a SubmitTransactionRequest containing a UserTransactionRequest containing that signature. @@ -5937,42 +6824,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -5986,36 +6880,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6028,36 +6929,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6070,36 +6978,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6112,36 +7027,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6154,36 +7076,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6196,36 +7125,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6274,42 +7210,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -6323,36 +7266,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6365,36 +7315,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6407,36 +7364,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6449,36 +7413,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6489,6 +7460,13 @@ paths: tags: - Transactions summary: Estimate gas price + description: |- + Currently, the gas estimation is handled by taking the median of the last 100,000 transactions + If a user wants to prioritize their transaction and is willing to pay, they can pay more + than the gas price. If they're willing to wait longer, they can pay less. Note that the + gas price moves with the fee market, and should only increase when demand outweighs supply. + + If there have been no transactions in the last 100,000 transactions, the price will be 1. responses: '200': description: '' @@ -6504,42 +7482,49 @@ paths: format: uint8 headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain required: true deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain required: true deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain required: true deprecated: false schema: @@ -6553,36 +7538,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6595,36 +7587,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6637,36 +7636,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6679,36 +7685,43 @@ paths: $ref: '#/components/schemas/AptosError' headers: X-APTOS-CHAIN-ID: + description: Chain ID of the current chain deprecated: false schema: type: integer format: uint8 X-APTOS-LEDGER-VERSION: + description: Current ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-OLDEST-VERSION: + description: Oldest non-pruned ledger version of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-LEDGER-TIMESTAMPUSEC: + description: Current timestamp of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-EPOCH: + description: Current epoch of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-BLOCK-HEIGHT: + description: Current block height of the chain deprecated: false schema: type: integer format: uint64 X-APTOS-OLDEST-BLOCK-HEIGHT: + description: Oldest non-pruned block height of the chain deprecated: false schema: type: integer @@ -6718,16 +7731,37 @@ components: schemas: AccountData: type: object + description: |- + Account data + + A simplified version of the onchain Account resource required: - sequence_number - authentication_key properties: sequence_number: - $ref: '#/components/schemas/U64' + allOf: + - $ref: '#/components/schemas/U64' + - description: |- + Next sequence number of the account + + This will be the sequence number of the next transaction committed on this account authentication_key: - $ref: '#/components/schemas/HexEncodedBytes' + allOf: + - $ref: '#/components/schemas/HexEncodedBytes' + - description: |- + Authentication key + + A SHA-256 of public keys and authentication scheme of the account AccountSignature: type: object + description: |- + Account signature scheme + + The account signature scheme allows you to have two types of accounts: + + 1. A single Ed25519 key account, one private key + 2. A k-of-n multi-Ed25519 key account, multiple private keys, such that k-of-n must sign a transaction. oneOf: - $ref: '#/components/schemas/AccountSignature_Ed25519Signature' - $ref: '#/components/schemas/AccountSignature_MultiEd25519Signature' @@ -6811,6 +7845,11 @@ components: - api_disabled Block: type: object + description: |- + A Block with or without transactions + + This contains the information about a transactions along with + associated transactions if requested required: - block_height - block_hash @@ -6819,17 +7858,28 @@ components: - last_version properties: block_height: - $ref: '#/components/schemas/U64' + allOf: + - $ref: '#/components/schemas/U64' + - description: The block height (number of the block from 0) block_hash: - $ref: '#/components/schemas/HashValue' + allOf: + - $ref: '#/components/schemas/HashValue' + - description: The block hash block_timestamp: - $ref: '#/components/schemas/U64' + allOf: + - $ref: '#/components/schemas/U64' + - description: The block timestamp in Unix epoch microseconds first_version: - $ref: '#/components/schemas/U64' + allOf: + - $ref: '#/components/schemas/U64' + - description: The first ledger version of the block inclusive last_version: - $ref: '#/components/schemas/U64' + allOf: + - $ref: '#/components/schemas/U64' + - description: The last ledger version of the block inclusive transactions: type: array + description: The transactions in the block in sequential order items: $ref: '#/components/schemas/Transaction' BlockMetadataTransaction: @@ -6979,14 +8029,19 @@ components: $ref: '#/components/schemas/Event' Ed25519Signature: type: object + description: A single Ed25519 signature required: - public_key - signature properties: public_key: - $ref: '#/components/schemas/HexEncodedBytes' + allOf: + - $ref: '#/components/schemas/HexEncodedBytes' + - description: Ed25519 public key of the account signature: - $ref: '#/components/schemas/HexEncodedBytes' + allOf: + - $ref: '#/components/schemas/HexEncodedBytes' + - description: Signature of the transaction EncodeSubmissionRequest: type: object required: @@ -7069,12 +8124,14 @@ components: example: '0x000000000000000088fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ' GasEstimation: type: object + description: Struct holding the outputs of the estimate gas API required: - gas_estimate properties: gas_estimate: type: integer format: uint64 + description: The current estimate for the gas unit price GenesisPayload: type: object oneOf: @@ -7140,6 +8197,7 @@ components: type: string HealthCheckSuccess: type: object + description: Struct for healthcheck required: - message properties: @@ -7467,23 +8525,36 @@ components: - type: string MultiAgentSignature: type: object + description: |- + Multi agent signature for multi agent transactions + + This allows you to have transactions across multiple accounts required: - sender - secondary_signer_addresses - secondary_signers properties: sender: - $ref: '#/components/schemas/AccountSignature' + allOf: + - $ref: '#/components/schemas/AccountSignature' + - description: Sender of the transaction, which will pay for gas secondary_signer_addresses: type: array + description: The other involved parties' addresses items: $ref: '#/components/schemas/Address' secondary_signers: type: array + description: The associated signatures, in the same order as the secondary + addresses items: $ref: '#/components/schemas/AccountSignature' MultiEd25519Signature: type: object + description: |- + A Ed25519 multi-sig signature + + This allows k-of-n signing for a transaction required: - public_keys - signatures @@ -7492,17 +8563,22 @@ components: properties: public_keys: type: array + description: The public keys for the Ed25519 signature items: $ref: '#/components/schemas/HexEncodedBytes' signatures: type: array + description: Signature associated with the public keys in the same order items: $ref: '#/components/schemas/HexEncodedBytes' threshold: type: integer format: uint8 + description: The number of signatures required for a successful transaction bitmap: - $ref: '#/components/schemas/HexEncodedBytes' + allOf: + - $ref: '#/components/schemas/HexEncodedBytes' + - description: The bitmap representing which keys are being used PendingTransaction: type: object required: @@ -7696,6 +8772,7 @@ components: - $ref: '#/components/schemas/ScriptPayload' TransactionSignature: type: object + description: An enum representing the different transaction signatures available oneOf: - $ref: '#/components/schemas/TransactionSignature_Ed25519Signature' - $ref: '#/components/schemas/TransactionSignature_MultiEd25519Signature' @@ -8048,6 +9125,7 @@ components: - $ref: '#/components/schemas/ScriptWriteSet' WriteTableItem: type: object + description: Change set to write a table item required: - state_key_hash - handle diff --git a/api/src/accept_type.rs b/api/src/accept_type.rs index e118e645a730b..b2df0800c5230 100644 --- a/api/src/accept_type.rs +++ b/api/src/accept_type.rs @@ -4,14 +4,19 @@ use aptos_api_types::mime_types::BCS; use poem::{web::Accept, FromRequest, Request, RequestBody, Result}; +/// Accept types from input headers +/// +/// Determines the output type of each API #[derive(PartialEq, Eq, Debug)] pub enum AcceptType { + /// Convert and resolve types to JSON Json, + /// Take types with as little conversion as possible from the database Bcs, } -// This impl allows us to get the data straight from the arguments to the -// endpoint handler. +/// This impl allows us to get the data straight from the arguments to the +/// endpoint handler. #[async_trait::async_trait] impl<'a> FromRequest<'a> for AcceptType { async fn from_request(request: &'a Request, _body: &mut RequestBody) -> Result { diff --git a/api/src/accounts.rs b/api/src/accounts.rs index 1e7c0481cc61a..fd8a52eb6b03c 100644 --- a/api/src/accounts.rs +++ b/api/src/accounts.rs @@ -32,6 +32,7 @@ use std::collections::BTreeMap; use std::convert::TryInto; use std::sync::Arc; +/// API for accounts, their associated resources, and modules pub struct AccountsApi { pub context: Arc, } @@ -40,7 +41,10 @@ pub struct AccountsApi { impl AccountsApi { /// Get account /// - /// Return high level information about an account such as its sequence number. + /// Retrieves high level information about an account such as its sequence number and + /// authentication key + /// + /// Returns a 404 if the account doesn't exist #[oai( path = "/accounts/:address", method = "get", @@ -50,7 +54,11 @@ impl AccountsApi { async fn get_account( &self, accept_type: AcceptType, + /// Address of account with or without a `0x` prefix address: Path
, + /// Ledger version to get state of account + /// + /// If not provided, it will be the latest version ledger_version: Query>, ) -> BasicResultWith404 { fail_point_poem("endpoint_get_account")?; @@ -62,12 +70,11 @@ impl AccountsApi { /// Get account resources /// - /// This endpoint returns all account resources at a given address at a - /// specific ledger version (AKA transaction version). If the ledger - /// version is not specified in the request, the latest ledger version is used. + /// Retrieves all account resources for a given account and a specific ledger version. If the + /// ledger version is not specified in the request, the latest ledger version is used. /// - /// The Aptos nodes prune account state history, via a configurable time window (link). - /// If the requested data has been pruned, the server responds with a 404. + /// The Aptos nodes prune account state history, via a configurable time window. + /// If the requested ledger version has been pruned, the server responds with a 410. #[oai( path = "/accounts/:address/resources", method = "get", @@ -77,7 +84,11 @@ impl AccountsApi { async fn get_account_resources( &self, accept_type: AcceptType, + /// Address of account with or without a `0x` prefix address: Path
, + /// Ledger version to get state of account + /// + /// If not provided, it will be the latest version ledger_version: Query>, ) -> BasicResultWith404> { fail_point_poem("endpoint_get_account_resources")?; @@ -89,12 +100,11 @@ impl AccountsApi { /// Get account modules /// - /// This endpoint returns all account modules at a given address at a - /// specific ledger version (AKA transaction version). If the ledger - /// version is not specified in the request, the latest ledger version is used. + /// Retrieves all account modules' bytecode for a given account at a specific ledger version. + /// If the ledger version is not specified in the request, the latest ledger version is used. /// - /// The Aptos nodes prune account state history, via a configurable time window (link). - /// If the requested data has been pruned, the server responds with a 404. + /// The Aptos nodes prune account state history, via a configurable time window. + /// If the requested ledger version has been pruned, the server responds with a 410. #[oai( path = "/accounts/:address/modules", method = "get", @@ -104,7 +114,11 @@ impl AccountsApi { async fn get_account_modules( &self, accept_type: AcceptType, + /// Address of account with or without a `0x` prefix address: Path
, + /// Ledger version to get state of account + /// + /// If not provided, it will be the latest version ledger_version: Query>, ) -> BasicResultWith404> { fail_point_poem("endpoint_get_account_modules")?; @@ -115,19 +129,26 @@ impl AccountsApi { } } +/// A struct representing Account related lookups for resources and modules pub struct Account { context: Arc, + /// Address of account address: Address, + /// Lookup ledger version ledger_version: u64, + /// Current ledger info pub latest_ledger_info: LedgerInfo, } impl Account { + /// Creates a new account struct and determines the current ledger info, and determines the + /// ledger version to query pub fn new( context: Arc, address: Address, requested_ledger_version: Option, ) -> Result { + // Use the latest ledger version, or the requested associated version let (latest_ledger_info, requested_ledger_version) = context .get_latest_ledger_info_and_verify_lookup_version( requested_ledger_version.map(|inner| inner.0), @@ -143,7 +164,12 @@ impl Account { // These functions map directly to endpoint functions. + /// Retrieves the [`AccountData`] for the associated account + /// + /// * JSON: Return a JSON encoded version of [`AccountData`] + /// * BCS: Return a BCS encoded version of [`AccountData`] pub fn account(self, accept_type: &AcceptType) -> BasicResultWith404 { + // Retrieve the Account resource and convert it accordingly let state_key = StateKey::AccessPath(AccessPath::resource_access_path(ResourceKey::new( self.address.into(), AccountResource::struct_tag(), @@ -158,15 +184,17 @@ impl Account { let state_value = match state_value { Some(state_value) => state_value, None => { + // If there's no account info, then it's not found return Err(resource_not_found( self.address, &AccountResource::struct_tag(), self.ledger_version, &self.latest_ledger_info, - )) + )); } }; + // Convert the AccountResource into the summary object AccountData let account_resource: AccountResource = bcs::from_bytes(&state_value) .context("Internal error deserializing response from DB") .map_err(|err| { @@ -192,12 +220,17 @@ impl Account { } } + /// Retrieves the move resources associated with the account + /// + /// * JSON: Return a JSON encoded version of [`Vec`] + /// * BCS: Return a sorted BCS encoded version of BCS encoded resources [`BTreeMap>`] pub fn resources(self, accept_type: &AcceptType) -> BasicResultWith404> { let account_state = self.account_state()?; let resources = account_state.get_resources(); match accept_type { AcceptType::Json => { + // Resolve the BCS encoded versions into `MoveResource`s let move_resolver = self.context.move_resolver_poem(&self.latest_ledger_info)?; let converted_resources = move_resolver .as_converter(self.context.db.clone()) @@ -218,6 +251,7 @@ impl Account { )) } AcceptType::Bcs => { + // Put resources in a BTreeMap to ensure they're ordered the same every time let resources: BTreeMap> = resources .map(|(key, value)| (key, value.to_vec())) .collect(); @@ -230,10 +264,15 @@ impl Account { } } + /// Retrieves the move modules' bytecode associated with the account + /// + /// * JSON: Return a JSON encoded version of [`Vec`] with parsed ABIs + /// * BCS: Return a sorted BCS encoded version of bytecode [`BTreeMap>`] pub fn modules(self, accept_type: &AcceptType) -> BasicResultWith404> { let modules = self.account_state()?.into_modules(); match accept_type { AcceptType::Json => { + // Read bytecode and parse ABIs for output let mut converted_modules = Vec::new(); for (_, module) in modules { converted_modules.push( @@ -256,6 +295,7 @@ impl Account { )) } AcceptType::Bcs => { + // Sort modules by name let modules: BTreeMap> = modules .map(|(key, value)| (key.into(), value.to_vec())) .collect(); @@ -270,6 +310,7 @@ impl Account { // Helpers for processing account state. + /// Retrieves the account state pub fn account_state(&self) -> Result { let state = self .context @@ -291,12 +332,17 @@ impl Account { // Events specific stuff. + /// Retrieves an event key from a [`MoveStructTag`] and a [`Identifier`] field name + /// + /// e.g. If there's the `CoinStore` module, it has a field named `withdraw_events` for + /// the withdraw events to lookup the key pub fn find_event_key( &self, - event_handle: MoveStructTag, + struct_tag: MoveStructTag, field_name: Identifier, ) -> Result { - let struct_tag: StructTag = event_handle + // Parse the struct tag + let struct_tag: StructTag = struct_tag .try_into() .context("Given event handle was invalid") .map_err(|err| { @@ -307,8 +353,8 @@ impl Account { ) })?; + // Find the resource and retrieve the struct field let resource = self.find_resource(&struct_tag)?; - let (_id, value) = resource .into_iter() .find(|(id, _)| id == &field_name) @@ -322,7 +368,7 @@ impl Account { ) })?; - // Serialization should not fail, otherwise it's internal bug + // Deserialize the event handle to retrieve the key let event_handle_bytes = bcs::to_bytes(&value) .context("Failed to serialize event handle from storage") .map_err(|err| { @@ -348,6 +394,7 @@ impl Account { Ok(*event_handle.key()) } + /// Find a resource associated with an account fn find_resource( &self, struct_tag: &StructTag, @@ -364,6 +411,8 @@ impl Account { &self.latest_ledger_info, ) })?; + + // Convert to fields in move struct let move_resolver = self.context.move_resolver_poem(&self.latest_ledger_info)?; move_resolver .as_converter(self.context.db.clone()) diff --git a/api/src/basic.rs b/api/src/basic.rs index 926f24d5e0a51..d72e110298307 100644 --- a/api/src/basic.rs +++ b/api/src/basic.rs @@ -23,10 +23,12 @@ generate_success_response!(HealthCheckResponse, (200, Ok)); generate_error_response!(HealthCheckError, (503, ServiceUnavailable), (500, Internal)); pub type HealthCheckResult = poem::Result, HealthCheckError>; +/// Basic API does healthchecking and shows the OpenAPI spec pub struct BasicApi { pub context: Arc, } +/// Representation of a successful healthcheck #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, Object)] pub struct HealthCheckSuccess { message: String, @@ -74,9 +76,14 @@ impl BasicApi { async fn healthy( &self, accept_type: AcceptType, + /// Threshold in seconds that the server can be behind to be considered healthy + /// + /// If not provided, the healthcheck will always succeed duration_secs: Query>, ) -> HealthCheckResult { let ledger_info = self.context.get_latest_ledger_info()?; + + // If we have a duration, check that it's close to the current time, otherwise it's ok if let Some(duration) = duration_secs.0 { let timestamp = ledger_info.timestamp(); diff --git a/api/src/bcs_payload.rs b/api/src/bcs_payload.rs index d2230c17a0a41..17f67a9960669 100644 --- a/api/src/bcs_payload.rs +++ b/api/src/bcs_payload.rs @@ -19,6 +19,7 @@ use poem_openapi::{ ApiResponse, }; +/// A wrapper struct for a payload containing BCS encoded bytes #[derive(Debug, Clone, Eq, PartialEq)] pub struct Bcs(pub Vec); diff --git a/api/src/blocks.rs b/api/src/blocks.rs index 8dedac991d3a2..5b47b9ff4cddd 100644 --- a/api/src/blocks.rs +++ b/api/src/blocks.rs @@ -11,6 +11,7 @@ use poem_openapi::param::{Path, Query}; use poem_openapi::OpenApi; use std::sync::Arc; +/// API for block transactions and information pub struct BlocksApi { pub context: Arc, } @@ -21,6 +22,8 @@ impl BlocksApi { /// /// This endpoint allows you to get the transactions in a block /// and the corresponding block information. + /// + /// If the block is pruned, it will return a 410 #[oai( path = "/blocks/by_height/:block_height", method = "get", @@ -30,7 +33,11 @@ impl BlocksApi { async fn get_block_by_height( &self, accept_type: AcceptType, + /// Block height to lookup. Starts at 0 block_height: Path, + /// If set to true, include all transactions in the block + /// + /// If not provided, no transactions will be retrieved with_transactions: Query>, ) -> BasicResultWith404 { fail_point_poem("endpoint_get_block_by_height")?; @@ -47,6 +54,8 @@ impl BlocksApi { /// /// This endpoint allows you to get the transactions in a block /// and the corresponding block information given a version in the block. + /// + /// If the block has been pruned, it will return a 410 #[oai( path = "/blocks/by_version/:version", method = "get", @@ -56,7 +65,11 @@ impl BlocksApi { async fn get_block_by_version( &self, accept_type: AcceptType, + /// Ledger version to lookup block information for. version: Path, + /// If set to true, include all transactions in the block + /// + /// If not provided, no transactions will be retrieved with_transactions: Query>, ) -> BasicResultWith404 { fail_point_poem("endpoint_get_block_by_version")?; @@ -101,6 +114,7 @@ impl BlocksApi { self.render_bcs_block(&accept_type, latest_ledger_info, bcs_block) } + /// Renders a [`BcsBlock`] into a [`Block`] if it's a JSON accept type fn render_bcs_block( &self, accept_type: &AcceptType, diff --git a/api/src/events.rs b/api/src/events.rs index 23c099d260ae2..d260cfe73a74a 100644 --- a/api/src/events.rs +++ b/api/src/events.rs @@ -40,8 +40,15 @@ impl EventsApi { &self, accept_type: AcceptType, // TODO: https://github.com/aptos-labs/aptos-core/issues/2278 + /// Event key to retrieve events by event_key: Path, + /// Starting sequence number of events. + /// + /// By default, will retrieve the most recent events start: Query>, + /// Max number of events to retrieve. + /// + /// Mo value defaults to default page size limit: Query>, ) -> BasicResultWith404> { fail_point_poem("endpoint_get_events_by_event_key")?; @@ -73,10 +80,19 @@ impl EventsApi { async fn get_events_by_event_handle( &self, accept_type: AcceptType, + /// Address of account with or without a `0x` prefix address: Path
, + /// Name of struct to lookup event handle e.g. `0x1::account::Account` event_handle: Path, + /// Name of field to lookup event handle e.g. `withdraw_events` field_name: Path, + /// Starting sequence number of events. + /// + /// By default, will retrieve the most recent events start: Query>, + /// Max number of events to retrieve. + /// + /// Mo value defaults to default page size limit: Query>, ) -> BasicResultWith404> { // TODO: Assert that Event represents u64s as strings. @@ -93,6 +109,7 @@ impl EventsApi { } impl EventsApi { + /// List events from an [`EventKey`] fn list( &self, latest_ledger_info: LedgerInfo, diff --git a/api/src/failpoint.rs b/api/src/failpoint.rs index 8ba013f0fc89f..cee20d784f19e 100644 --- a/api/src/failpoint.rs +++ b/api/src/failpoint.rs @@ -8,6 +8,7 @@ use anyhow::{format_err, Result}; use aptos_api_types::AptosErrorCode; use poem_openapi::payload::Json; +/// Build a failpoint to intentionally crash an API for testing #[allow(unused_variables)] #[inline] pub fn fail_point_poem(name: &str) -> Result<(), E> { diff --git a/api/src/index.rs b/api/src/index.rs index ec436ebc4e0bb..80a36b5fe1629 100644 --- a/api/src/index.rs +++ b/api/src/index.rs @@ -10,6 +10,7 @@ use crate::ApiTags; use aptos_api_types::IndexResponse; use poem_openapi::OpenApi; +/// API for the index, to retrieve the ledger information pub struct IndexApi { pub context: Arc, } diff --git a/api/src/lib.rs b/api/src/lib.rs index 389f934bee00d..8d91cbb7e6d3f 100644 --- a/api/src/lib.rs +++ b/api/src/lib.rs @@ -25,9 +25,10 @@ mod state; pub mod tests; mod transactions; +/// API categories for the OpenAPI spec #[derive(Tags)] pub enum ApiTags { - /// Access to account resources and modules + /// Access to accounts, resources, and modules Accounts, /// Access to blocks Blocks, diff --git a/api/src/log.rs b/api/src/log.rs index 9149c399506b0..45d5942611b24 100644 --- a/api/src/log.rs +++ b/api/src/log.rs @@ -76,6 +76,7 @@ pub async fn middleware_log(next: E, request: Request) -> Result( &self, limit: u16, @@ -31,6 +32,7 @@ impl Page { self.start(last_page_start, max, ledger_info) } + /// Retrieve the start of the page pub fn start( &self, default: u64, @@ -51,10 +53,12 @@ impl Page { Ok(start) } + /// Retrieve the start version pub fn start_option(&self) -> Option { self.start } + /// Get the page size for the request pub fn limit(&self, ledger_info: &LedgerInfo) -> Result { let limit = self.limit.unwrap_or(DEFAULT_PAGE_SIZE); if limit == 0 { diff --git a/api/src/response.rs b/api/src/response.rs index b5e353043ab48..ae50b3e028b84 100644 --- a/api/src/response.rs +++ b/api/src/response.rs @@ -40,15 +40,16 @@ use serde_json::Value; use super::bcs_payload::Bcs; +/// An enum representing the different types of outputs for APIs #[derive(ResponseContent)] pub enum AptosResponseContent { - // When returning data as JSON, we take in T and then serialize to JSON as - // part of the response. + /// When returning data as JSON, we take in T and then serialize to JSON as + /// part of the response. Json(Json), - // Return the data as BCS, which is just Vec. This data could have come - // from either an internal Rust type being serialized into bytes, or just - // the bytes directly from storage. + /// Return the data as BCS, which is just Vec. This data could have come + /// from either an internal Rust type being serialized into bytes, or just + /// the bytes directly from storage. Bcs(Bcs), } @@ -127,14 +128,21 @@ macro_rules! generate_error_response { $( #[oai(status = $status)] $name(poem_openapi::payload::Json, - #[oai(header = "X-Aptos-Chain-Id")] Option, // We use just regular u64 here instead of U64 since all header // values are implicitly strings anyway. + /// Chain ID of the current chain + #[oai(header = "X-Aptos-Chain-Id")] Option, + /// Current ledger version of the chain #[oai(header = "X-Aptos-Ledger-Version")] Option, + /// Oldest non-pruned ledger version of the chain #[oai(header = "X-Aptos-Ledger-Oldest-Version")] Option, + /// Current timestamp of the chain #[oai(header = "X-Aptos-Ledger-TimestampUsec")] Option, + /// Current epoch of the chain #[oai(header = "X-Aptos-Epoch")] Option, + /// Current block height of the chain #[oai(header = "X-Aptos-Block-Height")] Option, + /// Oldest non-pruned block height of the chain #[oai(header = "X-Aptos-Oldest-Block-Height")] Option, ), )* @@ -273,15 +281,22 @@ macro_rules! generate_success_response { $( #[oai(status = $status)] $name( - $crate::response::AptosResponseContent, - #[oai(header = "X-Aptos-Chain-Id")] u8, // We use just regular u64 here instead of U64 since all header // values are implicitly strings anyway. + $crate::response::AptosResponseContent, + /// Chain ID of the current chain + #[oai(header = "X-Aptos-Chain-Id")] u8, + /// Current ledger version of the chain #[oai(header = "X-Aptos-Ledger-Version")] u64, + /// Oldest non-pruned ledger version of the chain #[oai(header = "X-Aptos-Ledger-Oldest-Version")] u64, + /// Current timestamp of the chain #[oai(header = "X-Aptos-Ledger-TimestampUsec")] u64, + /// Current epoch of the chain #[oai(header = "X-Aptos-Epoch")] u64, + /// Current block height of the chain #[oai(header = "X-Aptos-Block-Height")] u64, + /// Oldest non-pruned block height of the chain #[oai(header = "X-Aptos-Oldest-Block-Height")] u64, ), )* diff --git a/api/src/runtime.rs b/api/src/runtime.rs index 120651ea656e5..42e0577349025 100644 --- a/api/src/runtime.rs +++ b/api/src/runtime.rs @@ -55,6 +55,7 @@ pub fn bootstrap( // TODO: https://github.com/poem-web/poem/issues/332 // TODO: https://github.com/poem-web/poem/issues/333 +/// Generate the top level API service pub fn get_api_service( context: Arc, ) -> OpenApiService< @@ -130,6 +131,7 @@ pub fn attach_poem_to_runtime( address.set_port(0); } + // Build listener with or without TLS let listener = match (&config.api.tls_cert_path, &config.api.tls_key_path) { (Some(tls_cert_path), Some(tls_key_path)) => { info!("Using TLS for API"); @@ -165,6 +167,8 @@ pub fn attach_poem_to_runtime( let cors = Cors::new() .allow_methods(vec![Method::GET, Method::POST]) .allow_headers(vec![header::CONTENT_TYPE, header::ACCEPT]); + + // Build routes for the API let route = Route::new() .nest( "/v1", diff --git a/api/src/state.rs b/api/src/state.rs index c52a4500a4fb6..5eb7f2333bfcb 100644 --- a/api/src/state.rs +++ b/api/src/state.rs @@ -31,21 +31,20 @@ use poem_openapi::{ use std::{convert::TryInto, sync::Arc}; use storage_interface::state_view::DbStateView; +/// API for retrieving individual state pub struct StateApi { pub context: Arc, } #[OpenApi] impl StateApi { - /// Get specific account resource + /// Get account resource /// - /// This endpoint returns the resource of a specific type residing at a given - /// account at a specified ledger version (AKA transaction version). If the - /// ledger version is not specified in the request, the latest ledger version - /// is used. + /// Retrieves an individual resource from a given account and at a specific ledger version. If the + /// ledger version is not specified in the request, the latest ledger version is used. /// - /// The Aptos nodes prune account state history, via a configurable time window (link). - /// If the requested data has been pruned, the server responds with a 404. + /// The Aptos nodes prune account state history, via a configurable time window. + /// If the requested ledger version has been pruned, the server responds with a 410. #[oai( path = "/accounts/:address/resource/:resource_type", method = "get", @@ -55,8 +54,13 @@ impl StateApi { async fn get_account_resource( &self, accept_type: AcceptType, + /// Address of account with or without a `0x` prefix address: Path
, + /// Name of struct to retrieve e.g. `0x1::account::Account` resource_type: Path, + /// Ledger version to get state of account + /// + /// If not provided, it will be the latest version ledger_version: Query>, ) -> BasicResultWith404 { fail_point_poem("endpoint_get_account_resource")?; @@ -70,15 +74,13 @@ impl StateApi { ) } - /// Get specific account module + /// Get account module /// - /// This endpoint returns the module with a specific name residing at a given - /// account at a specified ledger version (AKA transaction version). If the - /// ledger version is not specified in the request, the latest ledger version - /// is used. + /// Retrieves an individual module from a given account and at a specific ledger version. If the + /// ledger version is not specified in the request, the latest ledger version is used. /// - /// The Aptos nodes prune account state history, via a configurable time window (link). - /// If the requested data has been pruned, the server responds with a 404. + /// The Aptos nodes prune account state history, via a configurable time window. + /// If the requested ledger version has been pruned, the server responds with a 410. #[oai( path = "/accounts/:address/module/:module_name", method = "get", @@ -88,8 +90,13 @@ impl StateApi { async fn get_account_module( &self, accept_type: AcceptType, + /// Address of account with or without a `0x` prefix address: Path
, + /// Name of module to retrieve e.g. `coin` module_name: Path, + /// Ledger version to get state of account + /// + /// If not provided, it will be the latest version ledger_version: Query>, ) -> BasicResultWith404 { fail_point_poem("endpoint_get_account_module")?; @@ -100,13 +107,16 @@ impl StateApi { /// Get table item /// - /// Get a table item from the table identified by {table_handle} in the - /// path and the "key" (TableItemRequest) provided in the request body. + /// Get a table item at a specific ledger version from the table identified by {table_handle} + /// in the path and the "key" (TableItemRequest) provided in the request body. /// /// This is a POST endpoint because the "key" for requesting a specific /// table item (TableItemRequest) could be quite complex, as each of its /// fields could themselves be composed of other structs. This makes it /// impractical to express using query params, meaning GET isn't an option. + /// + /// The Aptos nodes prune account state history, via a configurable time window. + /// If the requested ledger version has been pruned, the server responds with a 410. #[oai( path = "/tables/:table_handle/item", method = "post", @@ -116,8 +126,13 @@ impl StateApi { async fn get_table_item( &self, accept_type: AcceptType, + /// Table handle hex encoded 32-byte string table_handle: Path
, + /// Table request detailing the key type, key, and value type table_item_request: Json, + /// Ledger version to get state of account + /// + /// If not provided, it will be the latest version ledger_version: Query>, ) -> BasicResultWith404 { fail_point_poem("endpoint_get_table_item")?; @@ -133,6 +148,7 @@ impl StateApi { } impl StateApi { + /// Retrieve state at the requested ledger version fn preprocess_request( &self, requested_ledger_version: Option, @@ -151,6 +167,10 @@ impl StateApi { Ok((latest_ledger_info, requested_ledger_version, state_view)) } + /// Read a resource at the ledger version + /// + /// JSON: Convert to MoveResource + /// BCS: Leave it encoded as the resource fn resource( &self, accept_type: &AcceptType, @@ -205,6 +225,10 @@ impl StateApi { } } + /// Retrieve the module + /// + /// JSON: Parse ABI and bytecode + /// BCS: Leave bytecode as is BCS encoded pub fn module( &self, accept_type: &AcceptType, @@ -252,6 +276,7 @@ impl StateApi { } } + /// Retrieve table item for a specific ledger version pub fn table_item( &self, accept_type: &AcceptType, @@ -259,6 +284,7 @@ impl StateApi { table_item_request: TableItemRequest, ledger_version: Option, ) -> BasicResultWith404 { + // Parse the key and value types for the table let key_type = table_item_request .key_type .try_into() @@ -266,6 +292,7 @@ impl StateApi { .map_err(|err| { BasicErrorWith404::bad_request_with_code_no_info(err, AptosErrorCode::InvalidInput) })?; + let key = table_item_request.key; let value_type = table_item_request .value_type .try_into() @@ -273,14 +300,15 @@ impl StateApi { .map_err(|err| { BasicErrorWith404::bad_request_with_code_no_info(err, AptosErrorCode::InvalidInput) })?; - let key = table_item_request.key; + // Retrieve local state let (ledger_info, ledger_version, state_view) = self.preprocess_request(ledger_version.map(|inner| inner.0))?; let resolver = state_view.as_move_resolver(); let converter = resolver.as_converter(self.context.db.clone()); + // Convert key to lookup version for DB let vm_key = converter .try_into_vm_value(&key_type, key.clone()) .map_err(|err| { @@ -298,6 +326,7 @@ impl StateApi { ) })?; + // Retrieve value from the state key let state_key = StateKey::table_item(TableHandle(table_handle.into()), raw_key); let bytes = state_view .get_state_value(&state_key) diff --git a/api/src/transactions.rs b/api/src/transactions.rs index 6783cfe669194..124e661efb852 100644 --- a/api/src/transactions.rs +++ b/api/src/transactions.rs @@ -4,8 +4,6 @@ // Copyright (c) Aptos // SPDX-License-Identifier: Apache-2.0 -use std::sync::Arc; - use crate::accept_type::AcceptType; use crate::accounts::Account; use crate::bcs_payload::Bcs; @@ -26,6 +24,7 @@ use aptos_api_types::{ Transaction, TransactionData, TransactionOnChainData, TransactionsBatchSingleSubmissionFailure, TransactionsBatchSubmissionResult, UserTransaction, U64, }; +use aptos_crypto::hash::CryptoHash; use aptos_crypto::signing_message; use aptos_types::mempool_status::MempoolStatusCode; use aptos_types::transaction::{ @@ -36,6 +35,7 @@ use aptos_vm::AptosVM; use poem_openapi::param::{Path, Query}; use poem_openapi::payload::Json; use poem_openapi::{ApiRequest, OpenApi}; +use std::sync::Arc; generate_success_response!(SubmitTransactionResponse, (202, Accepted)); @@ -95,6 +95,7 @@ pub enum SubmitTransactionsBatchPost { Bcs(Bcs), } +/// API for interacting with transactions pub struct TransactionsApi { pub context: Arc, } @@ -103,8 +104,10 @@ pub struct TransactionsApi { impl TransactionsApi { /// Get transactions /// - /// Get on-chain (meaning, committed) transactions. You may specify from - /// when you want the transactions and how to include in the response. + /// Retrieve on-chain committed transactions. The page size and start can be provided to + /// get a specific sequence of transactions. + /// + /// If the version has been pruned, then a 410 will be returned #[oai( path = "/transactions", method = "get", @@ -114,7 +117,13 @@ impl TransactionsApi { async fn get_transactions( &self, accept_type: AcceptType, + /// Ledger version to start list of transactions + /// + /// If not provided, defaults to showing the latest transactions start: Query>, + /// Max number of transactions to retrieve. + /// + /// If not provided, defaults to default page size limit: Query>, ) -> BasicResultWith404> { fail_point_poem("endpoint_get_transactions")?; @@ -147,6 +156,7 @@ impl TransactionsApi { async fn get_transaction_by_hash( &self, accept_type: AcceptType, + /// Hash of transaction to retrieve txn_hash: Path, // TODO: Use a new request type that can't return 507. ) -> BasicResultWith404 { @@ -159,7 +169,8 @@ impl TransactionsApi { /// Get transaction by version /// - /// todo + /// Retrieves a transaction by a given version. If the version has been pruned, a 410 will + /// be returned. #[oai( path = "/transactions/by_version/:txn_version", method = "get", @@ -169,6 +180,7 @@ impl TransactionsApi { async fn get_transaction_by_version( &self, accept_type: AcceptType, + /// Version of transaction to retrieve txn_version: Path, ) -> BasicResultWith404 { fail_point_poem("endpoint_transaction_by_version")?; @@ -180,7 +192,10 @@ impl TransactionsApi { /// Get account transactions /// - /// todo + /// Retrieves transactions from an account. If the start version is too far in the past + /// a 410 will be returned. + /// + /// If no start version is given, it will start at 0 #[oai( path = "/accounts/:address/transactions", method = "get", @@ -190,8 +205,15 @@ impl TransactionsApi { async fn get_accounts_transactions( &self, accept_type: AcceptType, + /// Address of account with or without a `0x` prefix address: Path
, + /// Ledger version to start list of transactions + /// + /// If not provided, defaults to showing the latest transactions start: Query>, + /// Max number of transactions to retrieve. + /// + /// If not provided, defaults to default page size limit: Query>, ) -> BasicResultWith404> { fail_point_poem("endpoint_get_accounts_transactions")?; @@ -218,6 +240,7 @@ impl TransactionsApi { /// /// To submit a transaction as BCS, you must submit a SignedTransaction /// encoded as BCS. See SignedTransaction in types/src/transaction/mod.rs. + /// Make sure to use the `application/x.aptos.signed_transaction+bcs` Content-Type. // TODO: Point to examples of both of these flows, in multiple languages. #[oai( path = "/transactions", @@ -242,6 +265,28 @@ impl TransactionsApi { .await } + /// Submit batch transactions + /// + /// This allows you to submit multiple transactions. The response has three outcomes: + /// + /// 1. All transactions succeed, and it will return a 202 + /// 2. Some transactions succeed, and it will return the failed transactions and a 206 + /// 3. No transactions succeed, and it will also return the failed transactions and a 206 + /// + /// To submit a transaction as JSON, you must submit a SubmitTransactionRequest. + /// To build this request, do the following: + /// + /// 1. Encode the transaction as BCS. If you are using a language that has + /// native BCS support, make sure to use that library. If not, you may take + /// advantage of /transactions/encode_submission. When using this + /// endpoint, make sure you trust the node you're talking to, as it is + /// possible they could manipulate your request. + /// 2. Sign the encoded transaction and use it to create a TransactionSignature. + /// 3. Submit the request. Make sure to use the "application/json" Content-Type. + /// + /// To submit a transaction as BCS, you must submit a SignedTransaction + /// encoded as BCS. See SignedTransaction in types/src/transaction/mod.rs. + /// Make sure to use the `application/x.aptos.signed_transaction+bcs` Content-Type. #[oai( path = "/transactions/batch", method = "post", @@ -254,6 +299,11 @@ impl TransactionsApi { data: SubmitTransactionsBatchPost, ) -> SubmitTransactionsBatchResult { fail_point_poem("endpoint_submit_batch_transactions")?; + self.context + .check_api_output_enabled("Submit batch transactions", &accept_type)?; + if !self.context.node_config.api.transaction_submission_enabled { + return Err(api_disabled("Submit batch transaction")); + } let ledger_info = self.context.get_latest_ledger_info()?; let signed_transactions_batch = self.get_signed_transactions_batch(&ledger_info, data)?; if self.context.max_submit_transaction_batch_size() < signed_transactions_batch.len() { @@ -273,7 +323,12 @@ impl TransactionsApi { /// Simulate transaction /// - /// Simulate submitting a transaction. To use this, you must: + /// The output of the transaction will have the exact transaction outputs and events that running + /// an actual signed transaction would have. However, it will not have the associated state + /// hashes, as they are not updated in storage. This can be used to estimate the maximum gas + /// units for a submitted transaction. + /// + /// To use this, you must: /// - Create a SignedTransaction with a zero-padded signature. /// - Submit a SubmitTransactionRequest containing a UserTransactionRequest containing that signature. /// @@ -344,6 +399,13 @@ impl TransactionsApi { } /// Estimate gas price + /// + /// Currently, the gas estimation is handled by taking the median of the last 100,000 transactions + /// If a user wants to prioritize their transaction and is willing to pay, they can pay more + /// than the gas price. If they're willing to wait longer, they can pay less. Note that the + /// gas price moves with the fee market, and should only increase when demand outweighs supply. + /// + /// If there have been no transactions in the last 100,000 transactions, the price will be 1. #[oai( path = "/estimate_gas_price", method = "get", @@ -357,6 +419,7 @@ impl TransactionsApi { let latest_ledger_info = self.context.get_latest_ledger_info()?; let estimated_gas_price = self.context.estimate_gas_price(&latest_ledger_info)?; + // TODO: Do we want to give more than just a single gas price? Percentiles? let gas_estimation = GasEstimation { gas_estimate: estimated_gas_price, }; @@ -377,12 +440,12 @@ impl TransactionsApi { } impl TransactionsApi { + /// List all transactions paging by ledger version fn list(&self, accept_type: &AcceptType, page: Page) -> BasicResultWith404> { let latest_ledger_info = self.context.get_latest_ledger_info()?; let ledger_version = latest_ledger_info.version(); let limit = page.limit(&latest_ledger_info)?; - // TODO: https://github.com/aptos-labs/aptos-core/issues/2286 let start_version = page.compute_start(limit, ledger_version, &latest_ledger_info)?; let data = self .context @@ -467,6 +530,7 @@ impl TransactionsApi { .await } + /// Converts a transaction into the outgoing type async fn get_transaction_inner( &self, accept_type: &AcceptType, @@ -515,6 +579,7 @@ impl TransactionsApi { } } + /// Retrieves a transaction by ledger version fn get_by_version( &self, version: u64, @@ -530,10 +595,10 @@ impl TransactionsApi { )) } - // This function looks for the transaction by hash in database and then mempool, - // because the period a transaction stay in the mempool is likely short. - // Although the mempool get transation is async, but looking up txn in database is a sync call, - // thus we keep it simple and call them in sequence. + /// Retrieves a transaction by hash. First the node tries to find the transaction + /// in the DB. If the transaction is found there, it means the transaction is + /// committed. If it is not found there, it looks in mempool. If it is found there, + /// it means the transaction is still pending. async fn get_by_hash( &self, hash: aptos_crypto::HashValue, @@ -552,6 +617,7 @@ impl TransactionsApi { }) } + /// List all transactions for an account fn list_by_account( &self, accept_type: &AcceptType, @@ -584,6 +650,7 @@ impl TransactionsApi { } } + /// Parses a single signed transaction fn get_signed_transaction( &self, ledger_info: &LedgerInfo, @@ -618,6 +685,7 @@ impl TransactionsApi { } } + /// Parses a batch of signed transactions fn get_signed_transactions_batch( &self, ledger_info: &LedgerInfo, @@ -658,6 +726,7 @@ impl TransactionsApi { } } + /// Submits a single transaction, and converts mempool codes to errors async fn create_internal(&self, txn: SignedTransaction) -> Result<(), AptosError> { let (mempool_status, vm_status_opt) = self .context @@ -698,7 +767,6 @@ impl TransactionsApi { mempool_status.message, AptosErrorCode::SequenceNumberTooOld, )), - MempoolStatusCode::InvalidUpdate => Err(AptosError::new_with_error_code( mempool_status.message, AptosErrorCode::InvalidTransactionUpdate, @@ -710,6 +778,7 @@ impl TransactionsApi { } } + /// Submits a single transaction async fn create( &self, accept_type: &AcceptType, @@ -731,6 +800,7 @@ impl TransactionsApi { ) })?; + // We provide the pending transaction so that users have the hash associated let pending_txn = resolver .as_converter(self.context.db.clone()) .try_into_pending_transaction_poem(txn) @@ -746,6 +816,9 @@ impl TransactionsApi { SubmitTransactionResponseStatus::Accepted, )) } + // With BCS, we don't return the pending transaction for efficiency, because there + // is no new information. The hash can be retrieved by hashing the original + // transaction. AcceptType::Bcs => SubmitTransactionResponse::try_from_bcs(( (), ledger_info, @@ -775,12 +848,14 @@ impl TransactionsApi { } } + /// Submits a batch of transactions async fn create_batch( &self, accept_type: &AcceptType, ledger_info: &LedgerInfo, txns: Vec, ) -> SubmitTransactionsBatchResult { + // Iterate through transactions keeping track of failures let mut txn_failures = Vec::new(); for (idx, txn) in txns.iter().enumerate() { if let Err(error) = self.create_internal(txn.clone()).await { @@ -791,9 +866,11 @@ impl TransactionsApi { } } + // Return the possible failures, and have a different success code for partial success let response_status = if txn_failures.is_empty() { SubmitTransactionsBatchResponseStatus::Accepted } else { + // TODO: This should really throw an error if all fail SubmitTransactionsBatchResponseStatus::AcceptedPartial }; @@ -807,17 +884,20 @@ impl TransactionsApi { )) } - // TODO: This returns a Vec, but is it possible for a single - // transaction request to result in multiple executed transactions? // TODO: This function leverages a lot of types from aptos_types, use the // local API types and just return those directly, instead of converting // from these types in render_transactions. + /// Simulate a transaction in the VM + /// + /// Note: this returns a `Vec`, but for backwards compatibility, this can't + /// be removed even though, there is only one possible transaction pub async fn simulate( &self, accept_type: &AcceptType, ledger_info: LedgerInfo, txn: SignedTransaction, ) -> SimulateTransactionResult> { + // Transactions shouldn't have a valid signature or this could be used to attack if txn.signature_is_valid() { return Err(SubmitTransactionError::bad_request_with_code( "Simulated transactions must have a non-valid signature", @@ -825,25 +905,31 @@ impl TransactionsApi { &ledger_info, )); } + + // Simulate transaction let move_resolver = self.context.move_resolver_poem(&ledger_info)?; let (status, output_ext) = AptosVM::simulate_signed_transaction(&txn, &move_resolver); let version = ledger_info.version(); - // Apply deltas. + // Apply transaction outputs to build up a transaction // TODO: while `into_transaction_output_with_status()` should never fail // to apply deltas, we should propagate errors properly. Fix this when // VM error handling is fixed. let output = output_ext.into_transaction_output(&move_resolver); + // Ensure that all known statuses return their values in the output (even if they aren't supposed to) let exe_status = match status.into() { TransactionStatus::Keep(exec_status) => exec_status, TransactionStatus::Discard(status) => ExecutionStatus::MiscellaneousError(Some(status)), _ => ExecutionStatus::MiscellaneousError(None), }; + // Build up a transaction from the outputs + // All state hashes are invalid, and will be filled with 0s + let txn = aptos_types::transaction::Transaction::UserTransaction(txn); let zero_hash = aptos_crypto::HashValue::zero(); let info = aptos_types::transaction::TransactionInfo::new( - zero_hash, + txn.hash(), zero_hash, zero_hash, None, @@ -852,10 +938,10 @@ impl TransactionsApi { ); let simulated_txn = TransactionOnChainData { version, - transaction: aptos_types::transaction::Transaction::UserTransaction(txn), + transaction: txn, info, events: output.events().to_vec(), - accumulator_root_hash: aptos_crypto::HashValue::default(), + accumulator_root_hash: zero_hash, changes: output.write_set().clone(), }; @@ -892,6 +978,7 @@ impl TransactionsApi { } } + /// Encode message as BCS pub fn get_signing_message( &self, accept_type: &AcceptType, diff --git a/api/types/src/account.rs b/api/types/src/account.rs index c399d9c62135c..3e97a54c044e0 100644 --- a/api/types/src/account.rs +++ b/api/types/src/account.rs @@ -7,9 +7,18 @@ use aptos_types::account_config::AccountResource; use poem_openapi::Object; use serde::{Deserialize, Serialize}; +/// Account data +/// +/// A simplified version of the onchain Account resource #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct AccountData { + /// Next sequence number of the account + /// + /// This will be the sequence number of the next transaction committed on this account pub sequence_number: U64, + /// Authentication key + /// + /// A SHA-256 of public keys and authentication scheme of the account pub authentication_key: HexEncodedBytes, } diff --git a/api/types/src/address.rs b/api/types/src/address.rs index 618f230b02214..bb3ffcd15eb85 100644 --- a/api/types/src/address.rs +++ b/api/types/src/address.rs @@ -6,6 +6,10 @@ use move_deps::move_core_types; use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer}; use std::{fmt, str::FromStr}; +/// The address of an account +/// +/// This is represented in a string as a 64 character hex string, sometimes +/// shortened by stripping leading 0s, and adding a 0x. #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct Address(AccountAddress); @@ -17,6 +21,7 @@ impl Address { impl fmt::Display for Address { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + // TODO: This should not be hex literal, it should be the full hex write!(f, "{}", self.0.to_hex_literal()) } } diff --git a/api/types/src/block.rs b/api/types/src/block.rs index 9d6a0be14869b..9f320027da41e 100644 --- a/api/types/src/block.rs +++ b/api/types/src/block.rs @@ -5,24 +5,44 @@ use crate::{HashValue, Transaction, TransactionOnChainData, U64}; use poem_openapi::Object; use serde::{Deserialize, Serialize}; +/// A Block with or without transactions +/// +/// This contains the information about a transactions along with +/// associated transactions if requested #[derive(Debug, Clone, Serialize, Deserialize, Object)] pub struct Block { + /// The block height (number of the block from 0) pub block_height: U64, + /// The block hash pub block_hash: HashValue, + /// The block timestamp in Unix epoch microseconds pub block_timestamp: U64, + /// The first ledger version of the block inclusive pub first_version: U64, + /// The last ledger version of the block inclusive pub last_version: U64, + /// The transactions in the block in sequential order #[serde(skip_serializing_if = "Option::is_none")] pub transactions: Option>, } +/// A Block with or without transactions for encoding in BCS +/// +/// This contains the information about a transactions along with +/// associated transactions if requested #[derive(Debug, Clone, Serialize, Deserialize)] pub struct BcsBlock { + /// The block height (number of the block from 0) pub block_height: u64, + /// The block hash pub block_hash: aptos_crypto::HashValue, + /// The block timestamp in Unix epoch microseconds pub block_timestamp: u64, + /// The first ledger version of the block inclusive pub first_version: u64, + /// The last ledger version of the block inclusive pub last_version: u64, + /// The transactions in the block in sequential order #[serde(skip_serializing_if = "Option::is_none")] pub transactions: Option>, } diff --git a/api/types/src/convert.rs b/api/types/src/convert.rs index c93b0e4b287cd..a522a6d341d58 100644 --- a/api/types/src/convert.rs +++ b/api/types/src/convert.rs @@ -46,6 +46,10 @@ use std::{ }; use storage_interface::DbReader; +/// The Move converter for converting Move types to JSON +/// +/// This reads the underlying BCS types and ABIs to convert them into +/// JSON outputs pub struct MoveConverter<'a, R: ?Sized> { inner: MoveValueAnnotator<'a, R>, db: Arc, diff --git a/api/types/src/derives.rs b/api/types/src/derives.rs index 1b66a83fb6593..5ffc1af1a40d6 100644 --- a/api/types/src/derives.rs +++ b/api/types/src/derives.rs @@ -36,7 +36,14 @@ impl_poem_type!( "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ".to_string() )), format = Some("hex"), - description = Some("Hex encoded 32 byte Aptos account address") + description = Some(indoc! {" + A hex encoded 32 byte Aptos account address. + + This is represented in a string as a 64 character hex string, sometimes + shortened by stripping leading 0s, and adding a 0x. + + For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1. + "}) ) ); @@ -254,7 +261,7 @@ impl_poem_type!( description = Some(indoc! {" A string containing a 64-bit unsigned integer. - We represent u64 values as a string to ensure compatability with languages such + We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively. "}) ) @@ -271,7 +278,7 @@ impl_poem_type!( description = Some(indoc! {" A string containing a 128-bit unsigned integer. - We represent u128 values as a string to ensure compatability with languages such + We represent u128 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively. "}) ) diff --git a/api/types/src/event_key.rs b/api/types/src/event_key.rs index f9a37cedb982b..262a9fe44e109 100644 --- a/api/types/src/event_key.rs +++ b/api/types/src/event_key.rs @@ -4,6 +4,15 @@ use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer}; use std::{fmt, str::FromStr}; +/// Event key is a global index for an event stream. +/// +/// It is hex-encoded BCS bytes of `EventHandle` `guid` field value, which is +/// a combination of a `uint64` creation number and account address (without +/// trimming leading zeros). +/// +/// For example, event key `0x010000000000000088fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` is combined by the following 2 parts: +/// 1. `0100000000000000`: little endian `uint64` representation of `1`. +/// 2. `88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1`: 32 bytes of account address. #[derive(Clone, Debug, PartialEq, Eq, Copy)] pub struct EventKey(pub aptos_types::event::EventKey); diff --git a/api/types/src/hash.rs b/api/types/src/hash.rs index 6ffdcddf89019..74c49b5e2b465 100644 --- a/api/types/src/hash.rs +++ b/api/types/src/hash.rs @@ -8,6 +8,7 @@ use std::{ str::FromStr, }; +/// A hex encoded 32-byte hash value #[derive(Debug, Clone, Copy, Eq, Hash, PartialEq, PartialOrd, Ord)] pub struct HashValue(pub aptos_crypto::hash::HashValue); diff --git a/api/types/src/headers.rs b/api/types/src/headers.rs index 0dbb4c33dfc06..0435f7fe52d79 100644 --- a/api/types/src/headers.rs +++ b/api/types/src/headers.rs @@ -1,10 +1,17 @@ // Copyright (c) Aptos // SPDX-License-Identifier: Apache-2.0 +/// Chain ID of the current chain pub const X_APTOS_CHAIN_ID: &str = "X-Aptos-Chain-Id"; +/// Current epoch of the chain pub const X_APTOS_EPOCH: &str = "X-Aptos-Epoch"; +/// Current ledger version of the chain pub const X_APTOS_LEDGER_VERSION: &str = "X-Aptos-Ledger-Version"; +/// Oldest non-pruned ledger version of the chain pub const X_APTOS_LEDGER_OLDEST_VERSION: &str = "X-Aptos-Ledger-Oldest-Version"; +/// Current block height of the chain pub const X_APTOS_BLOCK_HEIGHT: &str = "X-Aptos-Block-Height"; +/// Oldest non-pruned block height of the chain pub const X_APTOS_OLDEST_BLOCK_HEIGHT: &str = "X-Aptos-Oldest-Block-Height"; +/// Current timestamp of the chain pub const X_APTOS_LEDGER_TIMESTAMP: &str = "X-Aptos-Ledger-TimestampUsec"; diff --git a/api/types/src/index.rs b/api/types/src/index.rs index f6ba91d58f4e5..f38a9d54f4fb8 100644 --- a/api/types/src/index.rs +++ b/api/types/src/index.rs @@ -13,13 +13,21 @@ use serde::{Deserialize, Serialize}; /// index endpoint (i.e., GET "/"). #[derive(Clone, Debug, Deserialize, PartialEq, Eq, PoemObject, Serialize)] pub struct IndexResponse { + /// Chain ID of the current chain pub chain_id: u8, + /// Current epoch of the chain pub epoch: U64, + /// Current ledger version of the chain pub ledger_version: U64, + /// Oldest non-pruned ledger version of the chain pub oldest_ledger_version: U64, + /// Current timestamp of the chain pub ledger_timestamp: U64, + /// Role of the node `Validator` or `FullNode` pub node_role: RoleType, + /// Oldest non-pruned block height of the chain pub oldest_block_height: U64, + /// Current block height of the chain pub block_height: U64, } diff --git a/api/types/src/ledger_info.rs b/api/types/src/ledger_info.rs index 8fc00b6b3cf92..15dcae60508c9 100644 --- a/api/types/src/ledger_info.rs +++ b/api/types/src/ledger_info.rs @@ -8,14 +8,22 @@ use poem_openapi::Object as PoemObject; use serde::{Deserialize, Serialize}; +/// The Ledger information representing the current state of the chain #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, PoemObject)] pub struct LedgerInfo { + /// Chain ID of the current chain pub chain_id: u8, + /// Current epoch of the chain pub epoch: U64, + /// Current ledger version of the chain pub ledger_version: U64, + /// Oldest non-pruned ledger version of the chain pub oldest_ledger_version: U64, + /// Current block height of the chain pub block_height: U64, + /// Oldest non-pruned block height of the chain pub oldest_block_height: U64, + /// Current timestamp of the chain pub ledger_timestamp: U64, } diff --git a/api/types/src/mime_types.rs b/api/types/src/mime_types.rs index c087c55467a64..fc1dea6cdf66a 100644 --- a/api/types/src/mime_types.rs +++ b/api/types/src/mime_types.rs @@ -1,6 +1,11 @@ // Copyright (c) Aptos // SPDX-License-Identifier: Apache-2.0 +/// MIME type to submit BCS transactions pub const BCS_SIGNED_TRANSACTION: &str = "application/x.aptos.signed_transaction+bcs"; + +/// MIME type to submit JSON transactions and get JSON output pub const JSON: &str = "application/json"; + +/// MIME type to get BCS output pub const BCS: &str = "application/x-bcs"; diff --git a/api/types/src/move_types.rs b/api/types/src/move_types.rs index 51cc958f0508a..dca4d46734b9e 100644 --- a/api/types/src/move_types.rs +++ b/api/types/src/move_types.rs @@ -32,11 +32,14 @@ use std::{ str::FromStr, }; +/// A parsed Move resource #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct MoveResource { + /// The Move struct tag e.g. 0x1::account::Account #[serde(rename = "type")] #[oai(rename = "type")] pub typ: MoveStructTag, + /// The JSON struct data converted from the Move resource pub data: MoveStructValue, } @@ -51,6 +54,9 @@ impl TryFrom for MoveResource { } } +/// A string encoded U64 +/// +/// Encoded as a string to encode into JSON #[derive(Clone, Debug, Default, Eq, PartialEq, Copy)] pub struct U64(pub u64); @@ -112,6 +118,9 @@ impl FromStr for U64 { } } +/// A string encoded U128 +/// +/// Encoded as a string to encode into JSON #[derive(Clone, Debug, Default, PartialEq, Eq, Copy)] pub struct U128(pub u128); @@ -169,6 +178,7 @@ impl FromStr for U128 { } } +/// Hex encoded bytes to allow for having bytes represented in JSON #[derive(Clone, Debug, PartialEq, Eq)] pub struct HexEncodedBytes(pub Vec); @@ -255,6 +265,7 @@ impl HexEncodedBytes { } } +/// A JSON map representation of a Move struct's inner types #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct MoveStructValue(pub BTreeMap); @@ -269,16 +280,26 @@ impl TryFrom for MoveStructValue { } } +/// An enum of the possible Move value types #[derive(Clone, Debug, PartialEq, Union)] pub enum MoveValue { + /// A u8 Move type U8(u8), + /// A u64 Move type U64(U64), + /// A u128 Move type U128(U128), + /// A bool Move type Bool(bool), + /// A 32-byte address Move type Address(Address), + /// A vector Move type. May have any other [`MoveValue`] nested inside it Vector(Vec), + /// A bytes Move type, hex encoded Bytes(HexEncodedBytes), + /// A struct Move type, with a map of fields inside it Struct(MoveStructValue), + /// A string Move type String(String), } @@ -358,11 +379,16 @@ impl Serialize for MoveValue { } } +/// A Move struct tag for referencing an onchain struct type #[derive(Clone, Debug, PartialEq, Eq)] pub struct MoveStructTag { + /// The address of the struct's module pub address: Address, + /// The module name containing the struct pub module: IdentifierWrapper, + /// The name of the struct pub name: IdentifierWrapper, + /// Generic type parameters associated with the struct pub generic_type_params: Vec, } @@ -448,18 +474,33 @@ impl TryFrom for StructTag { } } +/// An enum of Move's possible types on-chain #[derive(Clone, Debug, PartialEq, Eq)] pub enum MoveType { + /// A bool type Bool, + /// An 8-bit unsigned int U8, + /// A 64-bit unsigned int U64, + /// A 128-bit unsigned int U128, + /// A 32-byte account address Address, + /// An account signer Signer, + /// A Vector of [`MoveType`] Vector { items: Box }, + /// A struct of [`MoveStructTag`] Struct(MoveStructTag), + /// A generic type param with index GenericTypeParam { index: u16 }, + /// A reference Reference { mutable: bool, to: Box }, + /// A move type that couldn't be parsed + /// + /// This prevents the parser from just throwing an error because one field + /// was unparsable, and gives the value in it. Unparsable(String), } @@ -618,12 +659,18 @@ impl TryFrom for TypeTag { } } +/// A Move module #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct MoveModule { + /// Address of the move module pub address: Address, + /// Name of the module pub name: IdentifierWrapper, + /// Friends of the module pub friends: Vec, + /// Public functions of the module pub exposed_functions: Vec, + /// Structs of the module pub structs: Vec, } @@ -656,9 +703,12 @@ impl From for MoveModule { } } +/// A Move module Id #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct MoveModuleId { + /// Address of the module pub address: Address, + /// Name of the module pub name: IdentifierWrapper, } @@ -719,15 +769,22 @@ impl<'de> Deserialize<'de> for MoveModuleId { } } +/// A move struct #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct MoveStruct { + /// Name of the struct pub name: IdentifierWrapper, + /// Whether the struct is a native struct of Move pub is_native: bool, + /// Abilities associated with the struct pub abilities: Vec, + /// Generic types associated with the struct pub generic_type_params: Vec, + /// Fields associated with the struct pub fields: Vec, } +/// A move ability e.g. drop, store // TODO: Consider finding a way to derive NewType here instead of using the // custom macro, since some of the enum type information (such as the // variants) is currently being lost. @@ -788,9 +845,12 @@ impl<'de> Deserialize<'de> for MoveAbility { } } +/// Move generic type param #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct MoveStructGenericTypeParam { + /// Move abilities tied to the generic type param and associated with the type that uses it pub constraints: Vec, + /// Whether the type is a phantom type #[oai(skip)] pub is_phantom: bool, } @@ -808,21 +868,31 @@ impl From<&StructTypeParameter> for MoveStructGenericTypeParam { } } +/// Move struct field #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct MoveStructField { + /// Name of the field pub name: IdentifierWrapper, + /// The move type associated with the field. e.g. bool #[serde(rename = "type")] #[oai(rename = "type")] pub typ: MoveType, } +/// Move function #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct MoveFunction { + /// Name of the function pub name: IdentifierWrapper, + /// Visibility of the function e.g. public pub visibility: MoveFunctionVisibility, + /// Whether the function can be called as an entry function directly in a transaction pub is_entry: bool, + /// Generic type params associated with the Move function pub generic_type_params: Vec, + /// Parameters associated with the move function pub params: Vec, + /// Return type of the function #[serde(rename = "return")] #[oai(rename = "return")] pub return_: Vec, @@ -850,12 +920,16 @@ impl From<&CompiledScript> for MoveFunction { } } +/// Move function visibility #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Enum)] #[serde(rename_all = "snake_case")] #[oai(rename_all = "snake_case")] pub enum MoveFunctionVisibility { + /// Visible only by this module Private, + /// Visible by all modules Public, + /// Visible by friend modules Friend, } @@ -879,8 +953,10 @@ impl From for Visibility { } } +/// Move function generic type param #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct MoveFunctionGenericTypeParam { + /// Move abilities tied to the generic type param and associated with the function that uses it pub constraints: Vec, } @@ -892,9 +968,12 @@ impl From<&AbilitySet> for MoveFunctionGenericTypeParam { } } +/// Move module bytecode along with it's ABI #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct MoveModuleBytecode { + /// Hex encoded bytecode of the module pub bytecode: HexEncodedBytes, + /// ABI of the module // We don't need deserialize MoveModule as it should be serialized // from `bytecode`. #[serde(skip_deserializing)] @@ -928,9 +1007,12 @@ impl From for MoveModuleBytecode { } } +/// Move script bytecode #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct MoveScriptBytecode { + /// Hex encoded bytecode of the script pub bytecode: HexEncodedBytes, + /// ABI of the script // We don't need deserialize MoveModule as it should be serialized // from `bytecode`. #[serde(skip_deserializing)] @@ -958,9 +1040,12 @@ impl MoveScriptBytecode { } } +/// Entry function id #[derive(Clone, Debug, PartialEq, Eq)] pub struct EntryFunctionId { + /// Module Id e.g. 0x1::address pub module: MoveModuleId, + /// Function name pub name: IdentifierWrapper, } diff --git a/api/types/src/table.rs b/api/types/src/table.rs index 7f689b7fd4d00..bf7e62ac5c631 100644 --- a/api/types/src/table.rs +++ b/api/types/src/table.rs @@ -6,9 +6,13 @@ use poem_openapi::Object; use serde::{Deserialize, Serialize}; use serde_json::Value; +/// Table Item request for the GetTableItem API #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct TableItemRequest { + /// The [`MoveType`] of the table item's key pub key_type: MoveType, + /// The [`MoveType`] of the table item's value pub value_type: MoveType, + /// The value of the table item's key pub key: Value, } diff --git a/api/types/src/transaction.rs b/api/types/src/transaction.rs index f54092fba7ec9..1fb70b54a0b0d 100755 --- a/api/types/src/transaction.rs +++ b/api/types/src/transaction.rs @@ -34,9 +34,16 @@ use std::{ // TODO: Investigate the use of discriminator_name, see https://github.com/poem-web/poem/issues/329. // TODO: See https://github.com/poem-web/poem/issues/347 re mapping stuff. UPDATE: Wait for 2.0.7 to be released. +/// Transaction data +/// +/// This is a combination enum of an onchain transaction and a pending transaction. +/// When the transaction is still in mempool, it will be pending. If it's been committed to the +/// chain, it will show up as OnChain. #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] pub enum TransactionData { + /// A committed transaction OnChain(TransactionOnChainData), + /// A transaction currently sitting in mempool Pending(Box), } @@ -52,13 +59,22 @@ impl From for TransactionData { } } +/// A committed transaction +/// +/// This is a representation of the onchain payload, outputs, events, and proof of a transaction. #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] pub struct TransactionOnChainData { + /// The ledger version of the transaction pub version: u64, + /// The transaction submitted pub transaction: aptos_types::transaction::Transaction, + /// Information about the transaction pub info: aptos_types::transaction::TransactionInfo, + /// Events emitted by the transaction pub events: Vec, + /// The accumulator root hash at this version pub accumulator_root_hash: aptos_crypto::HashValue, + /// Final state of resources changed by the transaction pub changes: aptos_types::write_set::WriteSet, } @@ -131,14 +147,20 @@ impl } } +/// Enum of the different types of transactions in Aptos #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Union)] #[serde(tag = "type", rename_all = "snake_case")] #[oai(one_of, discriminator_name = "type", rename_all = "snake_case")] pub enum Transaction { + /// A transaction currently in mempool and not committed PendingTransaction(PendingTransaction), + /// A transaction submitted by a user UserTransaction(Box), + /// A genesis writeset transaction GenesisTransaction(GenesisTransaction), + /// A block metadata transaction, signifying the beginning of a block BlockMetadataTransaction(BlockMetadataTransaction), + /// A state checkpoint transaction StateCheckpointTransaction(StateCheckpointTransaction), } @@ -287,23 +309,39 @@ impl From<(&SignedTransaction, TransactionPayload)> for UserTransactionRequest { } } +/// Information related to how a transaction affected the state of the blockchain #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct TransactionInfo { + /// Ledger version of the transaction pub version: U64, + /// Hash of the transaction pub hash: HashValue, + /// Hash of the state changes pub state_change_hash: HashValue, + /// Hash of the event changes pub event_root_hash: HashValue, + /// Hash of the state checkpoint (if it is a state checkpoint) pub state_checkpoint_hash: Option, + /// Total gas units used + /// + /// Total gas units used can be multiplied by gas price to get the total coins paid pub gas_used: U64, + /// Whether the transaction was successful pub success: bool, + /// The VM status of the transaction, can tell useful information in a failure pub vm_status: String, + /// The accumulator root hash pub accumulator_root_hash: HashValue, + /// Final state of resources changed by the transaction pub changes: Vec, } +/// A transaction waiting in mempool #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct PendingTransaction { + /// The transaction hash pub hash: HashValue, + /// The transaction payload #[serde(flatten)] #[oai(flatten)] pub request: UserTransactionRequest, @@ -318,6 +356,7 @@ impl From<(SignedTransaction, TransactionPayload)> for PendingTransaction { } } +/// A transaction submitted by a user to change the state of the blockchain #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct UserTransaction { #[serde(flatten)] @@ -326,112 +365,163 @@ pub struct UserTransaction { #[serde(flatten)] #[oai(flatten)] pub request: UserTransactionRequest, + /// Events generated by the transaction pub events: Vec, + /// Timestamp of the transaction's block pub timestamp: U64, } +/// A state checkpoint transaction #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct StateCheckpointTransaction { #[serde(flatten)] #[oai(flatten)] pub info: TransactionInfo, + /// Timestamp of the transaction's block pub timestamp: U64, } +/// A request to submit a transaction +/// +/// This requires a transaction and a signature of it #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct SubmitTransactionRequest { #[serde(flatten)] #[oai(flatten)] pub user_transaction_request: UserTransactionRequestInner, - + /// Signature of the request pub signature: TransactionSignature, } +/// Batch transaction submission result +/// +/// Tells which transactions failed #[derive(Debug, Serialize, Deserialize, Object)] pub struct TransactionsBatchSubmissionResult { + /// Summary of the failed transactions pub transaction_failures: Vec, } +/// Information telling which batch submission transactions failed #[derive(Debug, Serialize, Deserialize, Object)] pub struct TransactionsBatchSingleSubmissionFailure { + /// The error from submitting the transaction pub error: AptosError, + /// The index of which transaction failed, same as submission order pub transaction_index: usize, } // TODO: Rename this to remove the Inner when we cut over. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct UserTransactionRequestInner { + /// Sender account address pub sender: Address, + /// Sequence number of the sender for this transaction pub sequence_number: U64, + /// Max gas units allowed for this transaction pub max_gas_amount: U64, + /// Gas unit price used for this transaction pub gas_unit_price: U64, + /// Expiration timestamp in seconds from the UNIX epoch pub expiration_timestamp_secs: U64, + /// The payload of the transaction pub payload: TransactionPayload, } // TODO: Remove this when we cut over. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct UserTransactionRequest { + /// Sender account address pub sender: Address, + /// Sequence number of the sender for this transaction pub sequence_number: U64, + /// Max gas units allowed for this transaction pub max_gas_amount: U64, + /// Gas unit price used for this transaction pub gas_unit_price: U64, + /// Expiration timestamp in seconds from the UNIX epoch pub expiration_timestamp_secs: U64, + /// The payload of the transaction pub payload: TransactionPayload, + /// Signature of the transaction #[serde(skip_serializing_if = "Option::is_none")] pub signature: Option, } +/// Request to create signing messages #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct UserCreateSigningMessageRequest { #[serde(flatten)] #[oai(flatten)] pub transaction: UserTransactionRequest, + /// Secondary signer accounts of the request for Multi-agent #[serde(skip_serializing_if = "Option::is_none")] pub secondary_signers: Option>, } +/// Request to encode a submission #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct EncodeSubmissionRequest { #[serde(flatten)] #[oai(flatten)] pub transaction: UserTransactionRequestInner, + /// Secondary signer accounts of the request for Multi-agent #[serde(skip_serializing_if = "Option::is_none")] pub secondary_signers: Option>, } +/// The genesis transaction +/// +/// This only occurs at the genesis transaction (version 0) #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct GenesisTransaction { #[serde(flatten)] #[oai(flatten)] pub info: TransactionInfo, + /// The genesis transaction payload pub payload: GenesisPayload, + /// Events emitted during genesis pub events: Vec, } +/// A block metadata transaction +/// +/// This signifies the beginning of a block, and contains information +/// about the specific block #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct BlockMetadataTransaction { #[serde(flatten)] #[oai(flatten)] pub info: TransactionInfo, + /// The block hash pub id: HashValue, + /// The block epoch pub epoch: U64, + /// The block epoch round pub round: U64, + /// The events emitted at the block creation pub events: Vec, + /// Previous block votes pub previous_block_votes_bitvec: Vec, + /// The address of the proposer of the block pub proposer: Address, + /// The indices of the proposers who failed to propose pub failed_proposer_indices: Vec, + /// The timestamp of the block in microseconds from the UNIX epoch pub timestamp: U64, } +/// An event from a transaction #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct Event { pub key: EventKey, + /// The sequence number of the event pub sequence_number: U64, + /// The [`MoveType`] of the event #[serde(rename = "type")] #[oai(rename = "type")] pub typ: MoveType, - // TODO: Use the real data here, not a JSON representation. + /// The JSON representation of the event pub data: serde_json::Value, } @@ -448,15 +538,19 @@ impl From<(&ContractEvent, serde_json::Value)> for Event { } } +/// An event from a transaction with a version #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct VersionedEvent { + /// The version that the event was emitted pub version: U64, pub key: EventKey, + /// The sequence number of the event pub sequence_number: U64, + /// The [`MoveType`] of the event #[serde(rename = "type")] #[oai(rename = "type")] pub typ: MoveType, - // TODO: Use the real data here, not a JSON representation. + /// The JSON representation of the event pub data: serde_json::Value, } @@ -474,18 +568,23 @@ impl From<(&EventWithVersion, serde_json::Value)> for VersionedEvent { } } +/// The writeset payload of the Genesis transaction #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Union)] #[serde(tag = "type", rename_all = "snake_case")] #[oai(one_of, discriminator_name = "type", rename_all = "snake_case")] pub enum GenesisPayload { + /// The write set payload of Genesis WriteSetPayload(WriteSetPayload), } +/// An enum of the possible transaction payloads #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Union)] #[serde(tag = "type", rename_all = "snake_case")] #[oai(one_of, discriminator_name = "type", rename_all = "snake_case")] pub enum TransactionPayload { + /// Payload which runs a single entry function EntryFunctionPayload(EntryFunctionPayload), + /// Payload which runs a script that can run multiple functions ScriptPayload(ScriptPayload), ModuleBundlePayload(ModuleBundlePayload), } @@ -495,19 +594,25 @@ pub struct ModuleBundlePayload { pub modules: Vec, } +/// Payload which runs a single entry function #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct EntryFunctionPayload { + /// Id of the function to be run e.g. 0x1::account::transfer pub function: EntryFunctionId, + /// Type arguments of the function pub type_arguments: Vec, - // TODO: Use the real data here, not a JSON representation. + /// Arguments of the function pub arguments: Vec, } +/// Payload which runs a script that can run multiple functions #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)] pub struct ScriptPayload { + /// Bytecode of the script pub code: MoveScriptBytecode, + /// Type arguments of the function pub type_arguments: Vec, - // TODO: Use the real data here, not a JSON representation. + /// Arguments of the function pub arguments: Vec, } @@ -527,11 +632,13 @@ impl TryFrom