hirosystems / stacks-blockchain-api

API for the Stacks blockchain
https://stacks-blockchain-api.vercel.app
GNU General Public License v3.0
170 stars 108 forks source link

feat: add average stacks block time to burn block endpoints #1963

Closed zone117x closed 2 months ago

zone117x commented 2 months ago

Closes https://github.com/hirosystems/stacks-blockchain-api/issues/1919

Adds average stacks block time to burn block endpoints.

Examples:

GET /extended/v2/burn-blocks/latest

{
  "burn_block_time": 1594233639,
  "burn_block_time_iso": "2020-08-27T16:41:26.000Z",
  "burn_block_hash": "0xb154c008df2101023a6d0d54986b3964cee58119eed14f5bed98e15678e18fe2",
  "burn_block_height": 654439,
  "stacks_blocks": [
    "0x54647c277eefe60519b407f2c897749005fdb7f831034135063b2ee43fdacb04",
    "0xdaf61d2b355f35c94cf019af99aeb73d8e7db7301c7cd693a464ebd1cfc2228c",
    "0xb9e9b308cf9621ecbf66ca7b4689fe384b9b67c4588ec827d8163ab602fb935e",
    "0x754562cba6ec243f90485e97778ab472f462fd123ef5b83cc79d8759ca8875f5"
  ],
  "avg_block_time": 15.3
}

GET /extended/v2/burn-blocks

{
  "limit": 1,
  "offset": 0,
  "total": 21707,
  "results": [
    {
      "burn_block_time": 1626281749,
      "burn_block_time_iso": "2021-07-14T16:55:49.000Z",
      "burn_block_hash": "0x0000000000000000000ea16f8e906e85ee1cb4dff1e5424e93843b3cec8b0bcb",
      "burn_block_height": 691014,
      "stacks_blocks": [
        "0x54647c277eefe60519b407f2c897749005fdb7f831034135063b2ee43fdacb04",
        "0xdaf61d2b355f35c94cf019af99aeb73d8e7db7301c7cd693a464ebd1cfc2228c",
        "0xb9e9b308cf9621ecbf66ca7b4689fe384b9b67c4588ec827d8163ab602fb935e",
        "0x754562cba6ec243f90485e97778ab472f462fd123ef5b83cc79d8759ca8875f5"
      ],
      "avg_block_time": 15.3
    }
  ]
}
github-actions[bot] commented 2 months ago

Vercel deployment URL: https://stacks-blockchain-j339r6jqb-blockstack.vercel.app :rocket:

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 17.96%. Comparing base (20097fc) to head (54efbf6). Report is 233 commits behind head on develop.

Files Patch % Lines
src/api/routes/v2/helpers.ts 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1963 +/- ## ============================================ - Coverage 76.82% 17.96% -58.86% ============================================ Files 80 94 +14 Lines 11515 12571 +1056 Branches 2575 2931 +356 ============================================ - Hits 8846 2259 -6587 - Misses 2540 9530 +6990 - Partials 129 782 +653 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

blockstack-devops commented 2 months ago

:tada: This PR is included in version 7.11.0-beta.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

blockstack-devops commented 4 weeks ago

:tada: This PR is included in version 7.11.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: