Skip to content

Commit eb01944

Browse files
committed
consolidation of .env variables
1 parent e29dc54 commit eb01944

File tree

3 files changed

+122
-96
lines changed

3 files changed

+122
-96
lines changed

.env

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
NEXT_PUBLIC_DASHBOARD_API=https://dashboard-api.libre.org
2-
NEXT_PUBLIC_LIBRE_API=https://lb.libre.org/v2/history
3-
NEXT_PUBLIC_HYPERION_API=https://lb.libre.org/v2
4-
NEXT_PUBLIC_LIBRE_DASHBOARD_API=https://dashboard-api.libre.org
5-
NEXT_PUBLIC_BLOCK_API=https://lb.libre.org/v1
1+
NEXT_PUBLIC_LIBRE_API=https://dashboard-api.libre.org
2+
NEXT_PUBLIC_HISTORY_API=https://lb.libre.org

package.json

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
1-
{
2-
"name": "libreblocks",
3-
"version": "0.1.0",
4-
"private": false,
5-
"scripts": {
6-
"dev": "next dev",
7-
"build": "next build",
8-
"start": "next start",
9-
"lint": "next lint",
10-
"lint:fix": "eslint src --fix && pnpm format",
11-
"lint:strict": "eslint --max-warnings=0 src",
12-
"typecheck": "tsc --noEmit --incremental false",
13-
"format": "prettier -w .",
14-
"format:check": "prettier -c ."
15-
},
16-
"dependencies": {
17-
"@emotion/react": "^11.11.0",
18-
"@emotion/styled": "^11.11.0",
19-
"@headlessui/react": "^1.7.15",
20-
"@mui/icons-material": "^5.11.16",
21-
"@mui/material": "^5.13.4",
22-
"@mui/x-data-grid": "^6.6.0",
23-
"@next/font": "13.4.4",
24-
"@radix-ui/react-dialog": "^1.0.4",
25-
"@tanstack/react-query": "^4.29.12",
26-
"@vercel/og": "^0.5.6",
27-
"axios": "^1.4.0",
28-
"bip39": "^3.1.0",
29-
"clsx": "^1.2.1",
30-
"dayjs": "^1.11.8",
31-
"eosjs-ecc": "^4.0.0",
32-
"framer-motion": "^10.12.16",
33-
"hdkey": "^2.1.0",
34-
"immer": "^10.0.2",
35-
"lucide-react": "^0.236.0",
36-
"next": "13.4.4",
37-
"react": "18.2.0",
38-
"react-dom": "18.2.0",
39-
"react-ga4": "^2.1.0",
40-
"react-hotkeys-hook": "^4.4.0",
41-
"react-router-dom": "^6.14.0",
42-
"react-timeago": "^7.1.0",
43-
"react-toastify": "^9.1.3",
44-
"recharts": "^2.6.2",
45-
"use-immer": "^0.9.0",
46-
"wif": "^2.0.6"
47-
},
48-
"devDependencies": {
49-
"@svgr/webpack": "^8.0.1",
50-
"@tailwindcss/forms": "^0.5.3",
51-
"@types/hdkey": "^2.0.1",
52-
"@types/node": "20.2.5",
53-
"@types/react": "18.2.8",
54-
"@types/react-dom": "18.2.4",
55-
"@types/react-timeago": "^4.1.3",
56-
"@types/wif": "^2.0.2",
57-
"@typescript-eslint/eslint-plugin": "^5.59.9",
58-
"@typescript-eslint/parser": "^5.59.9",
59-
"autoprefixer": "^10.4.13",
60-
"cssnano": "^6.0.1",
61-
"eslint": "8.42.0",
62-
"eslint-config-next": "13.4.4",
63-
"postcss": "^8.4.24",
64-
"prettier": "^2.8.8",
65-
"prettier-plugin-tailwindcss": "^0.3.0",
66-
"tailwindcss": "^3.3.2",
67-
"typescript": "5.1.3"
68-
},
69-
"license": "UNLICENSED"
70-
}
1+
{
2+
"name": "libreblocks",
3+
"version": "0.1.0",
4+
"private": false,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint",
10+
"lint:fix": "eslint src --fix && pnpm format",
11+
"lint:strict": "eslint --max-warnings=0 src",
12+
"typecheck": "tsc --noEmit --incremental false",
13+
"format": "prettier -w .",
14+
"format:check": "prettier -c ."
15+
},
16+
"dependencies": {
17+
"@emotion/react": "^11.11.0",
18+
"@emotion/styled": "^11.11.0",
19+
"@headlessui/react": "^1.7.15",
20+
"@mui/icons-material": "^5.11.16",
21+
"@mui/material": "^5.13.4",
22+
"@mui/x-data-grid": "^6.6.0",
23+
"@next/font": "13.4.4",
24+
"@radix-ui/react-dialog": "^1.0.4",
25+
"@tanstack/react-query": "^4.29.12",
26+
"@vercel/og": "^0.5.6",
27+
"axios": "^1.4.0",
28+
"bip39": "^3.1.0",
29+
"clsx": "^1.2.1",
30+
"dayjs": "^1.11.8",
31+
"eosjs-ecc": "^4.0.0",
32+
"framer-motion": "^10.12.16",
33+
"hdkey": "^2.1.0",
34+
"immer": "^10.0.2",
35+
"lucide-react": "^0.236.0",
36+
"next": "13.4.4",
37+
"react": "18.2.0",
38+
"react-dom": "18.2.0",
39+
"react-ga4": "^2.1.0",
40+
"react-hotkeys-hook": "^4.4.0",
41+
"react-router-dom": "^6.14.0",
42+
"react-timeago": "^7.1.0",
43+
"react-toastify": "^9.1.3",
44+
"recharts": "^2.6.2",
45+
"use-immer": "^0.9.0",
46+
"wif": "^2.0.6"
47+
},
48+
"devDependencies": {
49+
"@svgr/webpack": "^8.0.1",
50+
"@tailwindcss/forms": "^0.5.3",
51+
"@types/hdkey": "^2.0.1",
52+
"@types/node": "20.2.5",
53+
"@types/react": "18.2.8",
54+
"@types/react-dom": "18.2.4",
55+
"@types/react-timeago": "^4.1.3",
56+
"@types/wif": "^2.0.2",
57+
"@typescript-eslint/eslint-plugin": "^5.59.9",
58+
"@typescript-eslint/parser": "^5.59.9",
59+
"autoprefixer": "^10.4.13",
60+
"cssnano": "^6.0.1",
61+
"eslint": "8.42.0",
62+
"eslint-config-next": "13.4.4",
63+
"postcss": "^8.4.24",
64+
"prettier": "^2.8.8",
65+
"prettier-plugin-tailwindcss": "^0.3.0",
66+
"tailwindcss": "^3.3.2",
67+
"typescript": "5.1.3"
68+
},
69+
"license": "UNLICENSED"
70+
}

