Skip to content

Commit 329a198

Browse files
authored
Merge pull request #2065 from hirosystems/beta
release v8.0.0 to master
2 parents 24c554b + be5a889 commit 329a198

File tree

707 files changed

+50282
-72094
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

707 files changed

+50282
-72094
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ src/tests-bns/
1616
client/src/
1717
config/
1818
utils/src/
19+
client*

.github/workflows/ci.yml

-116
Original file line numberDiff line numberDiff line change
@@ -52,56 +52,6 @@ jobs:
5252
- name: Lint Unused Exports
5353
run: npm run lint:unused-exports
5454

55-
lint-docs:
56-
runs-on: ubuntu-latest
57-
defaults:
58-
run:
59-
working-directory: ./docs
60-
steps:
61-
- uses: actions/checkout@v3
62-
with:
63-
fetch-depth: 0
64-
65-
- name: Use Node.js
66-
uses: actions/setup-node@v4
67-
with:
68-
node-version-file: ".nvmrc"
69-
70-
- name: Cache node modules
71-
uses: actions/cache@v3
72-
env:
73-
cache-name: cache-node-modules
74-
with:
75-
path: |
76-
~/.npm
77-
**/node_modules
78-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
79-
restore-keys: |
80-
${{ runner.os }}-build-${{ env.cache-name }}-
81-
${{ runner.os }}-build-
82-
${{ runner.os }}-
83-
84-
- name: Install deps
85-
run: npm ci --audit=false
86-
87-
- name: Build schema & docs
88-
run: npm run build
89-
90-
- name: Validate generated types
91-
run: tsc index.d.ts
92-
93-
- name: Lint JSON
94-
run: npm run lint:json
95-
96-
- name: Lint YAML
97-
run: npm run lint:yaml
98-
99-
- name: Lint OpenAPI
100-
run: npm run lint:openapi
101-
102-
- name: Validate schemas
103-
run: npm run validate:schemas
104-
10555
test:
10656
runs-on: ubuntu-latest
10757
steps:
@@ -133,10 +83,6 @@ jobs:
13383
working-directory: client
13484
run: npm ci --audit=false
13585

136-
- name: Install docs deps
137-
working-directory: docs
138-
run: npm ci --audit=false
139-
14086
- name: Setup env vars
14187
run: echo "STACKS_CORE_EVENT_HOST=http://0.0.0.0" >> $GITHUB_ENV
14288

@@ -415,68 +361,6 @@ jobs:
415361
flag-name: run-${{ github.job }}
416362
parallel: true
417363

418-
test-subnets:
419-
if: false
420-
runs-on: ubuntu-latest
421-
steps:
422-
- uses: actions/checkout@v3
423-
424-
- name: Use Node.js
425-
uses: actions/setup-node@v4
426-
with:
427-
node-version-file: '.nvmrc'
428-
429-
- name: Cache node modules
430-
uses: actions/cache@v3
431-
env:
432-
cache-name: cache-node-modules
433-
with:
434-
path: |
435-
~/.npm
436-
**/node_modules
437-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
438-
restore-keys: |
439-
${{ runner.os }}-build-${{ env.cache-name }}-
440-
${{ runner.os }}-build-
441-
${{ runner.os }}-
442-
443-
- name: Install deps
444-
run: npm ci --audit=false
445-
446-
- name: Setup env vars
447-
run: echo "STACKS_CORE_EVENT_HOST=http://0.0.0.0" >> $GITHUB_ENV
448-
449-
- name: Setup integration environment
450-
run: |
451-
sudo ufw disable
452-
npm run devenv:deploy:subnets -- -d
453-
npm run devenv:logs:subnets -- --no-color &> docker-compose-logs.txt &
454-
455-
- name: Run tests
456-
run: npm run test:subnets
457-
458-
- name: Print integration environment logs
459-
run: cat docker-compose-logs.txt
460-
if: failure()
461-
462-
- name: Teardown integration environment
463-
run: npm run devenv:stop:subnets
464-
if: always()
465-
466-
- name: Upload coverage to Codecov
467-
uses: codecov/codecov-action@v4
468-
with:
469-
token: ${{ secrets.CODECOV_TOKEN }}
470-
if: always()
471-
472-
- name: Upload coverage to Coveralls
473-
uses: coverallsapp/github-action@master
474-
if: always()
475-
with:
476-
github-token: ${{ secrets.github_token }}
477-
flag-name: run-${{ github.job }}
478-
parallel: true
479-
480364
test-bns-e2e:
481365
runs-on: ubuntu-latest
482366
steps:

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,7 @@ yarn.lock
129129
#rosetta-cli results
130130
rosetta-output-construction/rosetta-cli-output-const.json
131131
rosetta-output/rosetta-cli-output.json
132+
133+
# doc schema
134+
docs/openapi.json
135+
docs/openapi.yaml

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ src/tests-rosetta/
44
src/tests-rosetta-cli/
55
src/tests-bns/
66
src/tests/synthetic-tx-payloads/
7+
src/rosetta/json-schemas/

