Skip to content

Commit

Permalink
feat: upgrade api layer
Browse files Browse the repository at this point in the history
  • Loading branch information
He1DAr committed Nov 14, 2024
1 parent 6ee9484 commit 25e066e
Show file tree
Hide file tree
Showing 48 changed files with 657 additions and 891 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
"@reduxjs/toolkit": "1.9.7",
"@sentry/nextjs": "8.26.0",
"@stacks/auth": "6.15.0",
"@stacks/blockchain-api-client": "7.12.0",
"@stacks/blockchain-api-client": "8.2.2",
"@stacks/common": "6.15.1-pr.0bcf867e.0+0bcf867e",
"@stacks/connect": "7.7.1",
"@stacks/connect-react": "22.4.2",
"@stacks/connect-ui": "6.4.1",
"@stacks/network": "6.13.0",
"@stacks/transactions": "6.15.1-pr.0bcf867e.0+0bcf867e",
"@stacks/transactions": "7.0.2",
"@tanstack/react-query": "5.8.4",
"@tippyjs/react": "4.2.6",
"@types/cookie": "0.5.2",
Expand Down
155 changes: 64 additions & 91 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions src/api/getApiClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { createClient } from '@stacks/blockchain-api-client';

import packageJson from '../../package.json';
import { RELEASE_TAG_NAME } from '../common/constants/env';

export const getApiClient = (baseUrl: string) => {
const apiClient = createClient({
baseUrl,
});

apiClient.use({
onRequest({ request }) {
request.headers.set('x-hiro-product', 'explorer');
request.headers.set('x-hiro-version', RELEASE_TAG_NAME || packageJson.version);
return request;
},
});

return apiClient;
};
Loading

0 comments on commit 25e066e

Please sign in to comment.