Skip to content

Commit

Permalink
Replaced Near Wallet API by Coingecko API
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrosimao committed Feb 17, 2022
1 parent deedbbe commit f41fca7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/redux/api/nearQuote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ export interface NearQuoteType {
export const nearQuoteApi = createApi({
reducerPath: 'nearQuote',
baseQuery: fetchBaseQuery({
baseUrl: 'https://near-contract-helper.onrender.com',
baseUrl: 'https://api.coingecko.com/api/v3/simple/',
}),
endpoints: (builder) => ({
// returns USD quote for Near
getNearQuote: builder.query<number, void>({
query: () => `fiat`,
query: () => ({
url: 'price',
params: {
include_last_updated_at: true,
vs_currencies: 'usd,eur,cny',
ids: 'Near',
},
}),
// Pick out data and prevent nested properties in a hook or selector
transformResponse: (response: NearQuoteType) => response?.near?.usd,
}),
Expand Down

0 comments on commit f41fca7

Please sign in to comment.