Skip to content

Commit

Permalink
Clarify which endpoints return committed / pending transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Clay Murphy authored and banool committed Nov 16, 2022
1 parent c3a3469 commit 83f4b22
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test-api-spec-v1:
$(call test_api_spec,spec.yaml)

serve:
cd doc && python -m http.server 8888
cd doc && python3 -m http.server 8888

define test_api_spec
- pkill aptos-node
Expand Down
4 changes: 2 additions & 2 deletions api/doc/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"Accounts"
],
"summary": "Get account",
"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",
"description": "Return the authentication key and the sequence number for an account\naddress. Optionally, a ledger version can be specified. If the ledger\nversion is not specified in the request, the latest ledger version is used.",
"parameters": [
{
"name": "address",
Expand Down Expand Up @@ -6200,7 +6200,7 @@
"Transactions"
],
"summary": "Get transactions",
"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",
"description": "Retrieve on-chain committed transactions. The page size and start ledger version\ncan be provided to get a specific sequence of transactions.\n\nIf the version has been pruned, then a 410 will be returned.\n\nTo retrieve a pending transaction, use /transactions/by_hash.",
"parameters": [
{
"name": "start",
Expand Down
15 changes: 8 additions & 7 deletions api/doc/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ paths:
- Accounts
summary: Get account
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
Return the authentication key and the sequence number for an account
address. Optionally, a ledger version can be specified. If the ledger
version is not specified in the request, the latest ledger version is used.
parameters:
- name: address
schema:
Expand Down Expand Up @@ -4639,10 +4638,12 @@ paths:
- Transactions
summary: Get transactions
description: |-
Retrieve on-chain committed transactions. The page size and start can be provided to
get a specific sequence of transactions.
Retrieve on-chain committed transactions. The page size and start ledger version
can be provided to get a specific sequence of transactions.
If the version has been pruned, then a 410 will be returned.
If the version has been pruned, then a 410 will be returned
To retrieve a pending transaction, use /transactions/by_hash.
parameters:
- name: start
schema:
Expand Down
7 changes: 3 additions & 4 deletions api/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ pub struct AccountsApi {
impl AccountsApi {
/// Get account
///
/// Retrieves high level information about an account such as its sequence number and
/// authentication key
///
/// Returns a 404 if the account doesn't exist
/// Return the authentication key and the sequence number for an account
/// address. Optionally, a ledger version can be specified. If the ledger
/// version is not specified in the request, the latest ledger version is used.
#[oai(
path = "/accounts/:address",
method = "get",
Expand Down
8 changes: 5 additions & 3 deletions api/src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,12 @@ pub struct TransactionsApi {
impl TransactionsApi {
/// Get transactions
///
/// Retrieve on-chain committed transactions. The page size and start can be provided to
/// get a specific sequence of transactions.
/// Retrieve on-chain committed transactions. The page size and start ledger version
/// can be provided to get a specific sequence of transactions.
///
/// If the version has been pruned, then a 410 will be returned
/// If the version has been pruned, then a 410 will be returned.
///
/// To retrieve a pending transaction, use /transactions/by_hash.
#[oai(
path = "/transactions",
method = "get",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ export class AccountsService {

/**
* Get account
* Retrieves high level information about an account such as its sequence number and
* authentication key
*
* Returns a 404 if the account doesn't exist
* Return the authentication key and the sequence number for an account
* address. Optionally, a ledger version can be specified. If the ledger
* version is not specified in the request, the latest ledger version is used.
* @param address Address of account with or without a `0x` prefix
* @param ledgerVersion Ledger version to get state of account
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ export class TransactionsService {

/**
* Get transactions
* Retrieve on-chain committed transactions. The page size and start can be provided to
* get a specific sequence of transactions.
* Retrieve on-chain committed transactions. The page size and start ledger version
* can be provided to get a specific sequence of transactions.
*
* If the version has been pruned, then a 410 will be returned
* If the version has been pruned, then a 410 will be returned.
*
* To retrieve a pending transaction, use /transactions/by_hash.
* @param start Ledger version to start list of transactions
*
* If not provided, defaults to showing the latest transactions
Expand Down

0 comments on commit 83f4b22

Please sign in to comment.