-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
722 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; | ||
const baseQuery = fetchBaseQuery({ | ||
baseUrl: import.meta.env.VITE_BACKEND_API_URL, | ||
prepareHeaders: (headers) => { | ||
headers.append('Access-Control-Allow-Origin', '*') | ||
return headers | ||
}, | ||
}); | ||
|
||
export const appApiSlice = createApi({ | ||
baseQuery, | ||
reducerPath: 'wega-api', | ||
endpoints: () => ({}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
import { createApi } from '@reduxjs/toolkit/query/react'; | ||
import { customBlockchainBaseQuery } from '../libs/rtk'; | ||
import { BlockchainAPIBase } from '../libs/wagmi'; | ||
|
||
const baseUrl = 'wega-blockchain-api' | ||
const baseQuery = customBlockchainBaseQuery({ baseUrl }, BlockchainAPIBase); | ||
export const blockchainApiSlice = createApi({ | ||
baseQuery, | ||
reducerPath: baseUrl, | ||
endpoints: () => ({}) | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
import { configureStore, ThunkAction, Action } from '@reduxjs/toolkit'; | ||
import appReducer from '../containers/App/AppSlice' | ||
import { appApiSlice } from '../containers/App/api' | ||
import { appApiSlice } from '../containers/App/api'; | ||
import { blockchainApiSlice } from './blockchainApiSlice'; | ||
import { appApiSlice as newAppApiSlice } from './apiSlice'; | ||
import intlReducer from '../containers/LanguageProvider/intlSlice' | ||
import blockchainReducer from '../api/blockchain/blockchainSlice' | ||
|
||
|
||
export const store = configureStore({ | ||
reducer: { | ||
[appApiSlice.reducerPath]: appApiSlice.reducer, | ||
[newAppApiSlice.reducerPath]: newAppApiSlice.reducer, | ||
[blockchainApiSlice.reducerPath]: blockchainApiSlice.reducer, | ||
blockchain: blockchainReducer, | ||
app: appReducer, | ||
language: intlReducer, | ||
|
||
}, | ||
middleware: (getDefaultMiddleware) => getDefaultMiddleware({ | ||
serializableCheck: false | ||
}).concat(appApiSlice.middleware), | ||
}).concat( | ||
appApiSlice.middleware, | ||
newAppApiSlice.middleware, | ||
blockchainApiSlice.middleware | ||
), | ||
devTools: import.meta.env.VITE_REDUX_DEBUG === "true" ? true : false | ||
}); | ||
export type AppDispatch = typeof store.dispatch; | ||
export type RootState = ReturnType<typeof store.getState>; | ||
export type AppThunk<ReturnType = void> = ThunkAction<ReturnType,RootState,unknown,Action<string>>; | ||
export type AppThunk<ReturnType = void> = ThunkAction<ReturnType,RootState,unknown,Action<string> | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.