.proxy-cache-control.json

-11
This file was deleted.

.releaserc

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
[
2929
"@semantic-release/exec",
3030
{
31-
"execCwd": "client",
3231
"prepareCmd": "npm ci"
3332
}
3433
],
3534
[
36-
"@semantic-release/npm",
35+
"@semantic-release/exec",
3736
{
38-
"pkgRoot": "./docs"
37+
"execCwd": "client",
38+
"prepareCmd": "npm ci"
3939
}
4040
],
4141
[

.vscode/launch.json

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"args": ["${workspaceFolder}/src/index.ts"],
2323
"outputCapture": "std",
2424
"internalConsoleOptions": "openOnSessionStart",
25-
"preLaunchTask": "generate:schemas",
2625
"env": {
2726
"NODE_ENV": "development",
2827
"TS_NODE_SKIP_IGNORE": "true"

.vscode/tasks.json

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
// for the documentation about the tasks.json format
44
"version": "2.0.0",
55
"tasks": [
6-
{
7-
"label": "generate:schemas",
8-
"type": "npm",
9-
"script": "generate:schemas",
10-
"presentation": {
11-
"reveal": "silent"
12-
}
13-
},
146
{
157
"label": "stacks-node:deploy-dev",
168
"type": "shell",

CHANGELOG.md

+54-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,61 @@
1-
## [7.14.1](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.14.0...v7.14.1) (2024-08-21)
1+
## [8.0.0-beta.6](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.0.0-beta.5...v8.0.0-beta.6) (2024-08-27)
2+
3+
4+
### ⚠ BREAKING CHANGES
5+
6+
* refactor from express to fastify (#2045)
7+
8+
### Features
9+
10+
* cursor-based pagination on blocks endpoint ([#2060](https://github.com/hirosystems/stacks-blockchain-api/issues/2060)) ([bfdcce1](https://github.com/hirosystems/stacks-blockchain-api/commit/bfdcce1c2936980299c90bf36f3d45fe74bd573c))
11+
* export events tsv directly to postgres instance ([#2048](https://github.com/hirosystems/stacks-blockchain-api/issues/2048)) ([f401a0f](https://github.com/hirosystems/stacks-blockchain-api/commit/f401a0f676ced14572b9f3f263dcc8559e831cdf))
12+
* export events tsv directly to postgres instance ([#2048](https://github.com/hirosystems/stacks-blockchain-api/issues/2048)) ([#2058](https://github.com/hirosystems/stacks-blockchain-api/issues/2058)) ([a1f5b12](https://github.com/hirosystems/stacks-blockchain-api/commit/a1f5b12675118f6d7742c54e3420c38151aef4a7))
13+
* refactor from express to fastify ([#2045](https://github.com/hirosystems/stacks-blockchain-api/issues/2045)) ([bd65fcf](https://github.com/hirosystems/stacks-blockchain-api/commit/bd65fcf93984c37a9de3cb284c43a49cb6b3694a)), closes [#2042](https://github.com/hirosystems/stacks-blockchain-api/issues/2042)
14+
15+
16+
### Bug Fixes
17+
18+
* index on `principal_stx_txs` table for faster `/v1/address/{addr}/transactions` lookups ([#2059](https://github.com/hirosystems/stacks-blockchain-api/issues/2059)) ([ab64ab7](https://github.com/hirosystems/stacks-blockchain-api/commit/ab64ab7148a3656f81f0a3c5a176c40caca3345a))
19+
20+
## [8.0.0-beta.5](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.0.0-beta.4...v8.0.0-beta.5) (2024-08-16)
21+
22+
23+
### Bug Fixes
24+
25+
* perform status endpoint sql inside transactions ([b23445c](https://github.com/hirosystems/stacks-blockchain-api/commit/b23445c85f826d0e6cf98695f985c3670d00c1db))
26+
27+
## [8.0.0-beta.4](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.0.0-beta.3...v8.0.0-beta.4) (2024-08-15)
228

329

430
### Bug Fixes
531

32+
* missing event limit max overrides on a few endpoints ([4f70930](https://github.com/hirosystems/stacks-blockchain-api/commit/4f709308fb95721866b523142536b738aa64a3eb))
33+
34+
## [8.0.0-beta.3](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.0.0-beta.2...v8.0.0-beta.3) (2024-08-15)
35+
36+
37+
### Bug Fixes
38+
39+
* tx event-limit default should be 100 ([32d0670](https://github.com/hirosystems/stacks-blockchain-api/commit/32d0670a531582b8eb269790fa7a3695a8ce7610))
40+
41+
## [8.0.0-beta.2](https://github.com/hirosystems/stacks-blockchain-api/compare/v8.0.0-beta.1...v8.0.0-beta.2) (2024-08-15)
42+
43+
44+
### Bug Fixes
45+
46+
* pagination and query param parsing bugs ([a382d2b](https://github.com/hirosystems/stacks-blockchain-api/commit/a382d2b80fc8d3e7ff49ce96047f1621749172b2)), closes [#2042](https://github.com/hirosystems/stacks-blockchain-api/issues/2042)
47+
48+
## [8.0.0-beta.1](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.13.2...v8.0.0-beta.1) (2024-08-13)
49+
50+
51+
### ⚠ BREAKING CHANGES
52+
53+
* refactor from Express to Fastify
54+
55+
### Features
56+
57+
* refactor from Express to Fastify ([aa0e51e](https://github.com/hirosystems/stacks-blockchain-api/commit/aa0e51e557491daff1a98dd36c4e952e05c58dd4)), closes [#2042](https://github.com/hirosystems/stacks-blockchain-api/issues/2042)
58+
659
* index on `principal_stx_txs` table for faster `/v1/address/{addr}/transactions` lookups ([#2059](https://github.com/hirosystems/stacks-blockchain-api/issues/2059)) ([ab64ab7](https://github.com/hirosystems/stacks-blockchain-api/commit/ab64ab7148a3656f81f0a3c5a176c40caca3345a))
760

861
## [7.14.0](https://github.com/hirosystems/stacks-blockchain-api/compare/v7.13.2...v7.14.0) (2024-08-20)

client/.eslintrc.js

-19
This file was deleted.

client/MIGRATION.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
## @stacks/blockchain-api-client (<=7.x.x) → (8.x.x)
2+
3+
## Breaking Changes
4+
5+
This library is now generated with [openapi-typescript](https://openapi-ts.dev/openapi-fetch/) rather than [swagger-codegen](https://github.com/swagger-api/swagger-codegen). Several types which previously presented as the `any` type are now fixed, and the `@stacks/stacks-blockchain-api-types` package is no longer needed.
6+
7+
8+
This repo no longer includes a schema for the Stacks Blockchain RPC interface. An alternative client library for the RPC interface can be found at https://github.com/hirosystems/stacks.js/pull/1737.
9+
10+
#### Configuration & Middleware
11+
12+
```ts
13+
// old:
14+
import { TransactionsApi, Configuration } from '@stacks/blockchain-api-client';
15+
const client = new TransactionsApi(new Configuration({
16+
basePath: 'https://api.mainnet.hiro.so',
17+
middleware: [{
18+
pre({url, init}) {
19+
init.headers = new Headers(init.headers);
20+
init.headers.set('x-custom-header', 'custom-value');
21+
return Promise.resolve({ url, init });
22+
}
23+
}]
24+
}));
25+
26+
27+
// new:
28+
import { createClient } from '@stacks/blockchain-api-client';
29+
const client = createClient({
30+
baseUrl: 'https://api.mainnet.hiro.so'
31+
});
32+
client.use({
33+
onRequest({request}) {
34+
request.headers.set('x-custom-header', 'custom-value');
35+
return request;
36+
}
37+
});
38+
```
39+
40+
#### Performing Requests
41+
42+
```ts
43+
// old:
44+
const blockTxs = await client.getTransactionsByBlock({
45+
heightOrHash: 2000,
46+
limit: 20,
47+
offset: 100
48+
});
49+
console.log('Block transactions:', blockTxs);
50+
51+
// new:
52+
const { data: blockTxs } = await client.GET('/extended/v2/blocks/{height_or_hash}/transactions', {
53+
params: {
54+
path: { height_or_hash: 2000 },
55+
query: { limit: 20, offset: 100 },
56+
}
57+
});
58+
console.log('Block transactions:', blockTxs);
59+
```
60+
61+
#### Referencing Types
62+
63+
```ts
64+
// old:
65+
import { MempoolTransactionStatsResponse } from '@stacks/blockchain-api-client';
66+
let response: MempoolTransactionStatsResponse;
67+
response = await client.getMempoolTransactionStats();
68+
69+
// new:
70+
import { OperationResponse } from '@stacks/blockchain-api-client';
71+
let response: OperationResponse['/extended/v1/tx/mempool/stats'];
72+
response = (await client.GET('/extended/v1/tx/mempool/stats')).data;
73+
```

client/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
A JS Client for the Stacks Blockchain API
55

6+
## Breaking changes from (<=7.x.x) → (8.x.x)
7+
8+
See [MIGRATION.md](./MIGRATION.md) for details.
9+
610
## Features
711

812
This package provides the ability to:

client/openapitools.json

-7
This file was deleted.

0 commit comments

Comments
 (0)