Skip to content

Commit

Permalink
fix: adds adapter to chain history provider
Browse files Browse the repository at this point in the history
  • Loading branch information
VanessaPC committed May 8, 2024
1 parent 5a2aa15 commit a0c0741
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getBaseUrlForChain } from '@src/utils/chain';
import { useMemo } from 'react';
import { chainHistoryHttpProvider } from '@cardano-sdk/cardano-services-client';
import { logger } from '@lib/wallet-api-ui';
import axiosFetchAdapter from '@vespaiach/axios-fetch-adapter';

export type NetworkType = 'Mainnet' | 'Preprod' | 'Preview' | 'Sanchonet';

Expand All @@ -13,5 +14,8 @@ type UseChainHistoryProviderArgs = {
export const useChainHistoryProvider = ({ chainName }: UseChainHistoryProviderArgs) => {
const baseCardanoServicesUrl = getBaseUrlForChain(chainName);

return useMemo(() => chainHistoryHttpProvider({ baseUrl: baseCardanoServicesUrl, logger }), [baseCardanoServicesUrl]);
return useMemo(
() => chainHistoryHttpProvider({ adapter: axiosFetchAdapter, baseUrl: baseCardanoServicesUrl, logger }),
[baseCardanoServicesUrl]
);
};

0 comments on commit a0c0741

Please sign in to comment.