src/lib/api.ts

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,61 @@ import type { QueryKey } from '@tanstack/react-query';
22
import axios from 'axios';
33

44
export const getCoinInfo = async () => {
5-
const { data } = await axios.get(`${process.env.NEXT_PUBLIC_DASHBOARD_API}/tokens`);
5+
const { data } = await axios.get(
6+
`${process.env.NEXT_PUBLIC_LIBRE_API}/tokens`
7+
);
68
return data;
79
};
810

911
export const getChainInfo = async () => {
10-
const { data } = await axios.get(`${process.env.NEXT_PUBLIC_DASHBOARD_API}/stats/chain`);
12+
const { data } = await axios.get(
13+
`${process.env.NEXT_PUBLIC_LIBRE_API}/stats/chain`
14+
);
1115
return data;
1216
};
1317

1418
export const getExchangeRates = async () => {
15-
const { data } = await axios.get(`${process.env.NEXT_PUBLIC_DASHBOARD_API}/exchange-rates`);
19+
const { data } = await axios.get(
20+
`${process.env.NEXT_PUBLIC_LIBRE_API}/exchange-rates`
21+
);
1622
return data;
1723
};
1824

19-
export const getLastTransactions = async ({ queryKey }: { queryKey: QueryKey }) => {
25+
export const getLastTransactions = async ({
26+
queryKey,
27+
}: {
28+
queryKey: QueryKey;
29+
}) => {
2030
const [_key, queryParams] = queryKey;
21-
const { data } = await axios.get(`${process.env.NEXT_PUBLIC_LIBRE_API}/get_actions`, {
22-
params: queryParams,
23-
});
31+
const { data } = await axios.get(
32+
`${process.env.NEXT_PUBLIC_HISTORY_API}/v2/history/get_actions`,
33+
{
34+
params: queryParams,
35+
}
36+
);
2437

2538
return data;
2639
};
2740

2841
export const getAccount = async ({ queryKey }: { queryKey: QueryKey }) => {
2942
const [_key, queryParams] = queryKey;
30-
const { data } = await axios.get(`${process.env.NEXT_PUBLIC_HYPERION_API}/state/get_account`, {
31-
params: queryParams,
32-
});
43+
const { data } = await axios.get(
44+
`${process.env.NEXT_PUBLIC_HISTORY_API}/v2/state/get_account`,
45+
{
46+
params: queryParams,
47+
}
48+
);
3349
return data;
3450
};
3551

3652
export const getActions = async ({ queryKey }: { queryKey: QueryKey }) => {
3753
const [_key, queryParams] = queryKey;
38-
const { data } = await axios.get(`${process.env.NEXT_PUBLIC_HYPERION_API}/history/get_actions`, {
39-
params: queryParams, //limit=20&skip=5&account=salimcan
40-
});
54+
const { data } = await axios.get(
55+
`${process.env.NEXT_PUBLIC_HISTORY_API}/v2/history/get_actions`,
56+
{
57+
params: queryParams, //limit=20&skip=5&account=salimcan
58+
}
59+
);
4160
return data;
4261
};
4362

@@ -47,9 +66,12 @@ export const getTransaction = async ({ queryKey }: { queryKey: any }) => {
4766
return [];
4867
}
4968

50-
const { data } = await axios.get(`${process.env.NEXT_PUBLIC_LIBRE_API}/get_transaction`, {
51-
params: queryParams,
52-
});
69+
const { data } = await axios.get(
70+
`${process.env.NEXT_PUBLIC_HISTORY_API}/v2/history/get_transaction`,
71+
{
72+
params: queryParams,
73+
}
74+
);
5375
return data;
5476
};
5577

