Skip to content

Commit

Permalink
fix: getPriceQuote type (#2086)
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi authored Mar 5, 2025
1 parent 532944b commit 43c54f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/getPriceQuote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const mockParams: GetPriceQuoteParams = {
};

const mockSuccessResponse: GetPriceQuoteResponse = {
priceQuote: [
priceQuotes: [
{
name: 'Ethereum',
symbol: 'ETH',
Expand Down
2 changes: 1 addition & 1 deletion src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,6 @@ type PriceQuote = {
export type GetPriceQuoteResponse =
| {
/** The array of price quotes for the tokens */
priceQuote: PriceQuote[];
priceQuotes: PriceQuote[];
}
| APIError;
6 changes: 3 additions & 3 deletions src/internal/hooks/useExchangeRate.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('useExchangeRate', () => {
const mockSetExchangeRateLoading = vi.fn();

(getPriceQuote as Mock).mockResolvedValue({
priceQuote: [
priceQuotes: [
{
name: 'ETH',
symbol: 'ETH',
Expand Down Expand Up @@ -65,7 +65,7 @@ describe('useExchangeRate', () => {
const mockSetExchangeRateLoading = vi.fn();

(getPriceQuote as Mock).mockResolvedValue({
priceQuote: [
priceQuotes: [
{
name: 'ETH',
symbol: 'ETH',
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('useExchangeRate', () => {
const mockSetExchangeRateLoading = vi.fn();

(getPriceQuote as Mock).mockResolvedValue({
priceQuote: [
priceQuotes: [
{
name: 'ETH',
symbol: 'ETH',
Expand Down
2 changes: 1 addition & 1 deletion src/internal/hooks/useExchangeRate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function useExchangeRate({
console.error('Error fetching price quote:', response.error);
return;
}
const priceQuote = response.priceQuote[0];
const priceQuote = response.priceQuotes[0];

const rate =
selectedInputType === 'crypto'
Expand Down

0 comments on commit 43c54f9

Please sign in to comment.