@@ -59,19 +81,26 @@ export const getBlock = async ({ queryKey }: { queryKey: any }) => {
5981
return [];
6082
}
6183

62-
const { data } = await axios.post(`${process.env.NEXT_PUBLIC_BLOCK_API}/chain/get_block`, {
63-
block_num_or_id: queryParams.block_num_or_id,
64-
});
84+
const { data } = await axios.post(
85+
`${process.env.NEXT_PUBLIC_HISTORY_API}/v1/chain/get_block`,
86+
{
87+
block_num_or_id: queryParams.block_num_or_id,
88+
}
89+
);
6590
return data;
6691
};
6792

6893
export const getProducers = async () => {
69-
const { data } = await axios.get(`${process.env.NEXT_PUBLIC_LIBRE_DASHBOARD_API}/producers`);
94+
const { data } = await axios.get(
95+
`${process.env.NEXT_PUBLIC_LIBRE_API}/producers`
96+
);
7097
return data;
7198
};
7299

73100
export const getTokens = async () => {
74-
const { data } = await axios.get(`${process.env.NEXT_PUBLIC_DASHBOARD_API}/tokens`);
101+
const { data } = await axios.get(
102+
`${process.env.NEXT_PUBLIC_LIBRE_API}/tokens`
103+
);
75104
return data;
76105
};
77106

0 commit comments

Comments
 (0)